/* ==========================================================================
   Ascension Sparkle - Responsive
   ========================================================================== */

/* ---------- Tablet / small laptop (max 1024px) ---------- */
@media (max-width: 1024px) {
    .sparkle-container {
        padding: 0 24px;
    }

    .sparkle-hamburger {
        display: inline-flex;
    }

    .sparkle-nav {
        display: none;
    }

    .sparkle-header-row {
        display: flex;
        gap: 14px;
    }

    .sparkle-header-left {
        order: 2;
        flex: 1 1 auto;
        justify-content: flex-start;
    }

    .sparkle-header-center {
        order: 1;
        flex: 0 0 auto;
    }

    .sparkle-header-actions {
        order: 3;
        flex: 0 0 auto;
    }

    ul.products.sparkle-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .related.products ul.products {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .woocommerce-checkout .col2-set {
        grid-template-columns: 1fr;
    }

    .sparkle-hero-media {
        aspect-ratio: 4 / 3;
        min-height: 360px;
    }

    .sparkle-hero-title {
        font-size: 40px;
    }

    .sparkle-single-product-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .sparkle-footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sparkle-instagram-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- Phone landscape (max 768px) ---------- */
@media (max-width: 768px) {
    .sparkle-container {
        padding: 0 18px;
    }

    /* Header */
    .sparkle-hamburger {
        display: inline-flex;
    }

    .sparkle-nav {
        display: none;
    }

    .sparkle-header-row {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .sparkle-logo img {
        max-height: 44px;
    }

    .sparkle-logo-text {
        font-size: 20px;
        letter-spacing: 0.22em;
    }

    .sparkle-header-actions .sparkle-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .sparkle-header-actions .sparkle-icon-count {
        font-size: 9px;
        min-width: 15px;
        height: 15px;
        line-height: 15px;
    }

    /* Hero */
    .sparkle-hero-content-wrap {
        align-items: flex-end;
        padding-bottom: 54px;
    }

    .sparkle-hero-title {
        font-size: 30px;
    }

    .sparkle-hero-subtitle {
        font-size: 14px;
    }

    /* Sections */
    .sparkle-section {
        padding: 52px 0;
    }

    .sparkle-section-title {
        font-size: 20px;
        letter-spacing: 0.16em;
    }

    /* Grids */
    ul.products.sparkle-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .sparkle-collections {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
    }

    .sparkle-collection-card {
        aspect-ratio: 3 / 4;
        scroll-snap-align: center;
    }

    .sparkle-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sparkle-promo {
        padding: 60px 0;
    }

    .sparkle-promo-title {
        font-size: 28px;
    }

    /* Footer */
    .sparkle-footer-grid {
        grid-template-columns: 1fr;
        gap: 34px;
        padding: 48px 0 36px;
    }

    /* Content columns collapse */
    .sparkle-row {
        flex-direction: column;
    }

    .sparkle-sidebar {
        flex: 0 0 auto;
        width: 100%;
    }

    /* Shop */
    .sparkle-shop-content,
    .woocommerce {
        width: 100%;
    }

    .sparkle-shop-toolbar {
        padding: 12px 0 16px;
    }

    /* Single product */
    .sparkle-product-summary .sparkle-product-title {
        font-size: 24px;
    }

    .sparkle-product-tabs ul.tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .sparkle-product-tabs ul.tabs li a {
        white-space: nowrap;
    }

    /* Single product - keep gallery and images fluid */
    .sparkle-single-product .flexslider,
    .sparkle-single-product .woocommerce-product-gallery,
    .sparkle-single-product .woocommerce-product-gallery__wrapper,
    .sparkle-single-product .woocommerce-product-gallery__image,
    .sparkle-single-product .woocommerce-product-gallery__image img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .sparkle-single-product-grid {
        padding: 16px 0 36px;
        gap: 26px;
    }

    /* Checkout - stack fields and keep tables from overflowing */
    .woocommerce-checkout .col2-set {
        display: block;
    }

    .woocommerce-checkout .col2-set .col-1,
    .woocommerce-checkout .col2-set .col-2 {
        float: none;
        width: 100%;
    }

    .woocommerce-checkout .col2-set .col-2 {
        margin-top: 22px;
    }

    .woocommerce-checkout #order_review {
        overflow-x: auto;
    }

    .woocommerce-checkout table.shop_table {
        display: table;
        min-width: 420px;
    }

    .woocommerce-checkout #payment ul.payment_methods li {
        padding: 10px 0;
    }

    .woocommerce-checkout .place-order .button {
        width: 100%;
    }

    .woocommerce-checkout td.product-thumbnail img {
        max-width: 54px;
        height: auto;
    }

    /* Cart page - turn the table into stacked cards */
    .sparkle-cart-form .shop_table thead {
        display: none;
    }

    .sparkle-cart-form .shop_table,
    .sparkle-cart-form .shop_table tbody,
    .sparkle-cart-form .shop_table tr {
        display: block;
        width: 100%;
    }

    .sparkle-cart-form .shop_table td {
        border: none;
        padding: 0;
    }

    .sparkle-cart-form tr.woocommerce-cart-form__cart-item {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 14px;
        padding: 16px 26px 16px 0;
        border-bottom: 1px solid var(--sparkle-border);
    }

    .sparkle-cart-form .product-thumbnail {
        flex: 0 0 68px;
    }

    .sparkle-cart-form .product-thumbnail img {
        width: 68px;
        height: 68px;
    }

    .sparkle-cart-form .product-name {
        flex: 1 1 calc(100% - 82px);
    }

    .sparkle-cart-form .product-price,
    .sparkle-cart-form .product-quantity,
    .sparkle-cart-form .product-subtotal {
        flex: 1 1 30%;
        min-width: 92px;
        font-size: 13px;
        border: 1px solid var(--sparkle-border);
        border-radius: 6px;
        padding: 8px 10px;
        background: var(--sparkle-soft);
    }

    .sparkle-cart-form td.product-price::before,
    .sparkle-cart-form td.product-quantity::before,
    .sparkle-cart-form td.product-subtotal::before {
        content: attr(data-title) ': ';
        font-weight: 700;
    }

    .sparkle-cart-form .product-remove {
        position: absolute;
        top: 14px;
        right: 0;
    }

    .sparkle-cart-form td.actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-top: 18px;
    }

    .sparkle-cart-form .actions .sparkle-btn {
        width: 100%;
    }

    .sparkle-cart-form .sparkle-cart-coupon {
        width: 100%;
    }

    .sparkle-cart-form .sparkle-cart-coupon .input-text {
        flex: 1;
        min-width: 0;
    }

    /* Quick view */
    .sparkle-quickview {
        grid-template-columns: 1fr;
    }

    /* Search modal */
    .sparkle-search-field input {
        font-size: 18px;
    }

    /* Compare bar */
    .sparkle-compare-bar-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px;
    }

    .sparkle-compare-list {
        order: 3;
        width: 100%;
    }

    .sparkle-compare-label {
        order: 1;
    }

    .sparkle-compare-actions {
        order: 2;
    }

    /* Drawers near full width on mobile */
    .sparkle-drawer {
        width: 340px;
    }
}

/* ---------- Small phones (max 480px) ---------- */
@media (max-width: 480px) {
    .sparkle-container {
        padding: 0 14px;
    }

    .sparkle-hero-title {
        font-size: 24px;
    }

    .sparkle-hero-media {
        min-height: 320px;
    }

    .sparkle-hero-subtitle {
        margin-bottom: 18px;
    }

    .sparkle-hero-dots {
        bottom: 14px;
    }

    .sparkle-collections {
        grid-template-columns: repeat(2, 1fr);
    }

    .sparkle-instagram-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 14px;
    }

    .sparkle-cart-form .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sparkle-cart-coupon {
        flex-direction: column;
    }

    .sparkle-popup {
        padding: 36px 24px 28px;
    }

    .sparkle-compare-modal-inner {
        padding: 26px 18px;
    }

    .sparkle-back-to-top {
        right: 16px;
        bottom: 16px;
    }
}

/* Hide horizontal scrollbars on carousels */
.sparkle-collections::-webkit-scrollbar {
    display: none;
}