/* ── Design tokens ──────────────────────────────────────── */
:root {
    --gold:        #C4973A;
    --gold-light:  #E4C05A;
    --charcoal:    #1A1410;
    --cream:       #FAF6EE;
    --sand:        #EAE0CE;
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Base ───────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { background-color: var(--cream); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ── Typography ─────────────────────────────────────────── */
.font-display { font-family: 'Cormorant Garamond', Georgia, serif; letter-spacing: -0.01em; }
[lang="ar"] .font-display, [dir="rtl"] .font-display { font-family: 'Cairo', sans-serif; }

/* ── Section heading ────────────────────────────────────── */
.section-heading { display: flex; align-items: center; gap: 1rem; }
.section-heading::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--sand), transparent); }
[dir="rtl"] .section-heading::after { background: linear-gradient(to left, var(--sand), transparent); }

/* ── Product card ───────────────────────────────────────── */
.product-card { position: relative; background: #fff; border-radius: 1rem; overflow: hidden;
    transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
    box-shadow: 0 1px 3px rgba(26,20,16,0.06), 0 1px 2px rgba(26,20,16,0.04); }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(26,20,16,0.12), 0 4px 8px rgba(26,20,16,0.06); }
.product-card .card-img { overflow: hidden; aspect-ratio: 3/4; background: #F0E8D8; }
.product-card .card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease-smooth); }
.product-card:hover .card-img img { transform: scale(1.06); }
.product-card .wish-btn { opacity: 0; transition: opacity 0.2s ease, transform 0.2s var(--ease-spring); transform: scale(0.8); }
@media (max-width: 768px) { .product-card .wish-btn { opacity: 1; transform: scale(1); } }
.product-card:hover .wish-btn { opacity: 1; transform: scale(1); }
.product-card .card-quick-add { opacity: 0; transform: translateY(4px); transition: opacity 0.2s ease, transform 0.2s ease; }
.product-card:hover .card-quick-add { opacity: 1; transform: translateY(0); }
@media (max-width: 768px) { .product-card .card-quick-add { opacity: 1; transform: translateY(0); } }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: var(--charcoal); color: var(--gold-light); font-weight: 600;
    padding: 0.75rem 2rem; border-radius: 0.5rem; letter-spacing: 0.04em;
    text-transform: uppercase; font-size: 0.8rem;
    transition: background 0.2s ease, color 0.2s ease; text-decoration: none; border: none; cursor: pointer; }
.btn-primary:hover { background: #2D2520; color: #fff; }
.btn-gold { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: var(--gold); color: var(--charcoal); font-weight: 700;
    padding: 0.75rem 2rem; border-radius: 0.5rem; letter-spacing: 0.03em;
    transition: background 0.2s ease, transform 0.1s ease; text-decoration: none; border: none; cursor: pointer; }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); }

/* ── Form inputs ────────────────────────────────────────── */
.form-input { width: 100%; border: 1px solid #D4C9B8; border-radius: 0.5rem;
    padding: 0.625rem 0.875rem; font-size: 0.875rem; background: #FDFBF7; color: var(--charcoal);
    transition: border-color 0.2s ease, box-shadow 0.2s ease; outline: none; }
.form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196,151,58,0.15); }

/* ── Gold divider ───────────────────────────────────────── */
.gold-rule { height: 1px; background: linear-gradient(to right, transparent, var(--gold), transparent); border: none; margin: 0; }

/* ── Announce bar ───────────────────────────────────────── */
.announce-bar { background: var(--charcoal); color: var(--gold-light); font-size: 0.7rem;
    letter-spacing: 0.12em; text-transform: uppercase; text-align: center; padding: 0.4rem 1rem; }
.announce-bar-inner { transition: opacity 0.5s ease; }

/* ── Nav ────────────────────────────────────────────────── */
.site-nav { background: var(--charcoal); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(196,151,58,0.2); }

/* ── Hero grain overlay ─────────────────────────────────── */
.hero-grain::after { content: ''; position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat; background-size: 128px; pointer-events: none; mix-blend-mode: overlay; opacity: 0.5; }

/* ── Heritage ornament (hero) ───────────────────────────── */
.hero-ornament { position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 40%; max-width: 520px; opacity: 0.06; pointer-events: none; mix-blend-mode: screen; }

/* ── Status badge ───────────────────────────────────────── */
.status-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; padding: 0.2rem 0.65rem; border-radius: 9999px; }

