/* ===========================
   صفحه‌ی اصلی (index.html)
   هدر/منو از css/navbar.css می‌آید.
   فونت‌ها با <link> در <head> لود می‌شوند:
   Vazirmatn برای متن فارسی، Poppins برای تیترهای لاتین.
=========================== */

/* ===========================
   RESET
=========================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
}

html,
body{
    overflow-x:hidden;
    overflow-x:clip;
}

body{
    font-family:"Vazirmatn", sans-serif;
    background:#fff;
    color:#111;
    -webkit-tap-highlight-color:transparent;
}

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

a{
    color:inherit;
}

:focus-visible{
    outline:2px solid #D4AF37;
    outline-offset:3px;
}

.latin{
    font-family:"Poppins", "Vazirmatn", sans-serif;
}

/* ===========================
   LOADER
   بدون وابستگی به GSAP: کلاس .hide را main.js اضافه می‌کند و
   اگر اسکریپت‌ها لود نشوند، خود CSS بعد از ۴ ثانیه لودر را برمی‌دارد.
=========================== */

#loader{
    position:fixed;
    inset:0;
    background:#000;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:0 20px;
    z-index:3000;
    transition:opacity .9s ease, visibility 0s linear .9s;
    animation:loaderFailsafe 0s linear 4s forwards;
}

#loader.hide{
    opacity:0;
    visibility:hidden;
}

@keyframes loaderFailsafe{
    to{ opacity:0; visibility:hidden; }
}

#loader h1{
    font-family:"Poppins", sans-serif;
    color:#fff;
    font-size:clamp(34px, 9vw, 70px);
    letter-spacing:.12em;
    text-align:center;
    white-space:nowrap;
}

/* ===========================
   HERO
=========================== */

.hero{
    position:relative;
    width:100%;
    height:100vh;
    height:100svh;
    min-height:520px;
    overflow:hidden;

    /* اگر ویدیو لود نشود، فریم پوستر ویدیو نمایش داده می‌شود */
    background:#111 url("../video/poster.jpg") center / cover no-repeat;

    display:flex;
    justify-content:center;
    align-items:center;
    text-align:center;
}

.hero video{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
}

/* دکمه‌ی پخش iOS (مثلاً در حالت Low Power که پخش خودکار غیرفعال است)
   روی هیرو نمایش داده نشود؛ در آن حالت پوستر دیده می‌شود */
.hero video::-webkit-media-controls,
.hero video::-webkit-media-controls-start-playback-button{
    display:none !important;
    -webkit-appearance:none;
}

/* ویدیو عمودی (۹:۱۶) است: در موبایل صفحه را کامل پر می‌کند، ولی در
   صفحه‌های افقی (دسکتاپ/تبلت افقی) با cover بیش از حد بزرگ و بریده
   می‌شد. آنجا ویدیو با ارتفاع کامل وسط قرار می‌گیرد و دو طرفش نسخه‌ی
   محو پوستر پر می‌کند. */
@media (min-aspect-ratio: 4/5){

    .hero::before{
        content:"";
        position:absolute;
        inset:-40px;
        background:url("../video/poster.jpg") center / cover no-repeat;
        filter:blur(28px) brightness(.55);
    }

    .hero video{
        object-fit:contain;
    }

}

.overlay{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.5);
}

.hero-content{
    position:relative;
    z-index:5;
    width:100%;
    max-width:900px;
    padding:0 20px;
    color:#fff;
}

.hero-content span{
    display:inline-block;
    font-family:"Poppins", sans-serif;
    letter-spacing:4px;
    font-size:15px;
}

.hero h1{
    font-family:"Poppins", sans-serif;
    font-size:clamp(38px, 10.5vw, 110px);
    letter-spacing:.07em;
    line-height:1.1;
    margin:20px 0;
    white-space:nowrap;
}

.hero p{
    font-size:20px;
    line-height:1.8;
    margin-bottom:10px;
}

.btn{
    display:inline-block;
    margin-top:26px;
    padding:18px 45px;
    background:white;
    color:black;
    text-decoration:none;
    font-weight:600;
    border-radius:50px;
    transition:background .4s, color .4s;
}

@media (hover:hover){
    .btn:hover{
        background:black;
        color:white;
    }
}

.scroll-down{
    position:absolute;
    bottom:40px;
    bottom:calc(32px + env(safe-area-inset-bottom, 0px));
    left:50%;
    transform:translateX(-50%);
    display:flex;
    align-items:center;
    gap:6px;
    padding:12px 18px;
    color:white;
    text-decoration:none;
    font-family:"Poppins", sans-serif;
    font-size:13px;
    letter-spacing:2px;
    z-index:5;
    animation:updown 1.5s infinite;
}

@keyframes updown{
    0%{transform:translate(-50%,0);}
    50%{transform:translate(-50%,12px);}
    100%{transform:translate(-50%,0);}
}

/* ===========================
   CATEGORIES
=========================== */

.categories{
    padding:120px 6%;
    scroll-margin-top:60px;
}

.categories h2,
.products h2{
    text-align:center;
    margin-bottom:60px;
    font-size:clamp(28px, 4vw, 45px);
    font-weight:800;
}

.category-container{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:24px;
    max-width:1400px;
    margin:0 auto;
}

