/* ============================================
   AG Product Page — Enhanced Layout
   ============================================ */

/* ── Summary area ── */

.ag-pdp-bullets {
    list-style: none;
    padding: 0;
    margin: 8px 0 14px;
}

.ag-pdp-bullets li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 5px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #333;
}

.ag-pdp-bullets li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2f6120;
    font-weight: 700;
}

/* Delivery estimate */
.ag-pdp-delivery-estimate {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #edf7e8;
    border: 1px solid #c5e1b5;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #2f6120;
}

.ag-pdp-delivery-estimate svg {
    flex-shrink: 0;
}

/* Info strip */
.ag-pdp-info-strip {
    background: #f8f8f6;
    border: 1px solid #e5e5e0;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 10px 0;
}

.ag-pdp-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12.5px;
    color: #555;
    line-height: 1.4;
}

.ag-pdp-info-item:last-child { margin-bottom: 0; }
.ag-pdp-info-item svg { flex-shrink: 0; color: #2f6120; }

/* Action buttons */
.ag-pdp-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}

.ag-pdp-action-btn {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 150ms ease;
    border: 1.5px solid;
    display: block;
}

.ag-pdp-action-btn--sample {
    background: #2f6120;
    color: #fff;
    border-color: #2f6120;
}
.ag-pdp-action-btn--sample:hover {
    background: #1a3a10;
    border-color: #1a3a10;
    color: #fff;
}

.ag-pdp-action-btn--specs {
    background: #fff;
    color: #2f6120;
    border-color: #2f6120;
}
.ag-pdp-action-btn--specs:hover {
    background: #2f6120;
    color: #fff;
}

/* Payment badges */
.ag-pdp-payment-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0 10px;
}

.ag-pdp-payment-badge {
    font-size: 10.5px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 4px;
    background: #f5f5f3;
    color: #555;
    border: 1px solid #e0e0dc;
}

/* Key features icons in summary */
.ag-pdp-key-features {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid #e5e5e0;
}

.ag-pdp-key-features__heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin: 0 0 10px;
}

.ag-pdp-key-features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.ag-pdp-key-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 10px 6px;
    background: #f8f8f6;
    border: 1px solid #eee;
    border-radius: 8px;
}

.ag-pdp-key-feature img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.ag-pdp-key-feature__icon {
    font-size: 18px;
    color: #2f6120;
    font-weight: 700;
}

.ag-pdp-key-feature__label {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

/* ============================================
   FULL-WIDTH SECTIONS
   ============================================ */

/* Shared */
.ag-pdp-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #0d1a0b;
    margin: 0 0 24px;
}

/* Helper: full-bleed */
.ag-pdp-tabs-section,
.ag-pdp-faq-section,
.ag-pdp-crosssells,
.ag-pdp-accessories,
.ag-pdp-related {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-sizing: border-box;
}

.ag-pdp-tabs-section__inner,
.ag-pdp-faq-section__inner,
.ag-pdp-crosssells__inner,
.ag-pdp-accessories__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Tabs ── */
.ag-pdp-tabs-section {
    background: #fff;
    padding: 48px 0;
    border-top: 1px solid #e5e5e0;
}

.ag-pdp-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e5e0;
    margin-bottom: 28px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ag-pdp-tab-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms ease;
}

.ag-pdp-tab-btn:hover {
    color: #333;
}

.ag-pdp-tab-btn.is-active {
    color: #2f6120;
    border-bottom-color: #2f6120;
}

.ag-pdp-tab-panel {
    font-size: 14.5px;
    line-height: 1.7;
    color: #444;
}

/* Mobile accordion header: hidden on desktop, revealed in the
   mobile media query below. JS injects this element on init. */
.ag-pdp-tab-panel__header {
    display: none;
}

.ag-pdp-tab-panel h2,
.ag-pdp-tab-panel h3 {
    color: #0d1a0b;
    margin: 24px 0 12px;
}

.ag-pdp-tab-panel h2:first-child,
.ag-pdp-tab-panel h3:first-child {
    margin-top: 0;
}

