/*
Theme Name: Astra Child
Template: astra
Description: Astra Child Theme
Version: 5.0
*/

/* ==========================================================================
   1. Sale Badges
   ========================================================================== */
.woocommerce ul.products li.product .onsale,
.woocommerce ul.products li.product .ast-onsale-card,
.woocommerce div.product .onsale,
.woocommerce div.product .ast-onsale-card,
.woocommerce span.onsale {
    background-color: var(--ast-global-color-0) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    padding: 4px 14px !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    z-index: 9 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    margin-top: 10px !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   2. Homepage Hero Slider - Swiper
   ========================================================================== */
.full-width-hero {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 0 !important;
    padding-bottom: 30px !important;
    overflow: hidden;
    display: block;
}

.hero-slider-wrapper {
    position: relative;
    width: 100%;
}

.hero-swiper {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.hero-swiper .swiper-wrapper {
    align-items: stretch;
}

.hero-slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.hero-swiper .swiper-pagination {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: auto !important;
    max-width: 90%;
    min-width: unset;
}

.hero-swiper .swiper-pagination-bullet {
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
    margin: 0 4px !important;
    display: inline-block;
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.hero-swiper .swiper-pagination-bullet:hover {
    transform: scale(1.3);
    background: rgba(255, 255, 255, 0.9);
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.hero-swiper .swiper-pagination-bullet-active {
    background: #ffffff;
    border-color: #ffffff;
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
}

.hero-swiper .swiper-pagination-bullet-active:hover {
    transform: scale(1.3);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.8);
}

.hero-swiper .swiper-pagination-hidden {
    display: none !important;
}

/* ==========================================================================
   3. Layout Isolation & Fixes
   ========================================================================== */
.site-header,
.ast-desktop .ast-main-header-wrap,
.ast-mobile-header-wrap,
#masthead {
    position: relative !important;
    z-index: 999 !important;
}

#primary.content-area {
    margin-top: 0 !important;
    padding-top: 20px !important;
    display: block !important;
    clear: both !important;
}

.site-content .ast-container,
.site-content {
    display: flow-root !important;
}

/* ==========================================================================
   4. Homepage Desktop White Space Cleanup
   ========================================================================== */
@media (min-width: 922px) {
    .home .site-content,
    .home .ast-container,
    .home #content .ast-container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    .home .site-header,
    .home #masthead,
    .home .main-header-bar {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    .home .entry-content,
    .home .wp-block-cover,
    .home .wp-block-gallery,
    .home .custom-swipe-banner {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    .home .entry-content > .wp-block-shortcode:first-child,
    .home .entry-content > .woocommerce:first-child {
        margin-top: 35px !important;
    }
    .home #primary {
        margin-top: 0 !important;
    }
}

/* ==========================================================================
   5. Single Product - Hide Redundant Elements
   ========================================================================== */
.single-product .summary.entry-summary .woocommerce-breadcrumb,
.single-product .summary.entry-summary .single-product-category {
    display: none !important;
}

/* ==========================================================================
   6. Checkout Page Responsive Fixes
   ========================================================================== */
.woocommerce-checkout .custom-premium-footer,
.woocommerce-checkout .ast-small-footer,
.woocommerce-checkout #colophon,
.woocommerce-checkout footer.site-footer {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    visibility: hidden !important;
}

.woocommerce-checkout #content,
.woocommerce-checkout .site-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    clear: both !important;
}

.woocommerce-checkout .woocommerce-checkout-payment .wc-block-components-checkout-place-order-button,
.woocommerce-checkout button[type="submit"],
.woocommerce-checkout #place_order,
.woocommerce-checkout .wc-block-components-button,
.wc-block-components-checkout-place-order-button button,
.wc-block-components-checkout-place-order-button {
    font-size: 18px !important;
    padding: 18px 32px !important;
    min-height: 56px !important;
    line-height: 1.2 !important;
    border-radius: 8px !important;
}

.wc-block-cart .wc-block-components-button,
.wc-block-cart .wc-block-cart__submit-button,
.wc-block-components-button.wc-block-cart__submit-button,
.wc-block-components-sidebar .wc-block-components-button {
    border-radius: 8px !important;
}

/* ==========================================================================
   7. Cart Page Mobile Fixes
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .woocommerce-checkout #page,
    .woocommerce-checkout .site-content,
    .woocommerce-checkout .ast-container,
    .woocommerce-checkout .woocommerce,
    .woocommerce-cart #page,
    .woocommerce-cart .site-content,
    .woocommerce-cart .ast-container,
    .woocommerce-cart .woocommerce {
        max-width: 960px !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
    }
    .woocommerce-checkout .entry-title {
        max-width: 960px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
    }
}

@media (min-width: 1025px) {
    .is-checkout #page,
    .is-checkout .site-content,
    .is-checkout .ast-container {
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }
    .woocommerce-checkout .entry-title {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   8. Product Title Truncation (2 lines)
   ========================================================================== */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product .ast-loop-product__title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 3.2em !important;
    min-height: 3.2em !important;
    line-height: 1.6 !important;
    margin-bottom: 5px !important;
}

