/*
 Theme Name: Madang Child Theme
 Theme URI: http://madang.kenzap.com
 Author: Kenzap
 Author URI: http://kenzap.com
 Description: Madang - Healthy Food Delivery WordPress Theme
 Version: 1.6.3

 Template: madang
 */

/*************** ADD CUSTOM CSS HERE.   ***************/


/* Q-029: Match MeanMenu's initial mobile state before its DOM-ready setup.
 * The parent theme forces .collapse to display:block at all widths. */
@media only screen and (max-width: 768px) {
    .wrapper > header .menu-block > nav.navbar {
        display: none;
    }
}

/* Q-029: Owl wraps slides on startup; show its first frame immediately.
 * Direct-child matching stops applying once Owl creates its wrapper. */
body.home #panel-2446-0-0-0 #owl-demo > .item:not(:first-child) {
    display: none;
}

/* ==========================================================================
 * Q-029 Layout & Impeccable Pass (scoped strictly to Home, Menu, Archives,
 * and Single Product; About, FAQ, and Contact are untouched)
 * ========================================================================== */

/* 1. Eliminate SiteOrigin's hidden 30px panel drift on Home & Menu so section
 *    spacing follows an exact 120px desktop / 80px tablet / 60px mobile cadence. */
body.home .panel-grid .so-panel,
body.page-id-2434 .panel-grid .so-panel {
    margin-bottom: 0 !important;
}

/* Standard section spacing: 60px top + 60px bottom = 120px between sections on desktop;
 * 120px adjacent to full-bleed bands (hero, video, footer). */
