/**
 * WooCommerce Styles
 *
 * Custom styles for WooCommerce pages and components.
 */

/* ==========================================================================
   Shop Page / Product Archives
   ========================================================================== */

.woocommerce-main {
    padding: var(--space-8) 0;
}

/* Archive layout with sidebar */
.archive-product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

@media (min-width: 1024px) {
    .archive-product-layout {
        grid-template-columns: 1fr 280px;
        gap: var(--space-10);
    }

    .archive-product-layout.sidebar-hidden {
        grid-template-columns: 1fr;
    }

    .archive-product-layout.sidebar-hidden .archive-sidebar-col {
        display: none;
    }

    .archive-product-layout .archive-product-main {
        min-width: 0;
    }

    .archive-product-layout .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .archive-product-layout.sidebar-hidden .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
    display: none;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-right: var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-gray-700);
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.sidebar-toggle-btn:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
}

.sidebar-toggle-btn .sidebar-toggle-icon {
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .sidebar-toggle-btn {
        display: inline-flex;
    }
}

@media (max-width: 1023px) {
    .sidebar-toggle-btn {
        display: none;
    }
}

/* Shop sidebar - sticky with scrollable content on desktop */
.shop-sidebar-sticky {
    position: relative;
}

@media (min-width: 1024px) {
    .shop-sidebar-sticky {
        position: sticky;
        top: calc(var(--header-height, 80px) + var(--space-4));
        max-height: calc(100vh - var(--header-height, 80px) - var(--space-8));
        display: flex;
        flex-direction: column;
    }

    .shop-sidebar-scroll {
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: var(--space-2);
    }

    .shop-sidebar-scroll::-webkit-scrollbar {
        width: 6px;
    }

    .shop-sidebar-scroll::-webkit-scrollbar-track {
        background: var(--color-gray-100);
        border-radius: 3px;
    }

    .shop-sidebar-scroll::-webkit-scrollbar-thumb {
        background: var(--color-gray-300);
        border-radius: 3px;
    }

    .shop-sidebar-scroll::-webkit-scrollbar-thumb:hover {
        background: var(--color-gray-400);
    }
}

/* Shop sidebar */

.shop-sidebar .widget {
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
}

.shop-sidebar .widget:last-child {
    margin-bottom: 0;
}

.shop-sidebar .widget-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-gray-200);
}

.shop-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shop-sidebar ul li {
    margin-bottom: var(--space-2);
}

.shop-sidebar ul li a {
    color: var(--color-gray-700);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.shop-sidebar ul li a:hover {
    color: var(--color-primary);
}

.woocommerce-result-count {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
    margin-bottom: var(--space-4);
}

.woocommerce-ordering {
    margin-bottom: var(--space-4);
}

.woocommerce-ordering select {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   Product Cards
   ========================================================================== */

.product-card {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image img {
    width: auto;
    height: 100%;
    object-fit: contain;
    margin: 0 auto;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-card-image .badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 1;
}

.product-card-info {
    padding: var(--space-4);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-gray-800);
    margin-bottom: var(--space-2);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-1);
}

.product-card-price del {
    color: var(--color-gray-400);
    font-weight: var(--font-normal);
    margin-right: var(--space-2);
}

.product-card-price ins {
    text-decoration: none;
    color: var(--color-danger);
}

.product-card-member-price {
    font-size: var(--text-xs);
    color: var(--color-primary);
    margin-top: auto;
    padding-top: var(--space-2);
}

.product-card-member-price .member-label {
    font-weight: var(--font-medium);
}

/* Quick Add Button */
.product-card-add {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--transition), transform var(--transition), background-color var(--transition-fast);
    z-index: 2;
}

.product-card:hover .product-card-add {
    opacity: 1;
    transform: translateY(0);
}

.product-card-add:hover {
    background: var(--color-secondary);
}

.product-card-add.loading {
    pointer-events: none;
}

.product-card-add.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Single Product Page
   ========================================================================== */

.single-product .woocommerce-main {
    padding-top: var(--space-4);
}

.single-product-page .container {
    --product-row-gap: var(--space-8);
    --product-row-padding: 0;
}

@media (min-width: 768px) {
    .single-product-page .container {
        --product-row-gap: var(--space-10);
    }
}

.product-single {
    /* Container for single product */
}