/* ==========================================================================
   9. Footer Styles
   ========================================================================== */
.footer-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    box-sizing: border-box;
}

.footer-col ul li a:hover,
.footer-col a:hover {
    color: #0071e3 !important;
    text-decoration: underline !important;
}

.site-footer > .ast-footer-copyright,
.site-footer > .site-below-footer-wrap,
.ast-builder-footer-element {
    display: none !important;
}

/* ==========================================================================
   10. Custom Desktop Breadcrumb
   ========================================================================== */
.custom-desktop-breadcrumb {
    width: 100%;
    clear: both;
    display: block;
    padding-left: 0px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

/* ==========================================================================
   11. Single Image (No Slider) Full Width Fix
   ========================================================================== */
.hero-single {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.hero-single img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* ==========================================================================
   12. Price Display Optimization
   ========================================================================== */
.woocommerce div.product p.price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0;
}
.woocommerce div.product p.price del {
    color: #000;
    font-size: 0.75em;
    text-decoration: line-through;
}
.woocommerce div.product p.price del .woocommerce-Price-amount { color: #000; }
.woocommerce div.product p.price ins {
    color: #d00;
    font-weight: 700;
    font-size: 1.25em;
    text-decoration: none;
}
.woocommerce div.product p.price ins .woocommerce-Price-amount { color: #d00; font-weight: 700; }

.woocommerce ul.products li.product .price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
}
.woocommerce ul.products li.product .price del {
    color: #000;
    font-size: 0.9em;
    text-decoration: line-through;
}
.woocommerce ul.products li.product .price del .woocommerce-Price-amount { color: #000; }
.woocommerce ul.products li.product .price ins {
    color: #CF1322;
    font-weight: 700;
    font-size: 1.1em;
    text-decoration: none;
}
.woocommerce ul.products li.product .price ins .woocommerce-Price-amount { color: #CF1322; font-weight: 700; }

/* ==========================================================================
   13. Variable Product Price Toggle
   ========================================================================== */
.woocommerce-variation-price {
    display: none !important;
}

/* ==========================================================================
   14. Hide Product Category Labels on Cards
   ========================================================================== */
.ast-woo-product-category {
    display: none !important;
}

/* ==========================================================================
   15. Fix Tab Label Flickering
   ========================================================================== */
.woocommerce-js .woocommerce-tabs .panel { display: none; }
.woocommerce-js .woocommerce-tabs #tab-description,
.woocommerce-js .woocommerce-tabs .panel.active { display: block; }

/* ==========================================================================
   16. Product List Images - Uniform Square Container
   ========================================================================== */
.woocommerce ul.products li.product a img {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain;
    background-color: #ffffff;
}

.woocommerce-product-gallery__wrapper img,
.woocommerce-product-gallery__image img {
    max-height: 500px !important;
    width: auto !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}
.woocommerce-product-gallery {
    max-height: 600px !important;
}

/* ==========================================================================
   17. Mobile Variation Swatches Optimization
   ========================================================================== */
@media (max-width: 768px) {
    [data-wvstooltip]::before,
    [data-wvstooltip]::after {
        display: none !important;
        content: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    .variable-item-span.variable-item-span-button {
        white-space: normal !important;
        word-wrap: break-word !important;
        height: auto !important;
        min-height: auto !important;
        padding: 2px 5px !important;
        line-height: 1.2 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    li.variable-item {
        height: auto !important;
        margin-bottom: 3px !important;
    }
}

/* ==========================================================================
   18. Combined: Mobile Global Styles (max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden !important;
    }
    a, button, [role="button"], input, textarea, select {
        outline: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .full-width-hero {
        width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        left: 0 !important;
        right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: hidden !important;
    }
    .hero-swiper .swiper-pagination {
        padding: 6px 12px;
        bottom: 12px;
        gap: 2px;
        max-width: 85%;
        border-radius: 25px;
    }
    .hero-swiper .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 3px !important;
    }
    .hero-slide img {
        aspect-ratio: 4 / 3;
    }

    .hero-single {
        aspect-ratio: 4 / 3;
        width: 100% !important;
        left: 0 !important;
        right: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .woocommerce ul.products li.product {
        position: relative !important;
    }
    .woocommerce ul.products li.product .onsale,
    .woocommerce ul.products li.product .ast-onsale-card,
    .woocommerce ul.products li.product span.onsale,
    .ast-onsale-card {
        position: absolute !important;
        top: 5px !important;
        left: 5px !important;
        right: auto !important;
        z-index: 9 !important;
        margin: 0 !important;
        padding: 2px 6px !important;
        font-size: 10px !important;
        border-radius: 4px !important;
        width: auto !important;
        min-width: unset !important;
    }

    .woocommerce ul.products li.product .button,
    .woocommerce ul.products li.product .ast-loop-add-to-cart-btn,
    .woocommerce ul.products li.product .ast-onsale-card-button,
    .wc-block-grid__product .wp-block-button__link,
    .wc-block-grid__product .wc-block-components-product-button__button {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        box-sizing: border-box !important;
        font-size: 12px !important;
        padding: 8px 6px !important;
        line-height: 1.4 !important;
        border-radius: 8px !important;
    }

    .woocommerce div.product p.price {
        gap: 8px;
        margin: 10px 0;
    }
    .woocommerce div.product p.price del { font-size: 0.7em; }
    .woocommerce div.product p.price ins { font-size: 1.1em; }
    .woocommerce ul.products li.product .price {
        font-size: 12px;
        gap: 6px;
    }

    .woocommerce-checkout html,
    .woocommerce-checkout body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        position: relative !important;
    }
    .woocommerce-checkout .ast-mobile-header-wrap,
    .woocommerce-checkout #masthead,
    .woocommerce-checkout header.site-header,
    .woocommerce-checkout .ast-main-header-wrap {
        position: relative !important;
        top: 0 !important;
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 767px) {
    .woocommerce-checkout .admin-bar #wpadminbar { display: none !important; }
    .woocommerce-checkout html,
    .woocommerce-checkout * html body { margin-top: 0 !important; }
    .woocommerce-checkout #content,
    .woocommerce-checkout .site-content,
    .woocommerce-checkout .ast-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        box-sizing: border-box !important;
        left: 0 !important;
    }
    .woocommerce-checkout .woocommerce {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .woocommerce-checkout .woocommerce-checkout-review-order {
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    .woocommerce-checkout .woocommerce-checkout-review-order table {
        width: 100% !important;
    }
    .woocommerce-checkout .woocommerce-checkout-review-order table td,
    .woocommerce-checkout .woocommerce-checkout-review-order table th {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .woocommerce-checkout .woocommerce-checkout-payment {
        padding: 12px !important;
    }
    .woocommerce-checkout .woocommerce-checkout-payment .wc-block-components-checkout-place-order-button,
    .woocommerce-checkout .woocommerce-checkout-payment button[type="submit"],
    .woocommerce-checkout .woocommerce-checkout-payment #place_order,
    .woocommerce-checkout .woocommerce-checkout-payment .wc-block-components-button,
    .woocommerce-checkout .woocommerce-checkout-review-order .wc-block-components-checkout-place-order-button,
    .woocommerce-checkout .woocommerce-checkout-review-order button[type="submit"],
    .woocommerce-checkout .woocommerce-checkout-review-order #place_order,
    .woocommerce-checkout .woocommerce-checkout-review-order .wc-block-components-button {
        margin-top: 8px !important;
        margin-bottom: 4px !important;
        margin-left: 8px !important;
        margin-right: 8px !important;
        width: calc(100% - 16px) !important;
    }
    .woocommerce-checkout form.woocommerce-checkout { padding: 0 !important; }
    .woocommerce-checkout form input,
    .woocommerce-checkout form select,
    .woocommerce-checkout form textarea,
    .woocommerce-checkout .col2-set {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .woocommerce-cart #page,
    .woocommerce-cart .site-content,
    .woocommerce-cart #primary,
    .woocommerce-cart #content,
    .woocommerce-cart .ast-container,
    .woocommerce-cart .woocommerce {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        box-sizing: border-box !important;
        left: 0 !important;
    }
    .wp-block-woocommerce-cart,
    .wp-block-woocommerce-cart.alignwide,
    .wp-block-woocommerce-cart[data-align="wide"],
    .wc-block-cart__main,
    .wc-block-components-sidebar,
    .wc-block-cart-items {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .wc-block-components-sidebar .wc-block-components-panel,
    .wc-block-components-sidebar .wc-block-cart-order-summary,
    .wc-block-components-sidebar .wc-block-components-totals-item,
    .wc-block-components-sidebar .wc-block-components-totals-coupon,
    .wc-block-components-sidebar .wc-block-components-totals-footer,
    .wc-block-components-sidebar .wc-block-components-totals-wrapper {
        padding-left: 6px !important;
        padding-right: 6px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .woocommerce-cart .wc-block-cart-item__prices {
        flex-wrap: wrap !important;
        white-space: normal !important;
    }

    .wc-block-grid .wc-block-grid__products {
        display: flex !important;
        flex-wrap: wrap !important;
    }
    .wc-block-grid .wc-block-grid__product {
        flex: 1 0 calc(50% - 16px) !important;
        max-width: calc(50% - 16px) !important;
        min-width: calc(50% - 16px) !important;
    }

    .footer-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px 20px;
    }
    .col-half { grid-column: span 1; }
    .col-full { grid-column: span 2; }

    #ast-scroll-top {
        display: none !important;
    }

    .ast-header-break-point .ast-mobile-menu-trigger-minimal .ast-menu-svg path,
    .ast-header-break-point .ast-mobile-menu-trigger-minimal .ast-menu-svg line,
    .ast-header-break-point .ast-mobile-menu-trigger-minimal .ast-menu-svg rect,
    .ast-header-break-point .ast-mobile-menu-trigger-minimal .ast-menu-svg circle,
    .ast-header-break-point .ast-mobile-menu-trigger-minimal .ast-menu-svg ellipse,
    .ast-header-break-point .ast-mobile-menu-trigger-minimal .ast-menu-svg polyline,
    .ast-header-break-point .ast-mobile-menu-trigger-minimal .ast-menu-svg polygon {
        stroke-width: 3 !important;
    }
}

/* ==========================================================================
   19. Cart Drawer Fixes
   ========================================================================== */
.astra-cart-drawer .woocommerce-mini-cart-item a:not(.remove),
.astra-cart-drawer .woocommerce-mini-cart-item .variation {
    line-height: 1.6 !important;
    word-break: break-word !important;
    padding-right: 28px !important;
    box-sizing: border-box !important;
}

.astra-cart-drawer .astra-cart-drawer-close {
    z-index: 9999 !important;
    flex-shrink: 0 !important;
}

.astra-cart-drawer .astra-cart-drawer-header {
    display: flex !important;
    align-items: center !important;
}

.astra-cart-drawer .astra-cart-drawer-content {
    padding-top: 3.5em !important;
}

@media (max-width: 767px) {
    .ast-mobile-header-wrap .custom-logo {
        max-width: 120px !important;
        height: auto !important;
    }
}

.ast-mobile-menu-trigger-minimal svg {
    transform: scale(1.25, 1.5) !important;
}