:root {
    --primary: #c27e55;
    --primary-dark: #b46a3e;
    --primary-light: #9b5a38;
    --dark-bg: #1e1e2a;
    --light-bg: #faf9f8;
    --border-light: #ebebeb;
    --white: #ffffff;
    --black: #000000;
    --text-dark: #1e1e2a;
    --text-light: #2c2b2b;
    --text-muted: #5a5a6e;
    --text-gray: #888888;
    --text-gray-light: #999999;
    --text-white: #ffffff;
    --gray-dark: #2c2b2b;
    --gray-light: #555555;
    --gray-lighter: #666666;
    --gray-border: #eeeeee;
    --gray-border-light: #ddd;
    --gray-bg: #f5f5f5;
    --gray-bg-light: #faf9f8;
    --gray-bg-dark: #f0edea;
    --beige-light: #f0eae4;
    --beige-bg: #fff8f3;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --danger: #e91e63;
    --danger-dark: #c2185b;
    --shadow-sm: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 28px 35px -15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --border-radius-sm: 12px;
    --border-radius-md: 16px;
    --border-radius-lg: 28px;
    --border-radius-xl: 40px;
    --border-radius-circle: 50%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', 'Vazir', 'Tahoma', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    scroll-behavior: smooth;
    padding-bottom: 75px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

.text-center {
    text-align: center;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mb-40 {
    margin-bottom: 40px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-10 {
    margin-top: 10px;
}

.py-20 {
    padding-top: 20px;
    padding-bottom: 20px;
}

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 99;
    backdrop-filter: blur(2px);
    background-color: rgba(255, 255, 255, 0.96);
}

/* استایل‌های لوگو */
.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform var(--transition-normal);
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
    border-radius: 30%;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0px;
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: var(--gray-dark);
}

.nav-links a:hover {
    color: var(--primary);
}

.header-icons {
    display: flex;
    gap: 18px;
    font-size: 1.25rem;
}

.header-icons i {
    cursor: pointer;
    transition: var(--transition-fast);
}

.cart-badge {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: var(--text-white);
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== اسکرول افقی بدون اسکرول بار ========== */
.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    user-select: none;
}

.scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    cursor: grab;
}

.scroll-container:active {
    cursor: grabbing;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-wrapper {
    display: inline-flex;
    gap: 20px;
    padding: 10px 5px 20px 5px;
}

.carousel-arrows {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    pointer-events: none;
    z-index: 10;
}

.carousel-arrow {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius-circle);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--gray-dark);
    font-size: 1.3rem;
    box-shadow: var(--shadow-lg);
}

.carousel-arrow:hover {
    background: var(--primary);
    color: var(--text-white);
    transform: scale(1.08);
}

/* مخفی کردن اسکرول‌بار */
.scroll-container {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    scroll-behavior: smooth;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-container.dragging {
    cursor: grabbing;
    user-select: none;
}

/* جستجو */
.search-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: var(--transition-fast);
}

.search-overlay.active {
    visibility: visible;
    opacity: 1;
}

.search-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: var(--white);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 1001;
}

.search-overlay.active .search-sidebar {
    transform: translateX(0);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--beige-light);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-xl);
    font-size: 1rem;
    font-family: inherit;
    background: var(--gray-bg-light);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}

.search-btn {
    background: var(--primary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-circle);
    color: var(--text-white);
    cursor: pointer;
    font-size: 1.2rem;
}

.search-results {
    flex: 1;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--gray-border);
    cursor: pointer;
    border-radius: var(--border-radius-md);
}

.search-result-item:hover {
    background: var(--gray-bg-light);
}

.search-result-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.search-result-price {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
}

.toast-msg {
    position: fixed;
    bottom: 90px;
    left: 20px;
    background: var(--dark-bg);
    color: var(--text-white);
    padding: 10px 20px;
    border-radius: var(--border-radius-xl);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast);
    font-size: 0.9rem;
    pointer-events: none;
}

.toast-msg.show {
    opacity: 1;
    visibility: visible;
}

footer {
    background: var(--dark-bg);
    color: #cfcfdf;
    padding: 48px 0 25px;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    margin-top: 60px;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 12px 20px 20px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 200;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
}

.nav-item i {
    font-size: 1.55rem;
}

.nav-item.active {
    color: var(--primary-dark);
}

.cart-count-mobile {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--primary);
    color: var(--text-white);
    border-radius: var(--border-radius-circle);
    width: 18px;
    height: 18px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .primary-navigation {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .primary-navigation {
        display: block;
    }
}

/* سبد خرید */
.cart-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: var(--transition-fast);
}

.cart-overlay.active {
    visibility: visible;
    opacity: 1;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: var(--white);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 1001;
}

.cart-overlay.active .cart-sidebar {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--beige-light);
    padding-bottom: 16px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin: 20px 0;
}

.cart-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray-border);
    padding-bottom: 12px;
}

.cart-item-img {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
}

.cart-total {
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--gray-border-light);
    padding-top: 16px;
}

.checkout-btn {
    background: var(--dark-bg);
    width: 100%;
    padding: 14px;
    border-radius: var(--border-radius-xl);
    color: var(--text-white);
    font-weight: bold;
    margin-top: 18px;
    border: none;
    cursor: pointer;
}

/* ========== کانتینر پیام‌ها ========== */
.messages-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 480px;
    width: calc(100% - 40px);
    pointer-events: none;
}

/* ========== پیام ========== */
.toast-message {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: toastSlideDown 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
}

@keyframes toastSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== آیکون ========== */
.toast-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
    color: #fff;
}

/* ========== متن ========== */
.toast-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
    color: #2d2d2d;
    direction: rtl;
}

/* ========== دکمه بستن ========== */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ========== نوار پیشرفت ========== */
.toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    width: 100%;
    animation: toastProgress 6s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ========== حالت موفق ========== */
.toast-success {
    background: linear-gradient(135deg, #fff9f0 0%, #fff5f8 100%);
    border: 1px solid rgba(233, 30, 99, 0.15);
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #e91e63 0%, #ff6090 100%);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

.toast-success .toast-progress {
    background: linear-gradient(90deg, #e91e63, #ff6090);
}

/* ========== حالت خطا ========== */
.toast-error {
    background: #fff5f5;
    border: 1px solid rgba(198, 40, 40, 0.15);
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #c62828, #e53935);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
}

.toast-error .toast-progress {
    background: linear-gradient(90deg, #c62828, #e53935);
}

/* ========== حالت هشدار ========== */
.toast-warning {
    background: #fffbf0;
    border: 1px solid rgba(245, 124, 0, 0.15);
}

.toast-warning .toast-icon {
    background: linear-gradient(135deg, #f57c00, #ff9800);
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.4);
}

.toast-warning .toast-progress {
    background: linear-gradient(90deg, #f57c00, #ff9800);
}

/* ========== حالت اطلاعات ========== */
.toast-info {
    background: #f0f8ff;
    border: 1px solid rgba(33, 150, 243, 0.15);
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.toast-info .toast-progress {
    background: linear-gradient(90deg, #2196f3, #42a5f5);
}

/* ========== انیمیشن حذف ========== */
.toast-message.removing {
    animation: toastSlideUp 0.4s ease forwards;
}

@keyframes toastSlideUp {
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
}

/* ========== موبایل ========== */
@media (max-width: 480px) {
    .messages-container {
        top: 10px;
        width: calc(100% - 20px);
    }
    .toast-message {
        padding: 14px 16px;
        gap: 10px;
        border-radius: 14px;
    }
    .toast-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
    .toast-text {
        font-size: 13px;
    }
}