.ag-pdp-tab-panel p {
    margin: 0 0 14px;
}

/* Specs table inside tab */
.ag-pdp-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.ag-pdp-specs-table tr {
    border-bottom: 1px solid #eee;
}

.ag-pdp-specs-table tr:last-child {
    border-bottom: none;
}

.ag-pdp-specs-table th,
.ag-pdp-specs-table td {
    padding: 10px 14px;
    font-size: 13.5px;
    text-align: left;
}

.ag-pdp-specs-table th {
    font-weight: 600;
    color: #0d1a0b;
    width: 40%;
    background: transparent;
}

.ag-pdp-specs-table td {
    color: #555;
}

/* ── FAQ Section ── */
.ag-pdp-faq-section {
    background: #f8f8f6;
    padding: 48px 0;
    border-top: 1px solid #e5e5e0;
}

.ag-pdp-faqs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 800px;
}

.ag-pdp-faq {
    border: 1px solid #e0e0dc;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.ag-pdp-faq__q {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    list-style: none;
    color: #0d1a0b;
    line-height: 1.4;
}

.ag-pdp-faq__q::-webkit-details-marker { display: none; }

.ag-pdp-faq__icon {
    font-size: 18px;
    font-weight: 300;
    color: #999;
    transition: transform 200ms ease;
    flex-shrink: 0;
}

.ag-pdp-faq[open] .ag-pdp-faq__icon {
    transform: rotate(45deg);
}

.ag-pdp-faq__a {
    padding: 0 18px 14px;
    font-size: 13.5px;
    line-height: 1.65;
    color: #555;
}

/* ── Cross-sells ── */
.ag-pdp-crosssells {
    background: #fff;
    padding: 48px 0;
    border-top: 1px solid #e5e5e0;
}

.ag-pdp-crosssells__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ag-pdp-crosssell-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e4d8;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.ag-pdp-crosssell-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.ag-pdp-crosssell-card__img {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f3;
}

.ag-pdp-crosssell-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ag-pdp-crosssell-card__body {
    padding: 12px 14px;
    text-align: center;
}

.ag-pdp-crosssell-card__body h4 {
    font-size: 13px;
    font-weight: 600;
    color: #0d1a0b;
    margin: 0 0 4px;
    line-height: 1.3;
}

.ag-pdp-crosssell-card__price {
    font-size: 14px;
    font-weight: 700;
    color: #2f6120;
}

/* ── Related products (grass247) ── */
.ag-pdp-related {
    background: #fff;
    padding: 48px 0;
    border-top: 1px solid #e5e5e0;
}

.ag-pdp-related__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.ag-pdp-related__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ag-pdp-related__grid > li {
    width: auto !important;
    max-width: none !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 768px) {
    .ag-pdp-related__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ag-pdp-related__grid {
        grid-template-columns: 1fr;
    }
}

/* ── Accessories ── */
.ag-pdp-accessories {
    background: #f8f8f6;
    padding: 48px 0;
    border-top: 1px solid #e5e5e0;
}

.ag-pdp-accessories__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 600px) {
    .ag-pdp-accessories__grid {
        grid-template-columns: 1fr;
    }
}

.ag-pdp-accessory-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e4d8;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.ag-pdp-accessory-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.ag-pdp-accessory-card__img {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f3;
}

.ag-pdp-accessory-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ag-pdp-accessory-card__body {
    padding: 10px 12px 14px;
    text-align: center;
}

.ag-pdp-accessory-card__body h4 {
    font-size: 12.5px;
    font-weight: 600;
    color: #0d1a0b;
    margin: 0 0 4px;
    line-height: 1.3;
}

.ag-pdp-accessory-card__price {
    font-size: 14px;
    font-weight: 700;
    color: #2f6120;
}

/* ============================================
   MOBILE (≤768px)
   ============================================
   Mobile gutter scale:
     ≤768px outer gutter: 14px
     ≤480px outer gutter: 12px
   Vertical rhythm in summary: 12px between widgets,
   18px between widget groups (above key features).
   ============================================ */