.card{
    position:relative;
    display:block;
    overflow:hidden;
    border-radius:18px;
    cursor:pointer;
    text-decoration:none;
    color:#fff;
    background:#eee;
    aspect-ratio:3 / 4.4;
}

.card img{
    width:100%;
    height:100%;
    object-fit:cover;
    transition:transform .5s;
}

/* گرادیان پایین کارت تا عنوان روی هر عکسی خوانا باشد */
.card::after{
    content:"";
    position:absolute;
    inset:auto 0 0 0;
    height:45%;
    background:linear-gradient(to top, rgba(0,0,0,.65), transparent);
    pointer-events:none;
}

@media (hover:hover){
    .card:hover img{
        transform:scale(1.08);
    }
}

/* کارت با عکس بدون پس‌زمینه (کفش‌ها): کفش روی زمینه‌ی تیره با نور موضعی */
.card.cardCutout{
    background:
        radial-gradient(75% 55% at 50% 42%, rgba(255,240,205,.14), transparent 70%),
        linear-gradient(180deg, #1d1c19, #0f0f0e);
}

.card.cardCutout img{
    object-fit:contain;
    padding:10% 10% 22%;
    filter:drop-shadow(0 16px 14px rgba(0,0,0,.6));
}

.card h3{
    position:absolute;
    bottom:26px;
    right:26px;
    z-index:2;
    color:#fff;
    font-size:30px;
    font-weight:700;
}

.card .soonBadge{
    position:absolute;
    top:16px;
    right:16px;
    z-index:2;
    padding:5px 12px;
    border-radius:20px;
    background:rgba(0,0,0,.55);
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);
    color:#fff;
    font-size:12px;
}

/* ===========================
   PRODUCTS
=========================== */

.products{
    padding:40px 6% 120px;
}

.product-container{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:35px;
    max-width:1200px;
    margin:0 auto;
}

.product{
    display:block;
    text-align:center;
    text-decoration:none;
    color:#111;
}

.product img{
    width:100%;
    aspect-ratio:4 / 5;
    object-fit:cover;
    border-radius:15px;
    background:#f1f1f1;
    transition:transform .4s;
}

@media (hover:hover){
    .product:hover img{
        transform:translateY(-6px);
    }
}

.product h3{
    margin-top:18px;
    font-size:19px;
}

.product p{
    margin-top:8px;
    font-weight:600;
    color:#555;
}

/* ===========================
   FOOTER
=========================== */

footer{
    background:#000;
    color:#fff;
    text-align:center;
    padding:70px 20px;
    padding-bottom:calc(70px + env(safe-area-inset-bottom, 0px));
}

footer h2{
    font-family:"Poppins", sans-serif;
    letter-spacing:3px;
    margin-bottom:16px;
}

footer p{
    color:#aaa;
    font-size:14px;
}

/* ===========================
   CUSTOM CURSOR — فقط دسکتاپ (ماوس)
=========================== */

.cursor,
.cursor2{
    position:fixed;
    top:0;
    left:0;
    border-radius:50%;
    pointer-events:none;
    opacity:0;
    transition:opacity .3s;
}

.cursor{
    width:10px;
    height:10px;
    background:#d4af37;
    z-index:2600;
}

.cursor2{
    width:45px;
    height:45px;
    border:2px solid #d4af37;
    z-index:2599;
}

.cursor.visible,
.cursor2.visible{
    opacity:1;
}

@media (hover:none), (pointer:coarse){
    .cursor,
    .cursor2{
        display:none;
    }
}

/* ===========================
   RESPONSIVE
=========================== */

@media (max-width:992px){

    .category-container{
        grid-template-columns:repeat(2, 1fr);
        gap:16px;
    }

    .product-container{
        gap:20px;
    }

}

@media (max-width:768px){

    .hero p{
        font-size:16px;
    }

    .hero-content span{
        font-size:12px;
        letter-spacing:3px;
    }

    .btn{
        padding:15px 36px;
        margin-top:22px;
    }

    .categories{
        padding:70px 16px 40px;
    }

    .categories h2,
    .products h2{
        margin-bottom:28px;
    }

    .category-container{
        gap:12px;
    }

    .card{
        border-radius:14px;
    }

    .card h3{
        bottom:14px;
        right:14px;
        font-size:20px;
    }

    .card .soonBadge{
        top:10px;
        right:10px;
        font-size:11px;
        padding:4px 10px;
    }

    /* «جدیدترین محصولات» در موبایل یک ردیف قابل سوایپ می‌شود */
    .products{
        padding:40px 0 70px;
    }

    .product-container{
        grid-template-columns:none;
        grid-auto-flow:column;
        grid-auto-columns:68%;
        gap:14px;
        overflow-x:auto;
        scroll-snap-type:x mandatory;
        scroll-padding:0 16px;
        padding:0 16px 10px;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
    }

    .product-container::-webkit-scrollbar{
        display:none;
    }

    .product{
        scroll-snap-align:start;
    }

    .product h3{
        font-size:16px;
        margin-top:12px;
    }

    .product p{
        font-size:14px;
    }

    footer{
        padding:50px 20px;
        padding-bottom:calc(50px + env(safe-area-inset-bottom, 0px));
    }

}

@media (prefers-reduced-motion: reduce){
    .scroll-down{
        animation:none;
    }
}