/* ── Flash / toast ──────────────────────────────────────── */
.flash-success { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.25rem;
    background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 0.75rem; color: #166534; font-size: 0.875rem; }
.flash-error { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.25rem;
    background: #FEF2F2; border: 1px solid #FECACA; border-radius: 0.75rem; color: #991B1B; font-size: 0.875rem; }

/* ── Trust strip ────────────────────────────────────────── */
.trust-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 2rem; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* ── Qty stepper ────────────────────────────────────────── */
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid #DDD5C4; border-radius: 0.5rem; overflow: hidden; background: #fff; }
.qty-stepper button { width: 2.25rem; height: 2.25rem; display: flex; align-items: center; justify-content: center;
    color: #6B5E4E; background: transparent; transition: background 0.15s ease, color 0.15s ease; border: none; cursor: pointer; }
.qty-stepper button:hover { background: #F5EFE4; color: var(--charcoal); }
.qty-stepper span { width: 2.5rem; text-align: center; font-size: 0.875rem; font-weight: 600; color: var(--charcoal);
    border-left: 1px solid #DDD5C4; border-right: 1px solid #DDD5C4; line-height: 2.25rem; user-select: none; }

/* ── Category chip bar ──────────────────────────────────── */
.chip-bar { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: none; }
.chip-bar::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 0.375rem 0.875rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500;
    border: 1px solid #D4C9B8; color: #6B5E4E; background: #fff; white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; text-decoration: none; }
.chip:hover { background: #FAF6EE; border-color: var(--gold); color: var(--charcoal); }
.chip-active { background: var(--charcoal); color: #FAF6EE; border-color: var(--charcoal); }

/* ── Auth panel brand ───────────────────────────────────── */
.auth-panel-brand { background: var(--charcoal); position: relative; overflow: hidden; }
.auth-panel-brand::before { content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 60%, rgba(196,151,58,0.18) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(138,99,34,0.12) 0%, transparent 50%); }

/* ── Pagination ─────────────────────────────────────────── */
.woocommerce-pagination ul { display: flex; gap: 0.25rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span { display: inline-flex; align-items: center; justify-content: center;
    min-width: 2rem; padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.8rem;
    border: 1px solid transparent; transition: all 0.15s ease; text-decoration: none; }
.woocommerce-pagination ul li a:hover { border-color: var(--gold); color: var(--gold); }
.woocommerce-pagination ul li span.current { background: var(--charcoal); color: var(--gold-light); }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: #C9B49A; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Page transition ────────────────────────────────────── */
main { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Custom select ──────────────────────────────────────── */
/* Removes browser arrow; injects a gold SVG chevron */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' fill='none' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%23C4973A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.75rem;
    cursor: pointer;
}
[dir="rtl"] select.form-input {
    background-position: left 0.875rem center;
    padding-right: 0.875rem;
    padding-left: 2.75rem;
}

/* ── WC variation price / stock display ─────────────────── */
/* WC JS fills .single_variation div with price + availability */
.woocommerce-variation.single_variation {
    transition: opacity 0.25s ease;
}
.woocommerce-variation-price .price,
.woocommerce-variation .price {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: -0.01em;
    display: block;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}
.woocommerce-variation-availability .stock {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.woocommerce-variation-availability .in-stock  { color: #166534; }
.woocommerce-variation-availability .out-of-stock { color: #991b1b; }
.woocommerce-variation-availability .in-stock::before,
.woocommerce-variation-availability .out-of-stock::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.woocommerce-variation-availability .in-stock::before    { background: #22c55e; }
.woocommerce-variation-availability .out-of-stock::before { background: #ef4444; }

/* WC adds this class to .variations_button when no variation chosen */
.woocommerce-variation-add-to-cart-disabled .single_add_to_cart_button {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ── Single product: sticky image gallery (lg+) ─────────── */
@media (min-width: 1024px) {
    .product-gallery-sticky { position: sticky; top: 5.5rem; }
}

/* ── Product card stagger entrance ──────────────────────── */
@keyframes cardReveal {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cards-stagger .product-card {
    animation: cardReveal 0.42s var(--ease-smooth) backwards;
}
.cards-stagger .product-card:nth-child(1) { animation-delay: 0.04s; }
.cards-stagger .product-card:nth-child(2) { animation-delay: 0.10s; }
.cards-stagger .product-card:nth-child(3) { animation-delay: 0.16s; }
.cards-stagger .product-card:nth-child(4) { animation-delay: 0.22s; }
.cards-stagger .product-card:nth-child(5) { animation-delay: 0.28s; }
.cards-stagger .product-card:nth-child(6) { animation-delay: 0.34s; }
.cards-stagger .product-card:nth-child(7) { animation-delay: 0.40s; }
.cards-stagger .product-card:nth-child(8) { animation-delay: 0.46s; }
@media (prefers-reduced-motion: reduce) {
    .cards-stagger .product-card { animation: none; }
}

/* ── Hero stagger reveal ─────────────────────────────────── */
@keyframes heroReveal {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-reveal { animation: heroReveal 0.7s var(--ease-smooth) backwards; }
.hero-reveal-1 { animation-delay: 0.10s; }
.hero-reveal-2 { animation-delay: 0.24s; }
.hero-reveal-3 { animation-delay: 0.40s; }
.hero-reveal-4 { animation-delay: 0.56s; }
@media (prefers-reduced-motion: reduce) {
    .hero-reveal { animation: none; }
}

/* ── WooCommerce notices (cart added, errors) ─────────────── */
.woocommerce-message, .woocommerce-info {
    background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534;
    padding: 0.75rem 1.25rem; border-radius: 0.75rem; font-size: 0.875rem;
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem;
}
.woocommerce-error {
    background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B;
    padding: 0.75rem 1.25rem; border-radius: 0.75rem; font-size: 0.875rem;
    margin-bottom: 1rem; list-style: none;
}
/* Loading state on AJAX add-to-cart button */
.add_to_cart_button.loading { opacity: 0.6; pointer-events: none; }
.add_to_cart_button.added { background: #166534; }
.add_to_cart_button.added::after { content: ' ✓'; }

/* Cart badge pop — plays when WC fragment updates the count */
@keyframes badgePop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.55); }
    70%  { transform: scale(0.88); }
    100% { transform: scale(1); }
}
.ateej-cart-badge { transform-origin: center; }
.ateej-cart-badge.badge-pop { animation: badgePop 0.42s var(--ease-spring) forwards; }

/* ── Add-to-cart toast ───────────────────────────────────── */
.ateej-toast {
    position: fixed;
    bottom: 1.5rem;
    inset-inline-end: 1.5rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #241B14;
    color: #FAF6EE;
    border: 1px solid #C4973A;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.ateej-toast--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.ateej-toast a {
    color: #C4973A;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.ateej-toast a:hover { text-decoration: underline; }