/* Product Top Row - Image and Summary Side by Side; consistent width/padding */
.product-top-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--product-row-gap, var(--space-8));
    margin-bottom: var(--space-10);
    padding: var(--product-row-padding);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .product-top-row {
        grid-template-columns: 1fr 1fr;
        gap: var(--product-row-gap, var(--space-10));
    }
}

@media (min-width: 1024px) {
    .product-top-row {
        gap: var(--space-12);
    }
}

.product-gallery-column,
.product-summary-column {
    min-width: 0;
}

/* Default WooCommerce structure: gallery + summary inline */
.woocommerce div.product > .woocommerce-product-gallery,
.woocommerce div.product > .summary.entry-summary {
    min-width: 0;
}

/* Default WC product: gallery + summary inline; tabs/related full-width */
.woocommerce div.product:not(.product-single) {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

.woocommerce div.product:not(.product-single) > .onsale {
    grid-column: 1 / -1;
}

.woocommerce div.product:not(.product-single) > .woocommerce-product-gallery {
    grid-column: 1;
    opacity: 1;
}

.woocommerce div.product:not(.product-single) > .summary.entry-summary {
    grid-column: 1;
}

.woocommerce div.product:not(.product-single) > .woocommerce-tabs,
.woocommerce div.product:not(.product-single) > .related.products,
.woocommerce div.product:not(.product-single) > .upsells.products {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .woocommerce div.product:not(.product-single) {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .woocommerce div.product:not(.product-single) > .woocommerce-product-gallery {
        grid-column: 1;
    }

    .woocommerce div.product:not(.product-single) > .summary.entry-summary {
        grid-column: 2;
    }
}

@media (min-width: 1024px) {
    .woocommerce div.product:not(.product-single) {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-12);
    }
}

/* Product Gallery - fixed height, images retain aspect ratio */
/* Hide zoom trigger (magnifying glass) - zoom disabled */
.woocommerce-product-gallery__trigger,
.product-gallery .woocommerce-product-gallery__trigger {
    display: none !important;
}

/* Subtle entrance animation for product gallery */
.woocommerce-product-gallery,
.product-gallery {
    position: relative;
    animation: productGalleryFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes productGalleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-gallery-main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-gray-100);
    margin-bottom: var(--space-4);
}

.product-gallery-main img {
    width: 100%;
    height: auto;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-gallery-main:hover img {
    transform: scale(1.02);
}


.product-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: var(--space-2);
    max-width: 320px;
}

.product-gallery-thumb {
    aspect-ratio: 1;
    height: 72px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-gray-100);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery-thumb img {
    width: 100%;
    height: auto;
}

.product-gallery-thumb.active,
.product-gallery-thumb:hover {
    border-color: var(--color-primary);
}

/* Product Summary */
.product-summary {
    position: relative;
}

.product-breadcrumbs {
    margin-bottom: var(--space-4);
}

.breadcrumbs {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

.breadcrumbs a {
    color: var(--color-gray-500);
}

.breadcrumbs a:hover {
    color: var(--color-primary);
}

.breadcrumb-sep {
    margin: 0 var(--space-2);
}

.product-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    .product-title {
        font-size: var(--text-3xl);
    }
}

.product-tagline {
    font-size: var(--text-lg);
    color: var(--color-gray-600);
    margin-bottom: var(--space-4);
}

/* Product Price */
.product-price-wrap {
    margin-bottom: var(--space-6);
}

.product-price {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-2);
}

.product-price del {
    font-size: var(--text-lg);
    color: var(--color-gray-400);
    font-weight: var(--font-normal);
    margin-right: var(--space-2);
}

.product-price ins {
    text-decoration: none;
    color: var(--color-danger);
}

.member-price-block {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(56, 102, 65, 0.1);
    border-radius: var(--radius);
    margin-top: var(--space-3);
}

.member-price-block .badge {
    flex-shrink: 0;
}

.member-price-info {
    flex: 1;
}

.member-price-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-primary);
}

.member-price-savings {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

/* Add to Cart Form */
.product-payments-image {
    margin-bottom: var(--space-4);
}

.product-payments-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.product-add-to-cart {
    margin-bottom: var(--space-6);
}

.atc-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 320px;
}

.quantity-wrap {
    flex-shrink: 0;
}

/* Pill-shaped quantity selector */
.quantity-selector {
    display: flex;
    align-items: center;
    background: var(--color-white);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--color-gray-300);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.quantity-selector--pill {
    border-radius: var(--radius-full);
}

