/*
Theme Name: DZ Store
Theme URI: https://example.com/dz-store
Author: DZ Developer
Author URI: https://example.com
Description: A clean, elegant, minimalist WooCommerce theme with Algerian aesthetic. Features one-page checkout, customizable colors/fonts via Customizer, RTL support, and responsive design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dz-store
Tags: woocommerce, e-commerce, rtl-language-support, custom-colors, custom-logo, custom-menu
*/

/* ============================================
   CSS RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Default colors — overridden by Customizer via inline styles */
    --color-primary: #1B4332;
    --color-secondary: #D4A373;
    --color-bg: #FEFAF6;
    --color-text: #2D2D2D;
    --color-button: #1B4332;
    --color-button-text: #FFFFFF;
    --color-card-bg: #FFFFFF;
    --color-border: #E8E0D8;
    --color-muted: #8A8A8A;
    --color-hero-overlay: rgba(27, 67, 50, 0.65);

    --font-family: 'Cairo', sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.75rem;
    --font-size-4xl: 3.5rem;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.16);

    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    --max-width: 1280px;
    --header-height: 60px;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(254, 250, 246, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow var(--transition-base);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.site-logo img {
    max-height: 40px;
    width: auto;
}

.site-logo .site-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header-nav a {
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    position: relative;
    padding: var(--spacing-xs) 0;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.header-nav a:hover::after {
    width: 100%;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition-base);
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Header Layout: Reversed (logo right, nav left) */
.header-inner--reversed {
    flex-direction: row-reverse;
}

/* Header Layout: Centered (logo center, nav below) */
.header-centered .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-inner--center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--spacing-sm);
}

.header-nav--center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
}

.header-nav--center a {
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-text);
    position: relative;
    padding: var(--spacing-xs) 0;
}

.header-nav--center a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.header-nav--center a:hover::after {
    width: 100%;
}

/* COD trust badge */
.cod-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--color-primary);
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    transition: transform 8s ease;
}

.hero-section:hover .hero-bg {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--color-hero-overlay);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: 700px;
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* CAROUSEL STYLES */
.hero-carousel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-carousel-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-carousel-item.active {
    opacity: 1;
}

.hero-carousel-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 5;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: #FFFFFF;
    width: 24px;
    border-radius: 5px;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 14px 36px;
    background: var(--color-secondary);
    color: #FFFFFF;
    font-weight: 700;
    font-size: var(--font-size-base);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
}

.hero-cta:hover {
    background: #c4934e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: #FFFFFF;
}

/* ============================================
   PRODUCT GRID
   ============================================ */
.products-section {
    padding: var(--spacing-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.section-divider {
    width: 60px;
    height: 3px;
    background: var(--color-secondary);
    margin: var(--spacing-sm) auto 0;
    border-radius: 2px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(var(--product-columns, 3), 1fr);
    gap: var(--spacing-lg);
}

.product-card {
    background: var(--color-card-bg);
    border-radius: var(--card-radius, var(--radius-md));
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.product-card-image {
    position: relative;
    width: 100%;
    padding-top: var(--card-image-ratio, 100%);
    overflow: hidden;
    background: #f5f0eb;
}

.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.product-card-body {
    padding: var(--card-padding, var(--spacing-md));
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-name {
    font-size: var(--card-name-size, var(--font-size-base));
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.product-card-price {
    font-size: var(--card-price-size, var(--font-size-lg));
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.product-card-price del {
    color: var(--color-muted);
    font-weight: 400;
    font-size: var(--font-size-sm);
    margin-left: var(--spacing-xs);
}

.product-card-price ins {
    text-decoration: none;
}

.btn-buy-now {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    width: 100%;
    padding: var(--card-btn-padding, 12px 20px);
    background: var(--color-button);
    color: var(--color-button-text);
    font-weight: 600;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: auto;
    text-align: center;
}

.btn-buy-now:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--color-button-text);
}

.btn-buy-now svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* No products message */
.no-products {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--color-muted);
    font-size: var(--font-size-lg);
    grid-column: 1 / -1;
}

/* ============================================
   ONE-PAGE CHECKOUT
   ============================================ */
.checkout-page {
    padding: var(--spacing-3xl) 0;
    min-height: 80vh;
}

.checkout-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* Product summary section */
.checkout-product-summary {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border: 1px solid #ebe5df;
    display: flex;
    gap: var(--spacing-xl);
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.checkout-product-image {
    width: 260px;
    min-width: 260px;
    border-radius: 16px;
    overflow: hidden;
    background: #eeedea;
}

.checkout-product-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.checkout-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.checkout-product-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 0px;
    text-align: center;
}

.checkout-product-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1b4332;
    margin-bottom: 0px;
    text-align: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.quantity-label {
    font-weight: 700;
    font-size: 12px;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ebe5df;
    border-radius: 8px;
    overflow: hidden;
    background: #fffcf9;
}

.quantity-btn {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    color: #333333;
    transition: background 0.2s ease;
}

.quantity-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.quantity-input {
    width: 50px;
    height: 46px;
    text-align: center;
    border: none;
    border-left: 1px solid #ebe5df;
    border-right: 1px solid #ebe5df;
    font-weight: 800;
    font-size: 1rem;
    background: transparent;
    color: #333333;
}

/* Order form */
.checkout-order-form {
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--color-border);
}

.form-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--color-text);
}

