/* فونت‌های فارسی - Vazir */
@font-face {
    font-family: 'Vazir';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* پالت رنگی فردوس */
:root {
    --primary-cream: #F5F5DC;         /* کرم روشن/استخوانی - 60% */
    --primary-olive: #556B2F;         /* سبز زیتونی تیره - 30% */
    --accent-gold: #DAA520;           /* طلایی - 10% */
    --accent-orange: #CD5C5C;         /* آجری/نارنجی پخته */
    --text-dark: #2C3E50;             /* متن تیره */
    --text-light: #7F8C8D;            /* متن روشن */
    --bg-white: #FFFFFF;
    --border-color: #E0DED5;
    --shadow: rgba(85, 107, 47, 0.1);
}

/* تنظیمات عمومی */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--primary-cream);
    color: var(--text-dark);
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

/* تایپوگرافی */
h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    color: var(--primary-olive);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-olive);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-gold);
}

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

/* Header */
.header {
    background-color: var(--primary-olive);
    padding: 1rem 0;
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--primary-cream);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background-color: rgba(245, 245, 220, 0.1);
}

.header-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--primary-cream);
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    color: var(--accent-gold);
}

.badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background-color: var(--accent-orange);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-cream);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: 'Vazir', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-orange);
    color: white;
}

.btn-primary:hover {
    background-color: #B84A4A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(205, 92, 92, 0.3);
}

.btn-secondary {
    background-color: var(--primary-olive);
    color: var(--primary-cream);
}

.btn-secondary:hover {
    background-color: #4A5E28;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-olive);
    color: var(--primary-olive);
}

.btn-outline:hover {
    background-color: var(--primary-olive);
    color: var(--primary-cream);
}

/* Cards */
.card {
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(85, 107, 47, 0.15);
}

.card-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-olive);
    margin-bottom: 0.5rem;
}

.card-text {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Footer */
.footer {
    background-color: var(--primary-olive);
    color: var(--primary-cream);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--primary-cream);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(245, 245, 220, 0.2);
    font-size: 0.9rem;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background-color: var(--primary-olive);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 10px var(--shadow);
    }

    .nav-menu.active {
        display: flex;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* Desktop - Reset Mobile Menu Styles */
@media (min-width: 769px) {
    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    #mobileNav {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        overflow: visible !important;
        right: auto !important;
        max-height: none !important;
        opacity: 1 !important;
    }
    
    #mobileNav #navMenu,
    #mobileNav .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        gap: 2rem !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }
    
    #mobileNav #navMenu li,
    #mobileNav .nav-menu li {
        border: none !important;
        display: inline-block !important;
        width: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #mobileNav #navMenu li a,
    #mobileNav .nav-menu li a {
        color: #F5F5DC !important;
        background: transparent !important;
        padding: 0.5rem 1rem !important;
        width: auto !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
        border: none !important;
        text-align: center !important;
        display: inline-block !important;
    }
    
    #mobileNav #navMenu li a:hover,
    #mobileNav .nav-menu li a:hover {
        background: rgba(245, 245, 220, 0.1) !important;
        border: none !important;
        color: #DAA520 !important;
    }
    
    .logo-container {
        flex: none !important;
        justify-content: center !important;
    }
    
    .logo {
        height: 60px !important;
        max-height: none !important;
    }
    
    .header-icons {
        display: flex !important;
        gap: 1.5rem;
        align-items: center;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .menu-overlay {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

/* ===================================
   MOBILE APP-LIKE EXPERIENCE
   =================================== */

/* Bottom Navigation (Mobile Only) */
.bottom-nav {
    display: none; /* Hidden by default, shown on mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.5rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0.5rem); /* For iPhone notch */
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.7rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.bottom-nav-item span {
    font-weight: 500;
}

.bottom-nav-item.active {
    color: var(--primary-olive);
}

.bottom-nav-item.active i {
    transform: scale(1.15);
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-cart {
    position: relative;
}

.bottom-nav-badge {
    position: absolute;
    top: -5px;
    left: -8px;
    background: var(--accent-orange);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 0.15rem 0.35rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Mobile-First: Show Bottom Nav on Mobile */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    /* Add padding to body to prevent content being hidden by bottom nav */
    body {
        padding-bottom: 70px;
    }
    
    /* Hide footer on mobile to save space */
    .footer {
        display: none;
    }
    
    /* Compact Header for Mobile */
    .header {
        padding: 0.75rem 0;
    }
    
    .header .container {
        position: relative !important; /* برای dropdown */
    }
    
    .header-content {
        padding: 0 1rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Menu Toggle - مخفی در موبایل */
    .menu-toggle {
        display: none !important;
    }
    
    /* Logo - وسط و بزرگ */
    .logo-container {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .logo {
        height: 70px;
        width: auto;
        max-width: 100%;
    }
    
    /* Header Icons - مخفی در موبایل */
    .header-icons {
        display: none !important;
    }
    
    /* Mobile Navigation - کاملاً مخفی در موبایل */
    #mobileNav {
        display: none !important;
    }
    
    /* Overlay for mobile menu - Not needed */
    .menu-overlay {
        display: none !important;
    }
    
    /* Compact header icons */
    .icon-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .badge {
        font-size: 0.65rem;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
    }
    
    /* Mobile App Container */
    .container {
        padding: 0 1rem;
    }
    
    /* Optimized Spacing for Mobile */
    main {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Mobile-Optimized Touch Targets */
@media (max-width: 768px) {
    /* Ensure all buttons are easily tappable (min 44x44px) */
    button,
    .btn,
    a.btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Larger tap targets for product cards */
    .product-card-modern {
        margin-bottom: 1rem;
    }
    
    /* Better spacing for form elements */
    input,
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Pull-to-refresh feel */
    body {
        overscroll-behavior-y: contain;
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Remove tap highlight on mobile */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-touch-callout: none;
    }
    
    /* Keep links tappable */
    a,
    button {
        -webkit-touch-callout: default;
    }
}

/* Extra Small Devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    .bottom-nav-item {
        font-size: 0.65rem;
        padding: 0.4rem 0.25rem;
    }
    
    .bottom-nav-item i {
        font-size: 1.15rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* iPhone Notch & Safe Areas */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }
    
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}

/* Landscape Mode on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .bottom-nav {
        padding: 0.25rem 0;
    }
    
    .bottom-nav-item {
        padding: 0.35rem;
    }
    
    .bottom-nav-item i {
        font-size: 1.1rem;
        margin-bottom: 0.15rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.65rem;
    }
}