.quantity-selector:focus-within {
    border-color: var(--color-gray-400);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.quantity-selector .qty-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-gray-800);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.quantity-selector .qty-btn:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-900);
}

.quantity-selector .qty-input {
    flex: 1;
    min-width: 48px;
    height: 48px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--color-gray-200);
    border-right: 1px solid var(--color-gray-200);
    background: transparent;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-gray-900);
    -moz-appearance: textfield;
}

.quantity-selector .qty-input::-webkit-outer-spin-button,
.quantity-selector .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Pill-shaped Add to Cart button - matches theme primary */
.add-to-cart-btn--pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 var(--space-6);
    height: 52px;
    background: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.add-to-cart-btn--pill:hover {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: var(--color-white);
}

.add-to-cart-btn--pill .add-to-cart-text {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.add-to-cart-btn--pill .add-to-cart-price {
    font-weight: var(--font-bold);
}

.add-to-cart-btn--pill .add-to-cart-price .woocommerce-Price-amount {
    color: inherit;
}

.add-to-cart-btn.loading,
.single_add_to_cart_button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.add-to-cart-btn.loading .add-to-cart-text,
.single_add_to_cart_button.loading .add-to-cart-text {
    position: relative;
}

.add-to-cart-btn.loading .add-to-cart-text::after,
.single_add_to_cart_button.loading .add-to-cart-text::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* WooCommerce cart form - our template overrides */
.woocommerce form.cart .atc-stack,
.product-add-to-cart form.cart .atc-stack,
form.cart .atc-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 320px;
}

/* Legacy atc-row for variable products */
.atc-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--space-3);
}

.product-add-to-cart .add-to-cart-btn:not(.add-to-cart-btn--pill) {
    flex: 1;
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 var(--space-5);
    height: 44px;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
}

/* Product Meta */
.product-meta {
    margin-bottom: var(--space-6);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--color-gray-200);
    border-radius: 0;
}

.product-meta-item {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.product-meta-item:last-child {
    margin-bottom: 0;
}

.product-meta-label {
    font-weight: var(--font-medium);
    color: var(--color-gray-700);
}

.product-meta-value {
    color: var(--color-gray-600);
}

.product-meta-value a {
    color: var(--color-primary);
}

/* Staggered summary animation (add to cart → trust blocks → membership CTA) after image loads */
.product-summary .product-add-to-cart,
.product-summary .trust-block,
.product-summary .product-membership-cta {
    opacity: 0;
    transform: translateY(12px);
}

.product-summary--animated .product-add-to-cart,
.product-summary--animated .trust-block,
.product-summary--animated .product-membership-cta {
    animation: productSummaryFadeIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.product-summary--animated .product-add-to-cart { animation-delay: 0.05s; }
.product-summary--animated .trust-block:nth-child(1) { animation-delay: 0.15s; }
.product-summary--animated .trust-block:nth-child(2) { animation-delay: 0.25s; }
.product-summary--animated .trust-block:nth-child(3) { animation-delay: 0.35s; }
.product-summary--animated .trust-block:nth-child(4) { animation-delay: 0.45s; }
.product-summary--animated .product-membership-cta { animation-delay: 0.55s; }

@keyframes productSummaryFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Trust Blocks */
.trust-blocks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.trust-block {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-gray-50);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--color-gray-700);
}

.trust-block svg {
    flex-shrink: 0;
    color: var(--color-primary);
}

/* Short Description */
.product-short-description {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-gray-600);
    margin-bottom: var(--space-6);
}

.product-short-description p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Sticky Add to Cart Bar
   ========================================================================== */

/* Sticky Add to Cart - rendered by product.js when product-atc-form scrolls out of view */
.sticky-atc-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-5) 0;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    z-index: 9999;
    visibility: visible;
    pointer-events: none;
    opacity: 0;
}

.sticky-atc-bar.visible {
    transform: translateY(0);
    pointer-events: auto;
    opacity: 1;
}

.sticky-atc-bar.hiding {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.sticky-atc-bar .sticky-atc-inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    float: right;
}

.sticky-atc-bar .sticky-atc-product {
    min-width: 0;
    flex-shrink: 1;
}

.sticky-atc-bar .sticky-atc-info {
    min-width: 0;
    overflow: hidden;
}

.sticky-atc-bar .sticky-atc-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

span.add-to-cart-price {
    padding-left: 23px;
}
.sticky-atc-bar .sticky-atc-qty {
    flex-shrink: 0;
}

