/* ==========================================================================
   ریست و متغیرها
   ========================================================================== */
:root {
    --color-primary: #7a4a2b;
    --color-primary-dark: #5c3620;
    --color-accent: #c9974c;
    --color-dark: #241a12;
    --color-light-bg: #faf6f0;
    --color-text: #2b2118;
    --color-muted: #7a6f63;
    --radius: 10px;
    --shadow: 0 6px 24px rgba(36, 26, 18, 0.12);
    --header-height: 76px;
}

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

html { scroll-behavior: smooth; }

html, body { height: 100%; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--color-text);
    background: var(--color-light-bg);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* فوتر همیشه به کف صفحه می‌چسبد؛ حتی وقتی محتوای صفحه کوتاه‌تر از ارتفاع صفحه باشد
   (مثل صفحه تماس با ما) این قانون آن را به پایین صفحه هل می‌دهد */
.site-footer { margin-top: auto; }

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-wrap: break-word;
}

@media (max-width: 480px) {
    .container { padding: 0 24px; }
}

.btn, .btn-outline {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--color-primary);
    transition: all .25s ease;
    font-family: inherit;
    font-size: 1rem;
}
.btn { background: var(--color-primary); color: #fff; }
.btn:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.btn-outline { background: transparent; color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }

/* ==========================================================================
   هدر / ناوبری
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(250, 246, 240, 0.95);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    height: var(--header-height);
}
.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo img { max-height: 46px; }
.logo-text { font-size: 1.4rem; font-weight: 800; color: var(--color-primary); }

.main-nav { display: flex; gap: 28px; }
.main-nav a { font-weight: 600; padding: 8px 4px; position: relative; }
.main-nav a::after {
    content: '';
    position: absolute; right: 0; bottom: -2px;
    width: 0; height: 2px; background: var(--color-accent);
    transition: width .25s ease;
}
.main-nav a:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--color-dark); border-radius: 2px; }

/* ==========================================================================
   هیرو / بک‌گراند ثابت
   ========================================================================== */
.hero {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: center;
    background-image: var(--hero-bg-image, linear-gradient(135deg, #7a4a2b, #241a12));
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* بک‌گراند ثابت روی دسکتاپ */
    color: #fff;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(36,26,18,.55), rgba(36,26,18,.75));
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 60px 20px;
}
.hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.hero-content p {
    max-width: 700px;
    margin: 0 auto 30px;
    font-size: 1.1rem;
    color: #f1e9df;
}

/* گالری عکس‌های جذاب زیر متن هیرو */
.hero-gallery {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 10px 4px 20px;
    scroll-snap-type: x proximity;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-gallery img {
    width: 220px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    scroll-snap-align: center;
    flex-shrink: 0;
}

/* در موبایل background-attachment:fixed مشکل‌ساز و کندکننده است */
@media (max-width: 768px) {
    .hero { background-attachment: scroll; min-height: 64vh; }
}

/* ==========================================================================
   بخش ویدیوی کنترل‌شونده با اسکرول
   ========================================================================== */
.scroll-video-section {
    position: relative;
    height: 300vh; /* ارتفاع بیشتر = کنترل نرم‌تر روی طول ویدیو حین اسکرول */
    background: var(--color-dark);
}
.scroll-video-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.scroll-video-sticky video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.scroll-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 50px;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.6));
    color: #fff;
    pointer-events: none;
}
.scroll-video-overlay h2 { font-size: clamp(1.3rem, 3vw, 2rem); }

/* ==========================================================================
   بخش معرفی خدمات (صفحه اصلی)
   ========================================================================== */
.services-section { padding: 70px 0; }
.section-heading { text-align: center; margin-bottom: 42px; }
.section-heading h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--color-primary-dark); font-weight: 800; }
.section-heading p { color: var(--color-muted); margin-top: 10px; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.service-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s ease;
}
.service-card:hover { transform: translateY(-6px); }
.service-card img { width: 100%; height: 170px; object-fit: cover; }
.service-card-body { padding: 18px; }
.service-card-body h3 { color: var(--color-primary-dark); margin-bottom: 8px; }
.service-card-body p { color: var(--color-muted); font-size: .95rem; }

/* ==========================================================================
   فروشگاه
   ========================================================================== */
.shop-header { padding: 40px 0 10px; text-align: center; }
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 40px;
}
.category-filters a {
    padding: 9px 20px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e3d8ca;
    font-weight: 600;
    color: var(--color-muted);
}
.category-filters a.active,
.category-filters a:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 26px;
    padding-bottom: 60px;
}
.product-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s ease;
}
.product-card:hover { transform: translateY(-6px); }
.product-card img { width: 100%; height: 210px; object-fit: cover; }
.product-card-body { padding: 16px; }
.product-card-body h3 { font-size: 1.05rem; color: var(--color-dark); margin-bottom: 6px; }
.product-card-body p { color: var(--color-muted); font-size: .9rem; margin-bottom: 10px; }
.product-card-cat { display: inline-block; font-size: .78rem; color: var(--color-accent); font-weight: 700; margin-bottom: 6px; }

