/* =====================================================================
   BASE — loaded by every page.
   Contains: design tokens, reset, global element defaults, and the
   site chrome (header, sidebar nav, cart drawer, checkout modal,
   scroll-to-top, footer) that used to be duplicated near-identically
   across style.css and style-2.css. Page-specific styles live in
   home.css / category.css / product.css / pages.css.
   ===================================================================== */

/* -------- Fonts --------
   Both weights are registered (the original project only shipped the
   Regular @font-face, so every place that used font-weight:600/700/bold
   was silently faux-bolded by the browser instead of using the real
   bold font file that was already sitting in /assets/fonts). Path is
   relative (not "/fonts/...") so the site keeps working if it's ever
   deployed from a sub-folder instead of a domain root. */
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanX/Woff2/IRANYekanXFaNum-Regular.woff2') format('woff2'),
         url('../fonts/IRANYekanX/Woff/IRANYekanXFaNum-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanX/Woff2/IRANYekanXFaNum-Bold.woff2') format('woff2'),
         url('../fonts/IRANYekanX/Woff/IRANYekanXFaNum-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* -------- Design tokens -------- */
:root {
    /* Colors */
    --gold: #e8af43;
    --gold-light: #e8e4c6;
    --black: #111111;
    --gray: #777777;
    --white: #ffffff;

    /* Backgrounds */
    --bg-main: #f6da9a;
    --bg-glass: rgba(255, 255, 255, .85);
    --bg-pages:#dbcba6;

    /* Radius */
    --radius-sm: .5rem;
    --radius-md: 1rem;
    --radius-lg: 1.8rem;
    --radius-xl: 2rem;
    --radius-round: 999px;

    /* Shadows */
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, .08);
    --shadow-md: 0 15px 35px rgba(0, 0, 0, .12);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, .18);

    /* Animation */
    --transition-fast: .2s ease;
    --transition: .35s ease;

    /* Layout */
    --container-width: 1400px;

    /* Spacing */
    --space-xs: .5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 5rem;
}

/* -------- Reset -------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-main);
    font-family: "IRANYekanX", sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--black);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    text-decoration: none;
    color: inherit;
}

svg, video {
    display: block;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
    padding: 0;
    color: inherit;
}

.container {
    width: min(var(--container-width), 100%);
    margin-inline: auto;
}

.empty-state {
    text-align: center;
    grid-column: 1 / -1;
    opacity: .5;
    padding: 2rem;
}

/* Respect the OS-level "reduce motion" preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Visible focus ring for keyboard users (buttons have no native outline
   once `border: none` is applied above, so this restores one). */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* =====================================================================
   Header
   ===================================================================== */
.header {
    position: sticky;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 1);
    padding: .4rem .6rem;
    border-radius: 0 0 .75rem .75rem;
    margin-inline: auto;
    height: auto;
    top: 0;
    z-index: 100;
}

.right1 {
    display: flex;
    gap: 0;
    align-items: center;
    height: 60px;
}

/* Brand mark. Intentionally NOT a heading element: it repeats on every
   page inside the header, so making it an <h1> gave every single page
   two top-level headings (the brand mark + the page's real <h1>),
   which breaks the document outline for screen readers and dilutes
   the page's actual heading for SEO. */
.logo {
    display: inline-block;
    letter-spacing: 3px;
    font-weight: 700;
    font-size: 2.05rem;
    color: var(--gold);
margin:.7rem 0 0 0;
}

.bar {
    padding: 0;
}

.basket {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, var(--gold), #e8d9a8);
    color: var(--black);
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

/* =====================================================================
   Sidebar navigation
   ===================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff, #c4b79a);
    border-left: 2px solid rgba(201, 162, 77, .35);
    padding: 2rem 1.5rem;
    transition: right .45s cubic-bezier(.4, 0, .2, 1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.sidebar-header h2,
.sidebar-header h3 {
    font-weight: 300;
    letter-spacing: 4px;
}

.close-btn {
    background: none;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.sidebar-menu a {
    color: var(--black);
    font-size: 1rem;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: .3rem;
    width: fit-content;
}

.sidebar-menu a::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width .3s;
}

.sidebar-menu a:hover::after {
    width: 100%;
}

/* Current-page indicator (set via classList in cart.js::highlightActivePage,
   not inline styles — keeps this rule the single source of truth for
   what "active" looks like). */
.sidebar-menu a.active-link {
    color: var(--gold);
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    font-size: .7rem;
    letter-spacing: 3px;
    opacity: .6;
    text-align: center;
}

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    backdrop-filter: blur(10px);
    z-index: 9998;
    pointer-events: none;
    transition: opacity .4s ease;
}

.backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.menu-toggle {
    width: 100%;
    font-size: 1rem;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--black);
    padding-bottom: .3rem;
    position: relative; /* anchor for the ::after underline */
}

.menu-toggle::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width .3s;
}

.menu-toggle:hover::after {
    width: 100%;
}

.arrow {
    transition: transform .3s;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
    padding-right: .5rem;
}

.submenu a {
    display: block;
    font-size: .9rem;
    color: #555;
    padding: .4rem 0;
}

.submenu a:hover {
    color: #000;
}

.menu-item.active .submenu {
    max-height: 500px;
    margin-top: 1.5rem;
}

.menu-item.active .arrow {
    transform: rotate(180deg);
}

@media (max-width: 360px) {
    .sidebar,
    .cart-sidebar {
        width: 90%;
    }
}

/* =====================================================================
   Cart drawer
   ===================================================================== */
.cart-sidebar {
    display: flex;
    flex-direction: column;
    width: 300px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #ffffff, #c4b79a);
    backdrop-filter: blur(12px);
    box-shadow: 20px 0 50px rgba(0, 0, 0, .2);
    transform: translateX(-100%);
    transition: transform .45s ease;
    border-right: 2px solid rgba(201, 162, 77, .35);
    padding: .5rem;
    z-index: 9999;
}

.cart-sidebar.active {
    transform: translateX(0);
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.cart-item {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, .75);
    border-radius: 12px;
    padding: 8px;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .12);
}

.cart-item img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.cart-item h4 {
    font-size: .9rem;
    margin: 0;
}

.cart-item span {
    font-size: .8rem;
    color: var(--gold);
}

.cart-item button {
    background: rgba(201, 162, 77, .15);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 14px;
}

.cart-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-footer span {
    font-weight: 700;
    font-size: 1rem;
    color: #1d1d1d;
}

.checkout-btn {
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--black);
    font-weight: 700;
    transition: .3s;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

/* =====================================================================
   Add-to-cart button (used on every product card)
   ===================================================================== */
.add-to-cart {
    display: inline-block;
    width: 100%;
    background: var(--black);
    color: var(--white);
    padding: .7rem 1.8rem;
    border-radius: var(--radius-round);
    border: 1px solid rgba(201, 162, 77, .6);
    font-size: .85rem;
    letter-spacing: 2px;
    transition: .4s ease;
    z-index: 10;
    position: relative;
}

.add-to-cart:hover {
    background: var(--gold);
    color: var(--black);
}

.add-to-cart:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.sold-out-btn {
    background: rgba(0, 0, 0, .06);
    color: #aaa;
    border: 1px solid rgba(0, 0, 0, .08);
}

.product-card.sold-out .img-wrap {
    opacity: .55;
    filter: grayscale(30%);
}

/* =====================================================================
   Scroll-to-top button
   ===================================================================== */
.scroll-top {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #e8d9a8);
    color: var(--black);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(201, 162, 77, .4);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .35s ease, transform .35s ease;
    z-index: 9000;
    pointer-events: none;
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(201, 162, 77, .5);
}

/* =====================================================================
   Checkout modal
   ===================================================================== */
#checkoutModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#checkoutModal.open {
    display: flex;
}

.checkout-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(6px);
}