.form-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    margin-bottom: var(--spacing-lg);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: var(--font-size-base);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.1);
}

.form-control::placeholder {
    color: #ccc;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238A8A8A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-error {
    font-size: var(--font-size-sm);
    color: #e74c3c;
    margin-top: 4px;
    display: none;
}

.form-group.has-error .form-control {
    border-color: #e74c3c;
}

.form-group.has-error .form-error {
    display: block;
}

/* Order total */
.order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-md);
    border-top: 2px solid var(--color-border);
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.order-total-amount {
    color: var(--color-primary);
    font-size: var(--font-size-xl);
}

.btn-confirm-order {
    width: 100%;
    padding: 16px 32px;
    margin-top: var(--spacing-lg);
    background: var(--color-button);
    color: var(--color-button-text);
    font-size: var(--font-size-lg);
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-confirm-order:hover {
    opacity: 0.92;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-confirm-order:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner on button */
.btn-confirm-order .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.btn-confirm-order.loading .btn-text {
    display: none;
}

.btn-confirm-order.loading .spinner {
    display: block;
}

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

/* Thank you message */
.thank-you-message {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.thank-you-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), #2d6a4f);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    animation: popIn 0.5s ease;
}

.thank-you-icon svg {
    width: 40px;
    height: 40px;
    fill: #fff;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.thank-you-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
}

.thank-you-text {
    font-size: var(--font-size-base);
    color: var(--color-muted);
    margin-bottom: var(--spacing-xs);
}

.order-number {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    background: var(--color-bg);
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sm);
    margin: var(--spacing-sm) 0;
}

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 12px 28px;
    margin-top: var(--spacing-lg);
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.btn-continue-shopping:hover {
    opacity: 0.9;
    color: #fff;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--color-text);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--spacing-3xl) 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-xl);
    padding-bottom: var(--spacing-2xl);
}

.footer-column-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: var(--spacing-md);
    position: relative;
    padding-bottom: var(--spacing-xs);
}

.footer-column-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--color-secondary);
}

.footer-links li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-secondary);
}

.footer-social {
    display: flex;
    gap: var(--spacing-sm);
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.footer-social a:hover {
    background: var(--color-secondary);
    color: #fff;
    transform: translateY(-3px);
}

.footer-social svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-md) 0;
    text-align: center;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   RTL SUPPORT
   ============================================ */
[dir="rtl"] .header-nav {
    direction: rtl;
}

[dir="rtl"] select.form-control {
    background-position: left 14px center;
    padding-left: 36px;
    padding-right: 16px;
}

[dir="rtl"] .product-card-price del {
    margin-left: 0;
    margin-right: var(--spacing-xs);
}