@media (max-width: 768px) {

    /* Prevent horizontal overflow on product pages. Two sources cause this
       on the Be Theme parent: full-bleed sections using width: 100vw, and
       authored content (theme builder card rows) wider than the viewport.
       Clip both at html and body — iOS Safari ignores body alone. */
    html, body.single-product {
        overflow-x: hidden;
        max-width: 100%;
    }

    body.single-product .single-product,
    body.single-product div.product,
    body.single-product .summary,
    body.single-product .entry-content {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Force all theme wrappers to use full viewport width on product pages */
    .single-product .entry-content,
    .single-product .section_wrapper,
    .single-product .the_content_wrapper,
    .single-product .content_wrapper .section_wrapper,
    .single-product .content_wrapper,
    .single-product .container,
    .single-product .site-content,
    .single-product .woocommerce {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Product summary / gallery area */
    .single-product div.product {
        padding: 8px 14px 16px !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .single-product div.product .woocommerce-product-gallery,
    .single-product div.product .summary {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Tighter gallery margin so the title sits closer to the image */
    .single-product div.product .woocommerce-product-gallery {
        margin-bottom: 14px !important;
    }

    /* Title / price hierarchy */
    .single-product div.product .product_title {
        font-size: 22px !important;
        line-height: 1.25 !important;
        margin: 0 0 8px !important;
    }

    .single-product div.product .price,
    .single-product div.product p.price {
        font-size: 20px !important;
        margin: 0 0 10px !important;
    }

    /* Vertical rhythm between summary widgets */
    .ag-pdp-bullets {
        margin: 6px 0 12px;
    }

    .ag-pdp-bullets li {
        font-size: 14px;
        padding-left: 22px;
        margin-bottom: 6px;
    }

    .ag-pdp-delivery-estimate,
    .ag-pdp-info-strip {
        margin: 12px 0;
    }

    .ag-pdp-payment-badges {
        margin: 4px 0 12px;
    }

    /* Action buttons — full width, tap-target height */
    .ag-pdp-action-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 12px 0;
    }

    .ag-pdp-action-btn {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Key features — give them a clear break */
    .ag-pdp-key-features {
        margin-top: 18px;
        padding-top: 16px;
    }

    .ag-pdp-key-features__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .ag-pdp-key-feature {
        padding: 10px 4px;
    }

    .ag-pdp-key-feature__label {
        font-size: 10.5px;
    }

    /* Full-bleed sections — tighten inner padding on mobile */
    .ag-pdp-tabs-section__inner,
    .ag-pdp-faq-section__inner,
    .ag-pdp-crosssells__inner,
    .ag-pdp-accessories__inner,
    .ag-pdp-related__inner {
        padding: 0 14px !important;
    }

    .ag-pdp-tabs-section,
    .ag-pdp-faq-section,
    .ag-pdp-crosssells,
    .ag-pdp-accessories,
    .ag-pdp-related {
        padding: 28px 0 !important;
    }

    .ag-pdp-section-title {
        font-size: 19px;
        margin-bottom: 14px;
        line-height: 1.25;
    }

    /* ── Tabs → accordion on mobile ──
       Hide the tab nav, show every panel as a collapsible card.
       The summary acts as the header; the JS-driven .is-active state
       isn't relevant when each panel is independently toggled. */
    .ag-pdp-tabs-nav {
        display: none !important;
    }

    .ag-pdp-tab-panel {
        display: block !important;
        border: 1px solid #e0e0dc;
        border-radius: 8px;
        background: #fff;
        margin-bottom: 8px;
        overflow: hidden;
    }

    .ag-pdp-tab-panel[data-mobile-collapsed="true"] .ag-pdp-tab-panel__body {
        display: none;
    }

    .ag-pdp-tab-panel__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        font-size: 14px;
        font-weight: 600;
        color: #0d1a0b;
        cursor: pointer;
        background: #fff;
        list-style: none;
        line-height: 1.3;
    }

    .ag-pdp-tab-panel__header::-webkit-details-marker { display: none; }

    .ag-pdp-tab-panel__icon {
        font-size: 20px;
        font-weight: 300;
        color: #999;
        transition: transform 200ms ease;
        flex-shrink: 0;
        line-height: 1;
    }

    .ag-pdp-tab-panel[data-mobile-collapsed="false"] .ag-pdp-tab-panel__icon {
        transform: rotate(45deg);
    }

    .ag-pdp-tab-panel__body {
        padding: 0 16px 14px;
        font-size: 14px;
        line-height: 1.6;
    }

    .ag-pdp-tab-panel__body h2,
    .ag-pdp-tab-panel__body h3 {
        font-size: 16px;
        margin: 14px 0 8px;
    }

    /* Specs table — stack rows on mobile so labels don't squash values */
    .ag-pdp-specs-table th,
    .ag-pdp-specs-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .ag-pdp-specs-table th { width: 45%; }

    /* FAQ */
    .ag-pdp-faq__q {
        padding: 13px 14px;
        font-size: 13.5px;
    }

    .ag-pdp-faq__a {
        padding: 0 14px 13px;
        font-size: 13px;
    }

    /* Cross-sells / accessories grids */
    .ag-pdp-crosssells__grid,
    .ag-pdp-accessories__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ag-pdp-crosssell-card__body,
    .ag-pdp-accessory-card__body {
        padding: 10px 8px 12px;
    }

    .ag-pdp-crosssell-card__body h4,
    .ag-pdp-accessory-card__body h4 {
        font-size: 12.5px;
    }
}

@media (max-width: 480px) {
    .single-product div.product {
        padding: 8px 12px 14px !important;
    }

    .ag-pdp-tabs-section__inner,
    .ag-pdp-faq-section__inner,
    .ag-pdp-crosssells__inner,
    .ag-pdp-accessories__inner,
    .ag-pdp-related__inner {
        padding: 0 12px !important;
    }

    .single-product div.product .product_title {
        font-size: 20px !important;
    }

    .ag-pdp-key-features__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ag-pdp-section-title {
        font-size: 18px;
    }
}

/* ============================================
   MOBILE STICKY BUY BAR
   ============================================
   Rendered only on mobile (≤768px). Appears once the user scrolls
   past the main add-to-cart area. Tapping "Add to Cart" smooth-scrolls
   the user back up to the real form so all variation/calculator state
   is preserved.
   ============================================ */

.ag-pdp-sticky-buy {
    display: none;
}

@media (max-width: 768px) {
    .ag-pdp-sticky-buy {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9998;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid #e5e5e0;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
        transform: translateY(110%);
        transition: transform 220ms ease;
        box-sizing: border-box;
    }

    .ag-pdp-sticky-buy.is-visible {
        transform: translateY(0);
    }

    .ag-pdp-sticky-buy__info {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-width: 0;
        line-height: 1.2;
    }

    .ag-pdp-sticky-buy__title {
        font-size: 12.5px;
        font-weight: 600;
        color: #0d1a0b;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ag-pdp-sticky-buy__price {
        font-size: 15px;
        font-weight: 800;
        color: #1a1a1a;
        margin-top: 2px;
    }

    .ag-pdp-sticky-buy__price-suffix {
        font-size: 11px;
        font-weight: 500;
        color: #888;
        margin-left: 4px;
    }

    .ag-pdp-sticky-buy__btn {
        flex: 0 0 auto;
        padding: 12px 20px;
        min-height: 46px;
        background: #2f6120;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        transition: background 150ms ease;
    }

    .ag-pdp-sticky-buy__btn:hover,
    .ag-pdp-sticky-buy__btn:active {
        background: #1a3a10;
        color: #fff;
    }

    /* Reserve scroll space so the sticky bar doesn't cover the footer */
    body.ag-has-sticky-buy {
        padding-bottom: 70px;
    }
}

/* Brief highlight applied when the sticky buy CTA scrolls the user
   to the real form. */
.ag-pdp-flash {
    animation: ag-pdp-flash 1.2s ease;
}

@keyframes ag-pdp-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(45, 122, 58, 0); }
    20% { box-shadow: 0 0 0 4px rgba(45, 122, 58, 0.25); }
}