.sticky-atc-bar .quantity-selector {
    height: 48px;
}

.sticky-atc-bar .quantity-selector .qty-btn {
    width: 44px;
    height: 48px;
}

.sticky-atc-bar .quantity-selector .qty-input {
    min-width: 44px;
    height: 48px;
}

.sticky-atc-bar .sticky-atc-btn {
    flex: 1;
    min-width: 200px;
    height: 48px;
    white-space: nowrap;
}

.sticky-atc-bar .sticky-atc-btn .add-to-cart-text,
.sticky-atc-bar .sticky-atc-btn .add-to-cart-price {
    white-space: nowrap;
}

/* Small mobile: keep bar on one row, shrink product area so button fits */
@media (max-width: 480px) {
    .sticky-atc-bar .sticky-atc-inner {
        flex-wrap: nowrap;
        gap: var(--space-3);
    }

    .sticky-atc-bar .sticky-atc-product {
        min-width: 0;
        flex-shrink: 1;
    }

    .sticky-atc-bar .sticky-atc-image {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
    }

    .sticky-atc-bar .sticky-atc-image img {
        width: 40px;
        height: 40px;
        object-fit: cover;
    }

    .sticky-atc-bar .sticky-atc-btn {
        min-width: 0;
        flex-shrink: 0;
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    .sticky-atc-bar .sticky-atc-btn .add-to-cart-price {
        font-size: 12px;
    }
}

/* ==========================================================================
   Slide Cart
   ========================================================================== */

.slide-cart {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--color-white);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.slide-cart[aria-hidden="false"] {
    transform: translateX(0);
}

.slide-cart-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slide-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-gray-200);
    flex-shrink: 0;
}

.slide-cart-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: 0;
}

.cart-count-label {
    font-weight: var(--font-normal);
    color: var(--color-gray-500);
}

.slide-cart-close {
    padding: var(--space-2);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-gray-500);
    transition: color var(--transition-fast);
}

.slide-cart-close:hover {
    color: var(--color-gray-900);
}

.slide-cart-contents {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Empty Cart */
.slide-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    text-align: center;
    flex: 1;
}

.empty-cart-icon {
    color: var(--color-gray-300);
    margin-bottom: var(--space-4);
}

.empty-cart-message {
    font-size: var(--text-lg);
    color: var(--color-gray-600);
    margin-bottom: var(--space-6);
}

/* Shipping Progress */
.shipping-progress {
    padding: var(--space-3) var(--space-6);
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
}

.shipping-progress.qualified {
    background: rgba(167, 201, 87, 0.1);
}

.progress-bar {
    height: 4px;
    background: var(--color-gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-2);
}

.progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    transition: width var(--transition);
}

.progress-message {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
    margin: 0;
    text-align: center;
}

.shipping-progress.qualified .progress-message {
    color: var(--color-primary);
    font-weight: var(--font-medium);
}

/* Cart Items */
.slide-cart-items {
    flex: 1;
    padding: var(--space-4) var(--space-6);
}

.cart-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-gray-100);
    position: relative;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-gray-800);
    display: block;
    margin-bottom: var(--space-1);
}

.cart-item-variation {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    margin-bottom: var(--space-1);
}

.cart-item-variation span {
    display: inline-block;
    margin-right: var(--space-2);
}

.cart-item-price {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-2);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.qty-btn:hover {
    background: var(--color-gray-200);
}

.qty-input {
    width: 40px;
    height: 28px;
    text-align: center;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.cart-item-remove {
    position: absolute;
    top: var(--space-3);
    right: 0;
    padding: var(--space-1);
    background: transparent;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.cart-item-remove:hover {
    color: var(--color-danger);
}

/* Cart Membership CTA */
.cart-membership-cta {
    margin: var(--space-4) var(--space-6);
    padding: var(--space-4);
    background: linear-gradient(135deg, rgba(56, 102, 65, 0.1) 0%, rgba(167, 201, 87, 0.1) 100%);
    border-radius: var(--radius-lg);
    text-align: center;
}

.savings-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-2);
}

.savings-amount {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-primary);
}

.savings-label {
    font-size: var(--text-xs);
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.savings-message {
    font-size: var(--text-sm);
    color: var(--color-gray-700);
    margin-bottom: var(--space-3);
}

/* Cart Footer */
.slide-cart-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-gray-200);
    background: var(--color-white);
    flex-shrink: 0;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.subtotal-label {
    font-size: var(--text-base);
    color: var(--color-gray-700);
}

