/* ==========================================================================
   Products page (ID 46752) – hero intro text + subscribe form below image
   Loaded ONLY on page 46752 (see functions.php: mgs_product_page_styles).

   Assets:
   - Banner background  main-banner-products.svg      1434 x 625
   - Products image     new-product-smallimage-1.webp 1013 x 496

   The products image overlaps the bottom of the banner using the existing
   theme offsets (15rem desktop/tablet, 100px <=768px, 80px <=576px).
   The banner's bottom padding reserves that overlap plus a gap, so the
   intro text can never run under the image, whatever its length.
   ========================================================================== */

:root {
    --mgs-product-hero-overlap: 15rem; /* existing theme value (style-new.css) */
    --mgs-product-hero-gap: 2.5rem;
}

/* Banner: content-driven height instead of the fixed 628px set inline in
   header.php. min-height keeps the original banner height on larger screens. */
section.header-section.product-hero {
    height: auto;
    min-height: 628px;
    padding-bottom: calc(var(--mgs-product-hero-overlap) + var(--mgs-product-hero-gap));
}

/* Intro paragraph (replaces the subscribe form in the banner) */
section.header-section.product-hero .product-hero-intro {
    max-width: 780px;
    margin: 0 auto;
    font-family: 'gotham', 'Gotham', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--text-color, #333);
    text-align: center;
}

@media (max-width: 1199.98px) {
    section.header-section.product-hero .product-hero-intro {
        font-size: 17px;
    }
}

/* --------------------------------------------------------------------------
   Mobile / small tablet (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --mgs-product-hero-overlap: 100px; /* existing theme value (style.css) */
        --mgs-product-hero-gap: 2rem;
    }

    section.header-section.product-hero {
        min-height: 0;
    }

    section.header-section.product-hero .product-hero-intro {
        font-size: 16px;
        line-height: 1.55;
    }

    /* Keep the image in the normal flow (was absolute) so the form can
       sit directly underneath it. Offsets are unchanged. */
    section.header-section.product-hero + .container.products-image-container {
        position: relative;
    }

    /* The 9rem top margin only existed to clear the absolutely positioned
       image; the image is now in flow on this page. */
    body.page-id-46752 section.products-types {
        margin-top: 0;
    }

}

@media (max-width: 576px) {
    :root {
        --mgs-product-hero-overlap: 80px; /* existing theme value (style.css) */
        --mgs-product-hero-gap: 1.5rem;
    }

    section.header-section.product-hero .product-hero-intro {
        font-size: 15px;
    }
}

/* ==========================================================================
   Subscribe panel (Mailchimp form, below the products image)

   Spacing scale: 64px above / 16px below on desktop (the next section
   adds its own 48px top padding, so the gap to the content is ~64px),
   48px / 8px on tablet, 40px / 0 on mobile.
   Selectors are scoped to .product-hero-subscribe, so the global Mailchimp
   styles used by other forms on the site are not affected.
   ========================================================================== */
.product-hero-subscribe {
    position: relative;
    z-index: 3;
    padding: 4rem 0 1rem;
}

