/**
 * Gilbom (گیل بوم) — Luxury Handicrafts E-Commerce Stylesheet
 * 100% Self-Hosted, RTL-First, Persian Typography, No External CDNs
 */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
         url('../fonts/Vazirmatn-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-primary: #3D6245;
    --color-primary-hover: #325239;
    --color-primary-light: #52825D;
    --color-primary-50: #F2F7F4;
    --color-cream: #FAF7F2;
    --color-cream-100: #F3ECE2;
    --color-gold: #C5A059;
    --color-dark: #1A241D;
    --color-muted: #6B7280;
    --color-border: #E5DED4;
    --color-error: #DC2626;
    --color-success: #16A34A;
    --radius: 1rem;
    --radius-sm: 0.5rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(61,98,69,0.08);
    --shadow-lg: 0 10px 25px -5px rgba(61,98,69,0.12);
}

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

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-cream);
    color: var(--color-dark);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

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

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

/* Utilities */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* Announcement Bar */
.top-bar {
    background: var(--color-primary);
    color: #fff;
    font-size: 12px;
    padding: 7px 0;
    text-align: center;
    font-weight: 500;
}

/* Header */
.main-header {
    background: rgba(250, 247, 242, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 24px;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.logo-badge {
    background: var(--color-cream-100);
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-icon {
    background: #fff;
    border: 1px solid var(--color-border);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: var(--color-dark);
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.badge-count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero-slider {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    margin: 24px auto;
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.slide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 440px;
    align-items: center;
}

.slide-content {
    padding: 50px 60px;
}

.slide-tag {
    display: inline-block;
    background: var(--color-primary-50);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
    border: 1px solid rgba(61,98,69,0.15);
}

.slide-title {
    font-size: 34px;
    font-weight: 900;
    color: var(--color-dark);
    line-height: 1.35;
    margin-bottom: 16px;
}

.slide-desc {
    color: var(--color-muted);
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.8;
}

.slide-image {
    height: 100%;
    min-height: 440px;
    background: linear-gradient(135deg, var(--color-cream-100), #E5DCD0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 14px rgba(61,98,69,0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-dark);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* Grid & Cards */
.section-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 6px;
}

.section-subtitle {
    color: var(--color-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    margin-bottom: 50px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--color-cream-100);
    overflow: hidden;
}

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

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

.card-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.badge-handmade {
    background: rgba(61,98,69,0.9);
    color: #fff;
    backdrop-filter: blur(4px);
}

.badge-city {
    background: rgba(255,255,255,0.92);
    color: var(--color-dark);
    border: 1px solid var(--color-border);
}

.badge-discount {
    background: var(--color-error);
    color: #fff;
}

.card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.5;
    margin-bottom: 8px;
    color: var(--color-dark);
}

.card-craft {
    color: var(--color-muted);
    font-size: 12px;
    margin-bottom: 12px;
}

.card-price-row {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px dashed var(--color-border);
}

.price-box {
    display: flex;
    flex-direction: column;
}

.old-price {
    font-size: 12px;
    color: var(--color-muted);
    text-decoration: line-through;
}

.current-price {
    font-size: 17px;
    font-weight: 900;
    color: var(--color-primary);
}

/* Cart Drawer */
.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
}

.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: #fff;
    z-index: 210;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-cream);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    border: 1px solid var(--color-border);
}

/* Form inputs */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--color-dark);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--color-primary);
}

/* Footer */
.main-footer {
    background: #fff;
    border-top: 1px solid var(--color-border);
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--color-dark);
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    color: var(--color-muted);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-muted);
}

/* -------------------------------------------------------------------------- */
/* Header Search Bar */
/* -------------------------------------------------------------------------- */
.header-search {
    position: relative;
    max-width: 380px;
    width: 100%;
}
.header-search-input {
    width: 100%;
    padding: 10px 42px 10px 18px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 13px;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}
.header-search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(61,98,69,0.12);
}
.header-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--color-muted);
}