[dir="rtl"] .footer-column-title::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .form-group label .required {
    margin-left: 0;
    margin-right: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2.25rem;
        --font-size-3xl: 2rem;
        --font-size-2xl: 1.5rem;
        --header-height: 40px;
    }

    .site-header {
        padding: 0;
    }

    /* Force 2 products per line on mobile */
    .woocommerce ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .woocommerce ul.products li.product {
        width: 100% !important;
        margin: 0 0 20px 0 !important;
    }

    .site-header .container {
        padding: 0 10px;
    }

    .header-inner,
    .header-inner--center {
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-direction: row !important;
    }

    .site-logo img {
        max-height: 28px;
    }

    .site-logo .site-title {
        font-size: 1.1rem;
    }

    /* Show hamburger toggle on ALL layouts */
    .menu-toggle {
        display: flex;
        padding: 4px;
        gap: 4px;
    }

    .menu-toggle span {
        width: 20px;
        height: 2px;
    }

    /* Force BOTH nav types into sidebar drawer on mobile */
    .header-nav,
    .header-nav--center {
        display: flex;
        position: fixed;
        top: 0;
        bottom: 0;
        left: -260px;
        width: 260px;
        height: 100vh;
        background: var(--color-card-bg);
        flex-direction: column;
        padding: 80px var(--spacing-md) var(--spacing-md);
        gap: 10px !important;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
        z-index: 2000;
        transition: left 0.3s ease;
        border-right: 1px solid var(--color-border);
        border-bottom: none;
        justify-content: flex-start !important;
    }

    /* Fix: Bring header above the blur overlay when open */
    body.menu-open .site-header {
        z-index: 2100;
    }

    /* RTL support for sidebar */
    [dir="rtl"] .header-nav,
    [dir="rtl"] .header-nav--center {
        left: auto;
        right: -260px;
        border-right: none;
        border-left: 1px solid var(--color-border);
        box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
        transition: right 0.3s ease;
    }

    .header-nav.open,
    .header-nav--center.open {
        left: 0;
    }

    [dir="rtl"] .header-nav.open,
    [dir="rtl"] .header-nav--center.open {
        left: auto;
        right: 0;
    }

    .header-nav a,
    .header-nav--center a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        width: 100%;
        text-align: inherit;
        font-weight: 700;
    }

    /* Hide the centered nav separate row on mobile — it's now in the sidebar */
    .header-centered .container {
        flex-direction: row;
    }

    /* Menu Backdrop Overlay */
    body.menu-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1001;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .hero-section {
        min-height: 320px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .checkout-product-summary {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .checkout-product-image {
        width: 100%;
        max-width: 300px;
        min-width: unset;
    }

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

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

@media (max-width: 480px) {

    .products-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        display: grid !important;
        gap: 8px !important;
    }

    .woocommerce ul.products li.product {
        width: 100% !important;
        margin-bottom: 15px !important;
    }

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

    .checkout-product-image {
        max-width: 260px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.product-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.product-card:nth-child(1) {
    animation-delay: 0.05s;
}

.product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card:nth-child(3) {
    animation-delay: 0.15s;
}

.product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.product-card:nth-child(5) {
    animation-delay: 0.25s;
}

.product-card:nth-child(6) {
    animation-delay: 0.3s;
}

.product-card:nth-child(7) {
    animation-delay: 0.35s;
}

.product-card:nth-child(8) {
    animation-delay: 0.4s;
}

.product-card:nth-child(9) {
    animation-delay: 0.45s;
}

.product-card:nth-child(10) {
    animation-delay: 0.5s;
}

.product-card:nth-child(11) {
    animation-delay: 0.55s;
}

.product-card:nth-child(12) {
    animation-delay: 0.6s;
}

/* ============================================
   WOOCOMMERCE OVERRIDES
   ============================================ */
.woocommerce-notices-wrapper,
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
}

.woocommerce-message {
    background: #d4edda;
    border-left: 4px solid var(--color-primary);
    color: #155724;
}

.woocommerce-error {
    background: #f8d7da;
    border-left: 4px solid #e74c3c;
    color: #721c24;
}

/* Hide default WC add to cart on shop pages since we use Buy Now */
.woocommerce ul.products li.product .button {
    display: none !important;
}