.empty-note { text-align: center; color: var(--color-muted); padding: 40px 0; }

/* ==========================================================================
   صفحه جزئیات محصول
   ========================================================================== */
.product-detail { padding: 50px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.product-gallery-main img {
    width: 100%; height: 420px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 14px;
}
.product-gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.product-gallery-thumbs img {
    width: 80px; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer;
    border: 2px solid transparent; opacity: .75;
}
.product-gallery-thumbs img.active,
.product-gallery-thumbs img:hover { opacity: 1; border-color: var(--color-accent); }

.product-info h1 { font-size: 1.7rem; color: var(--color-primary-dark); margin-bottom: 12px; }
.product-info-cat { color: var(--color-accent); font-weight: 700; margin-bottom: 16px; display: inline-block; }
.product-info-specs { margin: 20px 0; }
.product-info-specs li { padding: 8px 0; border-bottom: 1px dashed #e3d8ca; display: flex; justify-content: space-between; }
.product-info-desc { color: var(--color-muted); margin-bottom: 26px; }
.price-cta {
    background: #fff3e4;
    border: 1px dashed var(--color-accent);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.price-cta p { margin-bottom: 14px; font-weight: 600; color: var(--color-primary-dark); }

@media (max-width: 860px) {
    .product-detail { grid-template-columns: 1fr; }
}

/* ==========================================================================
   صفحه تماس با ما
   ========================================================================== */
.contact-page { padding: 50px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-page-info h2 { color: var(--color-primary-dark); margin-bottom: 18px; }
.contact-page-info ul li { padding: 10px 0; border-bottom: 1px solid #eee2d4; }
.contact-page-form { background: #fff; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-page-form input,
.contact-page-form textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #e3d8ca; border-radius: 8px;
    margin-bottom: 14px; font-family: inherit; font-size: 1rem;
}
.contact-page-form button { width: 100%; }

@media (max-width: 860px) {
    .contact-page { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .contact-page { padding: 34px 0; gap: 34px; }
    .contact-page-info,
    .contact-page-form { padding: 0 4px; }
    .contact-page-form { padding: 24px 18px; }
}

/* ==========================================================================
   فوتر
   ========================================================================== */
.site-footer { background: var(--color-dark); color: #eee3d5; margin-top: 60px; }

.footer-contact-box { background: var(--color-primary-dark); padding: 50px 0; }
.footer-contact-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; }
.footer-contact-inner h3 { color: #fff; margin-bottom: 16px; font-size: 1.2rem; }
.contact-info-list li { padding: 6px 0; color: #f1e5d5; }
.contact-info-list a { color: #ffd9a0; font-weight: 700; }
.footer-note { margin-top: 14px; color: #e3cfb3; font-size: .9rem; }

.quick-contact-form input,
.quick-contact-form textarea {
    width: 100%; padding: 11px 14px; border-radius: 8px; border: none;
    margin-bottom: 10px; font-family: inherit; font-size: .95rem;
}
.quick-contact-form button {
    background: var(--color-accent); color: #241a12; border: none;
    padding: 11px 24px; border-radius: 999px; font-weight: 700; cursor: pointer;
}
.form-status { margin-top: 10px; font-size: .9rem; color: #ffd9a0; }

.footer-section-title { color: #fff; font-size: 1.15rem; margin-bottom: 22px; }

.footer-services-box { padding: 44px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.footer-service-item { text-align: center; }
.footer-service-item img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.footer-service-item h4 { color: #fff; font-size: .95rem; margin-bottom: 4px; }
.footer-service-item p { font-size: .82rem; color: #cbbba4; }

.footer-products-box { padding: 44px 0; }
.footer-products-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.footer-products-header .btn-outline { border-color: var(--color-accent); color: var(--color-accent); }
.footer-products-header .btn-outline:hover { background: var(--color-accent); color: #241a12; }

.footer-categories-links { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.footer-categories-links a { color: #ffd9a0; font-weight: 600; font-size: .9rem; }

.footer-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }
.footer-product-item { text-align: center; }
.footer-product-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.footer-product-item span { font-size: .78rem; color: #dccbb2; }

.footer-bottom-bar { background: #17110b; padding: 18px 0; }
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .85rem; color: #a8998a; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: #cbbba4; }

/* ==========================================================================
   ریسپانسیو - موبایل
   ========================================================================== */
@media (max-width: 900px) {
    .footer-contact-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: var(--header-height);
        right: 0;
        width: 240px;
        height: calc(100vh - var(--header-height));
        background: #fff;
        flex-direction: column;
        padding: 24px;
        gap: 18px;
        transform: translateX(100%);
        transition: transform .3s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,.1);
    }
    .main-nav.open { transform: translateX(0); }
}