.checkout-box {
    position: relative;
    background: linear-gradient(160deg, #fff 60%, #f5edd8);
    border-radius: 24px;
    padding: 2rem 1.5rem 1.5rem;
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
    border: 1px solid rgba(201, 162, 77, .25);
    animation: modalIn .3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes modalIn {
    from { transform: scale(.88) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.checkout-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1rem;
    opacity: .5;
    transition: opacity .2s;
}

.checkout-close:hover {
    opacity: 1;
}

.checkout-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.checkout-icon {
    font-size: 2rem;
}

.checkout-header h3 {
    font-weight: 400;
    letter-spacing: 3px;
    margin: .4rem 0 0;
    color: #222;
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    margin-bottom: 1.2rem;
    max-height: 36vh;
    overflow-y: auto;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    background: rgba(255, 255, 255, .8);
    border-radius: 14px;
    padding: .7rem;
    border: 1px solid rgba(201, 162, 77, .15);
}

.checkout-item img {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.checkout-item-info {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    flex: 1;
}

.checkout-item-title {
    font-size: .88rem;
    color: #222;
}

.checkout-item-qty {
    font-size: .78rem;
    color: #888;
}

.checkout-item-price {
    font-size: .85rem;
    color: var(--gold);
    font-weight: 700;
    white-space: nowrap;
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .9rem 1rem;
    background: rgba(201, 162, 77, .1);
    border-radius: 12px;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid rgba(201, 162, 77, .25);
}

.checkout-note {
    font-size: .82rem;
    color: #666;
    text-align: center;
    line-height: 1.8;
    margin: 0 0 1.2rem;
}

.checkout-actions {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.checkout-insta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .9rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    transition: .3s;
    box-shadow: 0 6px 20px rgba(200, 50, 100, .3);
    letter-spacing: 1px;
}

.checkout-insta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(200, 50, 100, .4);
}

.checkout-insta-btn:disabled {
    opacity: .8;
    cursor: not-allowed;
    transform: none;
}

.checkout-clear {
    padding: .7rem;
    border-radius: 12px;
    background: transparent;
    border: 1px solid rgba(200, 50, 50, .3);
    color: #c0392b;
    font-size: .85rem;
    transition: .25s;
    font-family: inherit;
}

.checkout-clear:hover {
    background: rgba(200, 50, 50, .08);
}

/* =====================================================================
   Footer
   ===================================================================== */
.footer-line {
    width: 200px;
    height: 2px;
    margin: 0 auto .5rem;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.footer {
    margin-top: 4rem;
    padding: 3rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(201, 162, 77, .4);
    text-align: center;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, .65);
}

.footer-brand h2 {
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--gold);
    margin-bottom: .5rem;
}

.footer-brand p {
    font-size: .85rem;
    color: #666;
    margin-bottom: 2rem;
}

.footer-links,
.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer a {
    font-size: .85rem;
    color: #333;
    position: relative;
}

.footer a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: .4s;
    transform: translateX(-50%);
}

.footer a:hover::after {
    width: 100%;
}

.footer-social a:hover {
    color: var(--gold);
}

.footer-copy {
    margin-top: 1.5rem;
    font-size: .7rem;
    color: #888;
}

/* =====================================================================
   Shared product card (homepage "ویژه" row + every category grid)
   ===================================================================== */
.img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 1.4rem;
}

.img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.product-card {
    background: rgba(255, 255, 255, .85);
    border-radius: 1.8rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .06);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, .1);
}

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

.product-card h4 {
    font-weight: 400;
    margin: 1rem 0 .4rem;
    font-size: 1rem;
    color: #2d2d2d;
}

.price {
    color: var(--gray);
    font-size: .9rem;
    letter-spacing: 1px;
}

.vip {
    border: 1px solid rgba(201, 162, 77, .5);
}

.vip::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.8rem;
    background: radial-gradient(circle at top, rgba(201, 162, 77, .25), transparent 60%);
    opacity: 0;
    transition: .4s;
}

.vip:hover::before {
    opacity: 1;
}

.vip:hover {
    transform: translateY(-10px) scale(1.03);
}

.vip-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    font-size: .65rem;
    letter-spacing: 3px;
    padding: 5px 10px;
    border-radius: var(--radius-round);
    color: var(--gold);
    border: 1px solid rgba(201, 162, 77, .6);
    background: rgba(255, 255, 255, .9);
}