body.home section.block,
body.page-id-2434 section.block,
body.home .sf-intro-panel,
body.page-id-2434 .sf-intro-panel,
body.home .sf-questions-section,
body.page-id-2434 .sf-questions-section {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body.home .sf-after-fullbleed,
body.page-id-2434 .sf-after-fullbleed,
body.home .sf-after-fullbleed section.block {
    padding-top: 120px !important;
}

body.home .sf-before-fullbleed,
body.page-id-2434 .sf-before-fullbleed,
body.home .sf-before-fullbleed section.block,
body.page-id-2434 .sf-before-fullbleed section.block {
    padding-bottom: 120px !important;
}

/* Section CTA button grouped tightly (40px) beneath its own section's content */
body.home .sf-has-cta section.block,
body.home .sf-questions-section.sf-has-cta,
body.page-id-2434 .sf-questions-section.sf-has-cta {
    padding-bottom: 0 !important;
}

body.home .sf-intro-panel,
body.page-id-2434 .sf-intro-panel,
body.home .sf-questions-section,
body.page-id-2434 .sf-questions-section,
body.home .sf-section-cta,
body.page-id-2434 .sf-section-cta {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

body.home .sf-section-cta,
body.page-id-2434 .sf-section-cta {
    padding-top: 40px !important;
    padding-bottom: 60px !important;
}

body.home .sf-section-cta.sf-before-fullbleed,
body.page-id-2434 .sf-section-cta.sf-before-fullbleed {
    padding-bottom: 120px !important;
}

/* Tablet rhythm (~80px between sections) */
@media only screen and (min-width: 768px) and (max-width: 992px) {
    body.home section.block,
    body.page-id-2434 section.block,
    body.home .sf-intro-panel,
    body.page-id-2434 .sf-intro-panel,
    body.home .sf-questions-section,
    body.page-id-2434 .sf-questions-section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
    body.home .sf-after-fullbleed,
    body.page-id-2434 .sf-after-fullbleed,
    body.home .sf-after-fullbleed section.block {
        padding-top: 80px !important;
    }
    body.home .sf-before-fullbleed,
    body.page-id-2434 .sf-before-fullbleed,
    body.home .sf-before-fullbleed section.block,
    body.page-id-2434 .sf-before-fullbleed section.block,
    body.home .sf-section-cta.sf-before-fullbleed,
    body.page-id-2434 .sf-section-cta.sf-before-fullbleed {
        padding-bottom: 80px !important;
    }
    body.home .sf-section-cta,
    body.page-id-2434 .sf-section-cta {
        padding-top: 36px !important;
        padding-bottom: 40px !important;
    }
}

/* Mobile rhythm (~60px between sections) */
@media only screen and (max-width: 767px) {
    body.home section.block,
    body.page-id-2434 section.block,
    body.home .sf-intro-panel,
    body.page-id-2434 .sf-intro-panel,
    body.home .sf-questions-section,
    body.page-id-2434 .sf-questions-section {
        padding-top: 30px !important;
        padding-bottom: 30px !important;
    }
    body.home .sf-after-fullbleed,
    body.page-id-2434 .sf-after-fullbleed,
    body.home .sf-after-fullbleed section.block {
        padding-top: 60px !important;
    }
    body.home .sf-before-fullbleed,
    body.page-id-2434 .sf-before-fullbleed,
    body.home .sf-before-fullbleed section.block,
    body.page-id-2434 .sf-before-fullbleed section.block,
    body.home .sf-section-cta.sf-before-fullbleed,
    body.page-id-2434 .sf-section-cta.sf-before-fullbleed {
        padding-bottom: 60px !important;
    }
    body.home .sf-section-cta,
    body.page-id-2434 .sf-section-cta {
        padding-top: 32px !important;
        padding-bottom: 30px !important;
    }
}

/* 2. Section titles at real heading scale (24px desktop, 20px mobile) &
 *    >= 32px heading-to-content spacing across Home and Menu. */
body.home section.block .top-text-header,
body.page-id-2434 section.block .top-text-header,
body.home section.block.how-it-works-block .top-text,
body.page-id-2434 section.block.how-it-works-block .top-text {
    width: 100%;
    margin: 0 auto 40px !important;
}

body.home section.block .top-text-header h4,
body.page-id-2434 section.block .top-text-header h4,
body.home section.block.how-it-works-block .top-text h4,
body.page-id-2434 section.block.how-it-works-block .top-text h4,
body.home .sf-questions-section h3.widget-title,
body.page-id-2434 .sf-questions-section h3.widget-title {
    font-family: "Montserrat-Light", sans-serif;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    color: #2d2d2d;
    margin: 0 0 40px 0 !important;
    border: none !important;
    padding: 0 !important;
}

body.home section.block .top-text-header h4,
body.page-id-2434 section.block .top-text-header h4,
body.home section.block.how-it-works-block .top-text h4,
body.page-id-2434 section.block.how-it-works-block .top-text h4 {
    margin-bottom: 0 !important;
}

@media only screen and (max-width: 767px) {
    body.home section.block .top-text-header,
    body.page-id-2434 section.block .top-text-header,
    body.home section.block.how-it-works-block .top-text,
    body.page-id-2434 section.block.how-it-works-block .top-text {
        margin: 0 auto 32px !important;
    }
    body.home section.block .top-text-header h4,
    body.page-id-2434 section.block .top-text-header h4,
    body.home section.block.how-it-works-block .top-text h4,
    body.page-id-2434 section.block.how-it-works-block .top-text h4,
    body.home .sf-questions-section h3.widget-title,
    body.page-id-2434 .sf-questions-section h3.widget-title {
        font-size: 20px;
        margin: 0 0 32px 0 !important;
    }
    body.home section.block .top-text-header h4,
    body.page-id-2434 section.block .top-text-header h4,
    body.home section.block.how-it-works-block .top-text h4,
    body.page-id-2434 section.block.how-it-works-block .top-text h4 {
        margin-bottom: 0 !important;
    }
}

/* 3. Intro paragraph & pre-footer copy readability (65-72ch measure, crisp contrast, zero extra bottom margin) */
body.home .sf-intro-panel .textwidget p,
body.page-id-2434 .sf-intro-panel .textwidget p {
    max-width: 68ch;
    margin: 0 auto !important;
    font-size: 16px;
    line-height: 1.75;
    color: #484848;
    text-align: center;
}

body.home section.subscribe-block .top-text {
    max-width: 66ch;
    width: 100%;
    margin: 0 auto !important;
    font-size: 15px;
    line-height: 1.75;
    color: #484848;
}

body.home section.subscribe-block .top-text a {
    color: #0a0a0a;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 4. Center "Shop by diet" & Instagram category grids on Home & Menu across all viewports
 *    and improve white label contrast over bright food photos. */
body.home .cat-list-wrap > .container > .row:nth-child(2),
body.page-id-2434 .cat-list-wrap > .container > .row:nth-child(2) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

body.home .cat-list-wrap > .container > .row:nth-child(2) > .cat-wrap,
body.page-id-2434 .cat-list-wrap > .container > .row:nth-child(2) > .cat-wrap {
    float: none;
}

@media only screen and (min-width: 768px) {
    body.home .cat-list-wrap > .container > .row:nth-child(2) > .cat-wrap,
    body.page-id-2434 .cat-list-wrap > .container > .row:nth-child(2) > .cat-wrap,
    body.home .cat-list-wrap > .container > .cat-wrap {
        margin-bottom: 0;
    }
}

@media only screen and (max-width: 767px) {
    body.home .cat-list-wrap > .container > .row:nth-child(2) > .cat-wrap:last-child,
    body.page-id-2434 .cat-list-wrap > .container > .row:nth-child(2) > .cat-wrap:last-child,
    body.home .cat-list-wrap > .container > .cat-wrap:nth-last-child(-n+2) {
        margin-bottom: 0;
    }
}

body.home .cat-list-wrap .cat-wrap a figure img,
body.page-id-2434 .cat-list-wrap .cat-wrap a figure img {
    opacity: 0.76;
}

body.home .cat-list-wrap .cat-wrap a:hover figure img,
body.page-id-2434 .cat-list-wrap .cat-wrap a:hover figure img {
    opacity: 0.9;
}

body.home .cat-list-wrap .cat-wrap a span,
body.page-id-2434 .cat-list-wrap .cat-wrap a span {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
    font-weight: 600;
}

/* 5. Center "Customer favorites" bxSlider on Home at 1440px, tablet, and 390px mobile */
body.home .featured-menu-slider {
    padding-bottom: 8px;
}

body.home .featured-menu-block ul.bxslider1 {
    margin: 0 !important;
}

body.home .featured-menu-slider .bx-viewport:before,
body.home .featured-menu-slider .bx-viewport:after {
    display: none !important;
}

body.home .featured-menu-slider ul.bxslider1 > li {
    padding: 0 !important;
}

body.home .featured-menu-slider ul.bxslider1 > li > a {
    margin: 0 12px;
}

body.home .featured-menu-slider .bx-wrapper {
    position: relative !important;
    margin: 0 auto !important;
    overflow: hidden;
}

@media only screen and (min-width: 1200px) {
    body.home .featured-menu-slider .bx-wrapper {
        max-width: 1080px !important;
    }
}

@media only screen and (min-width: 768px) and (max-width: 1199px) {
    body.home .featured-menu-slider .bx-wrapper {
        max-width: 100% !important;
    }
}

@media only screen and (max-width: 767px) {
    body.home .featured-menu-slider ul.bxslider1 > li > a {
        margin: 0;
    }
    body.home .featured-menu-slider .bx-wrapper {
        max-width: 270px !important;
        padding-bottom: 36px;
    }
    body.home .featured-menu-slider .bx-wrapper .bx-viewport {
        overflow: hidden !important;
    }
    body.home .featured-menu-slider .bx-controls {
        display: block !important;
    }
    body.home .featured-menu-slider .bx-wrapper .bx-pager {
        bottom: 0 !important;
        padding-top: 12px;
    }
}

/* 6. Consistent icon sizing in Madang Info 3-column sections */
body.home .how-it-works-block .feature-item-wrap figure img,
body.page-id-2434 .how-it-works-block .feature-item-wrap figure img {
    height: 68px;
    width: auto;
    margin: 0 auto;
}

/* 7. Full-width Questions Accordion readability & polish */
body.home .sf-questions-section .sow-accordion,
body.page-id-2434 .sf-questions-section .sow-accordion {
    max-width: 920px;
    margin: 0 auto;
}

body.home .sf-questions-section .sow-accordion-panel-header,
body.page-id-2434 .sf-questions-section .sow-accordion-panel-header {
    font-family: "Montserrat-Regular", sans-serif;
    font-size: 16px;
    line-height: 1.45;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.home .sf-questions-section .sow-accordion-panel-border p,
body.page-id-2434 .sf-questions-section .sow-accordion-panel-border p {
    margin: 0 !important;
    font-size: 15px;
    line-height: 1.7;
    color: #484848;
}

body.home .sf-section-cta a.sowb-button,
body.page-id-2434 .sf-section-cta a.sowb-button {
    font-family: "Montserrat-Regular", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 13px !important;
    padding: 15px 34px !important;
}

/* 8. Menu (/menu1/) product grid row wrap alignment */
body.page-id-2434 .menu-listing-wrap.gd-view {
    display: flex;
    flex-wrap: wrap;
}

body.page-id-2434 .menu-listing-wrap.gd-view > .menu-item {
    display: flex;
    flex-direction: column;
}

body.page-id-2434 .menu-listing-wrap.gd-view > .menu-item > .menu-item-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* 9. WooCommerce Category Archives (/product-category/*): center 3-card Paleo row &
 *    incomplete rows, equalize button heights across 1- and 2-line titles, and standardize spacing. */
body.tax-product_cat .site-content.product-category {
    padding: 80px 0 120px;
}

body.tax-product_cat .product-category .term-description {
    max-width: 72ch;
    margin: 0 auto 48px;
    text-align: center;
}

body.tax-product_cat .product-category .term-description h1 {
    margin-top: 8px;
    margin-bottom: 24px;
    font-size: 32px;
    line-height: 1.25;
}

body.tax-product_cat .product-category .term-description p {
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.75;
    color: #484848;
}

body.tax-product_cat .woocommerce-result-count,
body.tax-product_cat .woocommerce-ordering {
    margin-bottom: 32px !important;
}

body.tax-product_cat ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 36px 30px !important;
    margin: 0 !important;
    clear: both;
}

body.tax-product_cat ul.products::before,
body.tax-product_cat ul.products::after {
    display: none !important;
}

body.tax-product_cat ul.products li.product {
    float: none !important;
    margin: 0 !important;
    width: calc(25% - 22.5px) !important;
    display: flex !important;
    flex-direction: column !important;
}

body.tax-product_cat ul.products li.product .woocommerce-loop-product__link {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
}

body.tax-product_cat ul.products li.product .price {
    margin-top: auto !important;
    margin-bottom: 16px !important;
}

body.tax-product_cat ul.products li.product a.button {
    width: 100%;
    margin-top: 0 !important;
}

@media only screen and (min-width: 768px) and (max-width: 992px) {
    body.tax-product_cat .site-content.product-category {
        padding: 60px 0 80px;
    }
    body.tax-product_cat ul.products li.product {
        width: calc(33.333% - 20px) !important;
    }
}

@media only screen and (max-width: 767px) {
    body.tax-product_cat .site-content.product-category {
        padding: 40px 0 60px;
    }
    body.tax-product_cat .product-category .term-description {
        margin-bottom: 32px;
    }
    body.tax-product_cat .product-category .term-description h1 {
        font-size: 26px;
    }
    body.tax-product_cat ul.products {
        gap: 28px 16px !important;
    }
    body.tax-product_cat ul.products li.product {
        width: calc(50% - 8px) !important;
    }
    body.tax-product_cat ul.products li.product a.button {
        padding: 12px 10px !important;
        font-size: 12px !important;
    }
}

/* 10. WooCommerce Single Product (/product/*): group quantity + Add to Cart,
 *     clean FDA label alignment, and equalize Related Products card heights. */
body.single-product .product-single .container {
    padding: 80px 15px 120px !important;
}

body.single-product div.product form.cart {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 28px;
}

body.single-product div.product form.cart::before,
body.single-product div.product form.cart::after {
    display: none;
}

body.single-product div.product form.cart div.quantity {
    float: none !important;
    margin: 0 !important;
}

body.single-product div.product form.cart div.quantity input.qty {
    width: 68px;
    height: 50px;
    text-align: center;
    font-size: 16px;
    border: 1px solid #cecece;
}

body.single-product div.product form.cart .single_add_to_cart_button {
    float: none !important;
    margin: 0 !important;
    height: 50px;
    padding: 0 36px !important;
}

body.single-product .woocommerce-tabs .panel#tab-description {
    text-align: left !important;
    max-width: 540px;
}

body.single-product section.related.products {
    padding-top: 60px;
    clear: both;
}

body.single-product section.related.products > h2 {
    font-size: 24px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 36px;
}

body.single-product section.related.products ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 30px !important;
    margin: 0 !important;
}

body.single-product section.related.products ul.products::before,
body.single-product section.related.products ul.products::after {
    display: none !important;
}

body.single-product section.related.products ul.products li.product {
    float: none !important;
    margin: 0 !important;
    width: calc(25% - 22.5px) !important;
    display: flex !important;
    flex-direction: column !important;
}

body.single-product section.related.products ul.products li.product .woocommerce-loop-product__link {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
}

body.single-product section.related.products ul.products li.product .price {
    margin-top: auto !important;
    margin-bottom: 16px !important;
}

body.single-product section.related.products ul.products li.product a.button {
    width: 100%;
}

@media only screen and (max-width: 767px) {
    body.single-product .product-single .container {
        padding: 40px 15px 60px !important;
    }
    body.single-product section.related.products {
        padding-top: 32px;
    }
    body.single-product section.related.products > h2 {
        font-size: 20px;
        margin-bottom: 28px;
    }
    body.single-product section.related.products ul.products {
        gap: 24px 16px !important;
    }
    body.single-product section.related.products ul.products li.product {
        width: calc(50% - 8px) !important;
    }
    body.single-product section.related.products ul.products li.product a.button {
        padding: 12px 10px !important;
        font-size: 12px !important;
    }
}