.product-subscribe-card {
    background: #FFFAEC;                 /* banner base colour */
    border: 1px solid #FFD8BC;           /* banner wave stroke colour */
    border-left: 4px solid #fd5902;      /* brand orange accent */
    border-radius: 12px;
    padding: 40px 48px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.product-subscribe-title {
    font-family: 'gotham', 'Gotham', sans-serif;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 700;
    color: #000;
    margin: 0 0 8px;
}

.product-subscribe-text {
    font-family: 'gotham', 'Gotham', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color, #333);
    margin: 0;
}

.product-subscribe-note {
    font-family: 'gotham', 'Gotham', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #6c757d;
    margin: 12px 0 0;
}

.product-subscribe-note a {
    color: #fd5902;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-subscribe-note a:hover,
.product-subscribe-note a:focus {
    color: #000;
}

/* Form row: email field + button, equal height, side by side */
.product-hero-subscribe .mc4wp-form {
    margin: 0;
}

/* The email field and button are laid out in one row no matter how the
   Mailchimp form markup wraps them: any wrapper (div/p/span/label) around
   either control is flattened with display:contents, so both controls
   become items of the same flex row. */
.product-hero-subscribe .mc4wp-form-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
}

.product-hero-subscribe .mc4wp-form-fields :is(div, p, span, label):has(#mc4wp_email, #mc4wp_submitaction) {
    display: contents !important;   /* also beats Bootstrap .d-flex/.row utilities */
}

/* Anything else inside the form (e.g. a checkbox or a note) takes its own line */
.product-hero-subscribe .mc4wp-form-fields > :not(#mc4wp_email):not(#mc4wp_submitaction):not(:has(#mc4wp_email, #mc4wp_submitaction)),
.product-hero-subscribe .mc4wp-form-fields :has(#mc4wp_email, #mc4wp_submitaction) > :not(#mc4wp_email):not(#mc4wp_submitaction):not(:has(#mc4wp_email, #mc4wp_submitaction)) {
    flex: 0 0 100%;
}

.product-hero-subscribe .mc4wp-form-fields br {
    display: none;
}

/* Older browsers without :has() support: keep a tidy stacked layout */
@supports not selector(:has(a)) {
    .product-hero-subscribe .mc4wp-form #mc4wp_submitaction {
        margin-top: 10px !important;
    }
}

.product-hero-subscribe .mc4wp-form input#mc4wp_email {
    float: none;
    flex: 1 1 240px;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 52px;
    margin: 0;
    padding: 0 16px;
    font-family: 'gotham', 'Gotham', sans-serif;
    font-size: 16px;
    color: #222;
    background: #fff;
    border: 1px solid #d6cbbd;
    border-radius: 6px;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.product-hero-subscribe .mc4wp-form input#mc4wp_email::placeholder {
    color: #8a8a8a;
}

.product-hero-subscribe .mc4wp-form input#mc4wp_email:focus {
    outline: none;
    border-color: #fd5902;
    box-shadow: 0 0 0 3px rgba(253, 89, 2, 0.18);
}

.product-hero-subscribe .mc4wp-form #mc4wp_submitaction {
    float: none;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 52px;
    margin: 0;
    padding: 0 28px;
    font-family: gotham, 'Gotham', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    color: #fff;
    background-color: #000;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .2s ease;
}

.product-hero-subscribe .mc4wp-form #mc4wp_submitaction:hover,
.product-hero-subscribe .mc4wp-form #mc4wp_submitaction:focus-visible {
    background-color: #fd5902;
    color: #fff;
}

.product-hero-subscribe .mc4wp-form #mc4wp_submitaction:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Success / error message */
.product-hero-subscribe .mc4wp-response p {
    width: 100%;
    margin: 12px 0 0;
    padding: 8px 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #000;
    background: #fd5902;
    border-radius: 6px;
}

/* Tablet (stacked, centred) */
@media (max-width: 991.98px) {
    .product-hero-subscribe {
        padding: 3rem 0 0.5rem;
    }

    .product-subscribe-card {
        padding: 32px;
        text-align: center;
        border-left-width: 1px;
        border-top: 4px solid #fd5902;
    }

    .product-subscribe-copy {
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .product-subscribe-form {
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .product-hero-subscribe .mc4wp-response p {
        text-align: center;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .product-hero-subscribe {
        padding: 2.5rem 0 0;
    }

    .product-subscribe-title {
        font-size: 24px;
    }

    .product-subscribe-text {
        font-size: 15px;
    }
}

@media (max-width: 575.98px) {
    .product-subscribe-card {
        padding: 28px 20px;
    }

    .product-hero-subscribe .mc4wp-form #mc4wp_submitaction {
        flex: 1 0 100%;
        width: 100%;
    }
}