/* -------------------------------------------------------------------------- */
/* Hero Slider (Carousel) */
/* -------------------------------------------------------------------------- */
.hero-slider-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    box-shadow: var(--shadow-md);
    background: var(--color-dark);
}
.hero-slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}
.hero-slide {
    min-width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    min-height: 380px;
    position: relative;
    background-size: cover;
    background-position: center;
}
.hero-slide-content {
    padding: 50px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
    background: linear-gradient(90deg, rgba(26,36,29,0.92) 0%, rgba(26,36,29,0.7) 100%);
    color: #fff;
}
.hero-slide-title {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 12px;
    color: #fff;
}
.hero-slide-subtitle {
    font-size: 15px;
    color: #E5E7EB;
    margin-bottom: 24px;
    line-height: 1.7;
}
.hero-slide-img-box {
    position: relative;
    overflow: hidden;
}
.hero-slide-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
    font-size: 18px;
    color: var(--color-dark);
}
.slider-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
}
.slider-arrow-prev { right: 16px; }
.slider-arrow-next { left: 16px; }
.slider-dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.3s;
}
.slider-dot.active {
    width: 24px;
    border-radius: 12px;
    background: var(--color-gold);
}

/* -------------------------------------------------------------------------- */
/* Circular Category Stories (اسکرول افقی دایره‌ای شیک) */
/* -------------------------------------------------------------------------- */
.category-stories-wrapper {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 16px 6px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}
.category-stories-wrapper::-webkit-scrollbar {
    display: none;
}
.category-story-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 84px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}
.category-story-item:hover {
    transform: translateY(-4px);
}
.category-story-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-primary) 100%);
    box-shadow: 0 4px 10px rgba(61,98,69,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.category-story-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.category-story-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.category-story-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--color-dark);
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* -------------------------------------------------------------------------- */
/* Mobile Bottom Navigation Bar */
/* -------------------------------------------------------------------------- */
.mobile-bottom-nav {
    display: none;
}

/* -------------------------------------------------------------------------- */
/* Responsive Layout */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    .main-header {
        padding: 10px 0;
    }
    .nav-links { display: none !important; }
    .header-actions .btn { display: none; }
    .header-search { max-width: 100%; margin: 8px 0 0; }
    .header-row-mobile {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .hero-slide {
        grid-template-columns: 1fr;
        min-height: 280px;
    }
    .hero-slide-img-box {
        display: none;
    }
    .hero-slide-content {
        padding: 36px 22px;
    }
    .hero-slide-title {
        font-size: 20px;
    }
    .hero-slide-subtitle {
        font-size: 13px;
        margin-bottom: 18px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* 2 Columns on Mobile */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .product-card {
        border-radius: 16px !important;
    }
    .product-image-box {
        height: 140px !important;
    }
    .product-info {
        padding: 12px 10px !important;
    }
    .product-title {
        font-size: 12px !important;
        height: 34px !important;
        line-height: 1.4 !important;
        margin-bottom: 6px !important;
    }
    .current-price {
        font-size: 13px !important;
    }
    .old-price {
        font-size: 11px !important;
    }
    .product-card .btn {
        padding: 7px 10px !important;
        font-size: 11px !important;
    }

    /* Fixed Mobile Bottom Bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--color-border);
        z-index: 990;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-size: 10px;
        font-weight: 800;
        color: var(--color-muted);
        text-decoration: none;
        position: relative;
        padding: 4px 8px;
    }
    .bottom-nav-item.active {
        color: var(--color-primary);
    }
    .bottom-nav-icon {
        font-size: 20px;
        line-height: 1;
    }
    .bottom-nav-badge {
        position: absolute;
        top: 2px;
        right: 6px;
        background: var(--color-error);
        color: #fff;
        font-size: 9px;
        padding: 1px 5px;
        border-radius: 10px;
        font-weight: 800;
        min-width: 15px;
        text-align: center;
    }
}
