@media (max-width: 1100px) {
    .wpd-hero {
        grid-template-columns: 1fr;
    }
    .wpd-purchase {
        position: static;
    }
    .wpd-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    /* The plugin purchase bar is the only mobile footer on product pages. */
    body.single-product footer,
    body.single-product #footer,
    body.single-product #site-footer,
    body.single-product .site-footer,
    body.single-product .footer-fixed,
    body.single-product .fixed-footer,
    body.single-product .cz_fixed_footer,
    body.single-product .mobile-bottom-bar,
    body.single-product .mobile-bottom-nav,
    body.single-product .bottom-navigation {
        display: none !important;
    }

    .wpd-title { font-size: 26px; }
    .wpd-gallery-card, .wpd-purchase, .wpd-features, .wpd-description, .wpd-tabs, .wpd-reviews-section { padding: 18px; }
    .wpd-trust-list, .wpd-features, .wpd-trust-bar { grid-template-columns: 1fr; }
    .wpd-trust-bar .wpd-trust-item { justify-content: flex-start; }
    
    /* Hide purchase card price, cart buttons, and color selector on mobile (they are pinned) */
    .wpd-purchase__price, .wpd-purchase__note, .wpd-purchase .wpd-qty-wrapper, .wpd-purchase .wpd-btn-add-cart, .wpd-purchase .wpd-variation-selectors { 
        display: none !important; 
    }

    /* Mobile Sticky Cart Bar */
    .wpd-mobile-sticky-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2147483000;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 20px rgba(0,0,0,.15);
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin: 0;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        contain: layout paint;
    }

    .wpd-mobile-top-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
    }

    .wpd-mobile-price-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
        text-align: right;
        flex: 1;
    }

    .wpd-mobile-price {
        color: var(--wpd-primary);
        font-weight: 800;
        font-size: 16px;
    }

    .wpd-mobile-total-row {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        justify-content: flex-start !important;
        animation: none !important;
    }

    .wpd-mobile-total-row .wpd-total-label {
        font-size: 11px;
    }

    .wpd-mobile-total-row .wpd-total-price {
        font-size: 15px;
    }

    .wpd-mobile-variations {
        flex: 1.3;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    .wpd-mobile-variation-select {
        height: 40px;
        padding: 0 10px;
        font-size: 13px;
        width: 50%;
        min-width: 95px;
        border-radius: 8px;
        border: 1px solid #d1d5db;
        background: #f9fafb;
    }

    .wpd-mobile-row {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        flex-wrap: wrap;
    }
    .wpd-mobile-row .added_to_cart {
        width: 100%!important;
        margin-top: 8px!important;
        order: 3;
    }

    .wpd-mobile-sticky-bar .wpd-qty-wrapper {
        margin: 0;
        height: 46px;
        min-width: 140px;
        flex-shrink: 0;
        background: #f3f4f6;
    }

    .wpd-mobile-sticky-bar .wpd-qty-btn {
        width: 44px;
        height: 46px;
    }

    .wpd-mobile-sticky-bar .wpd-qty-input {
        width: auto;
        min-width: 40px;
        height: 46px;
        flex: 1;
        padding: 0 4px;
    }

    .wpd-mobile-sticky-bar .wpd-btn-add-cart {
        flex: 1;
        margin: 0;
        min-height: 46px;
        border-radius: 10px;
        font-size: 14px;
    }

    /* Offset body so content doesn't hide behind sticky bar */
    .wpd-layout__inner {
        padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px));
    }

    .wpd-form-grid {
        grid-template-columns: 1fr;
    }

    /* Toast must float ABOVE the mobile sticky purchase bar */
    .wpd-toast-notification {
        bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        transform: translateY(30px) !important;
        opacity: 0 !important;
        z-index: 2147483647 !important;
        transition: transform .45s cubic-bezier(.175,.885,.32,1.275), opacity .35s ease !important;
        pointer-events: none !important;
    }

    .wpd-toast-notification.is-active {
        bottom: calc(180px + env(safe-area-inset-bottom, 0px)) !important;
        transform: translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .wpd-toast-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }

    .wpd-toast-message {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 13px;
        line-height: 1.5;
        order: 2;
    }

    .wpd-toast-product {
        display: inline;
        word-break: break-word;
    }

    .wpd-toast-icon {
        order: 1;
        flex-shrink: 0;
    }

    .wpd-toast-btn {
        order: 3;
        flex-shrink: 0;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Desktop: hide mobile sticky bar */
@media (min-width: 768px) {
    .wpd-mobile-sticky-bar {
        display: none !important;
    }
}