.subtotal-amount {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-gray-900);
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.cart-note {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    text-align: center;
    margin: var(--space-3) 0 0;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.woocommerce-breadcrumb {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    margin-bottom: var(--space-4);
}

.woocommerce-breadcrumb a {
    color: var(--color-gray-500);
    text-decoration: none;
}

.woocommerce-breadcrumb a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

/* ==========================================================================
   Infinite Scroll
   ========================================================================== */

.infinite-scroll-sentinel {
    height: 1px;
    width: 100%;
    visibility: hidden;
    pointer-events: none;
}

.infinite-scroll-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-8);
    color: var(--color-gray-600);
    font-size: var(--text-sm);
}

.infinite-scroll-loading[hidden] {
    display: none;
}

.infinite-scroll-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: infiniteScrollSpin 0.8s linear infinite;
}

@keyframes infiniteScrollSpin {
    to { transform: rotate(360deg); }
}

/* Smooth animation for newly loaded products */
.products-grid .infinite-scroll-item {
    animation: infiniteScrollFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes infiniteScrollFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide pagination when infinite scroll is active */
.archive-product-page.has-infinite-scroll .archive-pagination-wrapper {
    display: none;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.woocommerce-pagination {
    margin-top: var(--space-8);
}

.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination li a,
.woocommerce-pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-gray-700);
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.woocommerce-pagination li a:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-300);
}

.woocommerce-pagination li span.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

/* ==========================================================================
   Notices
   ========================================================================== */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.woocommerce-message {
    background: rgba(167, 201, 87, 0.1);
    border-left: 4px solid var(--color-accent);
    color: var(--color-gray-800);
}

.woocommerce-info {
    background: rgba(106, 153, 78, 0.1);
    border-left: 4px solid var(--color-secondary);
    color: var(--color-gray-800);
}

.woocommerce-error {
    background: rgba(188, 71, 73, 0.1);
    border-left: 4px solid var(--color-danger);
    color: var(--color-gray-800);
    list-style: none;
    padding-left: var(--space-4);
    margin-left: 0;
}

/* ==========================================================================
   Cart Page
   ========================================================================== */

.woocommerce-cart-form {
    margin-bottom: var(--space-8);
}

.shop_table {
    width: 100%;
    border-collapse: collapse;
}

.shop_table th {
    text-align: left;
    padding: var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-gray-700);
    border-bottom: 2px solid var(--color-gray-200);
}

.shop_table td {
    padding: var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--color-gray-100);
    vertical-align: middle;
}

.cart_totals {
    max-width: 400px;
    margin-left: auto;
}

.cart_totals h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
}

.cart_totals table {
    width: 100%;
}

.cart_totals th,
.cart_totals td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-gray-100);
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

/* ==========================================================================
   Checkout Page
   ========================================================================== */

.woocommerce-checkout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

@media (min-width: 1024px) {
    .woocommerce-checkout {
        grid-template-columns: 1fr 400px;
    }
}

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
}

.woocommerce-checkout .form-row {
    margin-bottom: var(--space-4);
}

.woocommerce-checkout .form-row label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.woocommerce-checkout .form-row input,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
}

.woocommerce-checkout .form-row input:focus,
.woocommerce-checkout .form-row select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(56, 102, 65, 0.1);
}

#order_review_heading {
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
}

.woocommerce-checkout-review-order {
    padding: var(--space-6);
    background: var(--color-gray-50);
    border-radius: var(--radius-lg);
}

#place_order {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-lg);
}

/* ==========================================================================
   My Account
   ========================================================================== */

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-6);
}

.woocommerce-MyAccount-navigation li {
    border-bottom: 1px solid var(--color-gray-100);
}

.woocommerce-MyAccount-navigation li a {
    display: block;
    padding: var(--space-3);
    color: var(--color-gray-700);
    transition: background-color var(--transition-fast);
}

.woocommerce-MyAccount-navigation li a:hover,
.woocommerce-MyAccount-navigation li.is-active a {
    background: var(--color-gray-100);
    color: var(--color-primary);
}

@media (min-width: 768px) {
    .woocommerce-MyAccount-content {
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: var(--space-8);
    }
    
    .woocommerce-MyAccount-navigation {
        margin-bottom: 0;
    }
}
