/* ============================================
   DotSib - فروشگاه آنلاین نان و سبزی
   Main Stylesheet - Green Natural Theme
   ============================================ */

/* === Font Faces === */
@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/IranYekan.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/IranYekan.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/IranYekan.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

/* === CSS Variables === */
:root {
    --primary: #2D7A4F;
    --primary-light: #3D9B66;
    --primary-dark: #1E5C3A;
    --primary-glow: rgba(45, 122, 79, 0.3);
    --secondary: #D4A574;
    --secondary-light: #E8C9A8;
    --accent: #F5E6D0;
    --bg: #FAFAF5;
    --bg-card: #ffffff;
    --text: #1A1A2E;
    --text-light: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 30px var(--primary-glow);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 50px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === Global Reset === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'IRANYekan', sans-serif !important;
    font-size: calc(13px + 0.15vw);
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    padding-bottom: 80px;
}

body, h1, h2, h3, h4, h5, h6, p, span, div, a, button, input, select, textarea, label {
    font-family: 'IRANYekan', sans-serif !important;
}

/* === Typography === */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6,
.navbar-brand, .nav-link, .fw-bold, .display-1, .display-2, .display-3, .display-4 {
    font-family: 'IRANYekan', sans-serif !important;
}

h1, .h1 { font-weight: 800; font-size: calc(1.3rem + 0.8vw) !important; }
h2, .h2 { font-weight: 800; font-size: calc(1.2rem + 0.6vw) !important; }
h3, .h3 { font-weight: 600; font-size: calc(1.1rem + 0.4vw) !important; }
h4, .h4 { font-weight: 600; font-size: calc(1rem + 0.3vw) !important; }
h5, .h5 { font-weight: 600; font-size: calc(0.95rem + 0.15vw) !important; }
h6, .h6 { font-weight: 600; font-size: calc(0.85rem + 0.1vw) !important; }

/* === Primary Colors === */
.bg-primary-custom { background-color: var(--primary) !important; color: #fff !important; }
.text-primary-custom { color: var(--primary) !important; }
.bg-accent { background: var(--accent) !important; }

/* === Buttons === */
.btn {
    border-radius: var(--radius-sm) !important;
    padding: 10px 24px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: none;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    border: none !important;
    color: #fff !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
    box-shadow: var(--shadow-glow) !important;
}

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

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

.btn-secondary-custom {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light)) !important;
    color: var(--text) !important;
    border: none !important;
}

/* === Cards === */
.card {
    border: none !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--bg-card);
    overflow: hidden;
}

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

/* === Hero Section === */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: white;
    padding: calc(80px + 2vw) 0 120px;
    position: relative;
    overflow: hidden;
    min-height: auto;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    animation: heroFloat 8s ease-in-out infinite;
}

/* Pattern overlay */
.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
    pointer-events: none;
}

/* Wave Bottom */
.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1;
}

.hero-wave svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-wave .wave-1,
.hero-wave .wave-2,
.hero-wave .wave-3 {
    animation: waveMove 8s ease-in-out infinite;
}

.hero-wave .wave-2 {
    animation-delay: -2s;
}

.hero-wave .wave-3 {
    animation-delay: -4s;
}

@keyframes waveMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-20px); }
}

/* Floating Background Emojis */
.floating-bg-emojis {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-emoji {
    position: absolute;
    font-size: 2rem;
    opacity: 0.15;
    animation: floatBgEmoji 10s ease-in-out infinite;
    filter: blur(0.5px);
}

.bg-emoji:nth-child(1) { animation-delay: 0s; animation-duration: 12s; }
.bg-emoji:nth-child(2) { animation-delay: -2s; animation-duration: 15s; }
.bg-emoji:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.bg-emoji:nth-child(4) { animation-delay: -6s; animation-duration: 11s; }
.bg-emoji:nth-child(5) { animation-delay: -3s; animation-duration: 14s; }
.bg-emoji:nth-child(6) { animation-delay: -5s; animation-duration: 12s; }

@keyframes floatBgEmoji {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.15;
    }
    25% {
        transform: translateY(-20px) rotate(5deg) scale(1.1);
        opacity: 0.25;
    }
    50% {
        transform: translateY(-10px) rotate(-3deg) scale(0.95);
        opacity: 0.2;
    }
    75% {
        transform: translateY(-30px) rotate(8deg) scale(1.05);
        opacity: 0.25;
    }
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

/* Desktop Hero */
@media (min-width: 992px) {
    .hero-section {
        padding: 120px 0 140px;
        min-height: auto;
    }

    .hero-title {
        font-size: 3.5rem !important;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.25rem !important;
        max-width: 500px;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s var(--bounce);
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-title {
    font-size: calc(1.8rem + 1.5vw) !important;
    font-weight: 800;
    margin-bottom: 1.25rem;
    animation: slideInRight 0.8s var(--bounce);
    line-height: 1.3;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #e8f5e9 50%, #c8e6c9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: calc(0.9rem + 0.3vw);
    opacity: 0.9;
    margin-bottom: 1.5rem;
    animation: slideInRight 0.8s var(--bounce) 0.1s both;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s var(--bounce) 0.2s both;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.hero-features::-webkit-scrollbar { /* WebKit */
    display: none;
}

.hero-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: calc(0.6rem + 0.2vw);
    white-space: nowrap;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.15);
    transition: var(--transition);
    flex: 1;
}

.hero-feature:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* CTA Button */
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    color: var(--primary);
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: var(--transition);
    animation: fadeInUp 0.8s var(--bounce) 0.3s both;
    position: relative;
    z-index: 2;
    margin-bottom: 1rem;
}

.hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    color: var(--primary-dark);
}

.hero-cta i {
    animation: shake 2s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-10deg); }
    20% { transform: rotate(10deg); }
    30% { transform: rotate(-5deg); }
    40% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    animation: fadeInUp 0.8s var(--bounce) 0.4s both;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    display: block;
}

.hero-stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Orbit Animation Container - Desktop Only */
@media (max-width: 991.98px) {
    .orbit-container,
    .hero-visual {
        display: none !important;
    }
}

.orbit-container {
    position: relative;
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-center {
    position: relative;
    z-index: 10;
}

.center-emoji {
    font-size: 10rem;
    display: block;
    animation: centerFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
}

@keyframes centerFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg) scale(1); }
    50% { transform: translateY(-15px) rotate(5deg) scale(1.05); }
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: pulseRing 3s ease-out infinite;
    z-index: -1;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    animation: pulseRing 3s ease-out infinite 0.5s;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.ring-1 {
    width: 280px;
    height: 280px;
    animation: orbitRotate1 12s linear infinite;
}

.ring-2 {
    width: 320px;
    height: 320px;
    animation: orbitRotate2 18s linear infinite reverse;
}

@keyframes orbitRotate1 {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbitRotate2 {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(-360deg); }
}

.orbit-item {
    position: absolute;
    font-size: 2.5rem;
    animation: counterRotate 12s linear infinite;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

.ring-1 .orbit-item:nth-child(1) { top: -15px; left: 50%; transform: translateX(-50%); animation-delay: var(--delay); }
.ring-1 .orbit-item:nth-child(2) { bottom: 30%; right: -15px; animation-delay: var(--delay); }
.ring-1 .orbit-item:nth-child(3) { bottom: 30%; left: -15px; animation-delay: var(--delay); }

.ring-2 .orbit-item:nth-child(1) { top: 20%; left: -15px; animation-delay: var(--delay); }
.ring-2 .orbit-item:nth-child(2) { top: -15px; right: 30%; animation-delay: var(--delay); }
.ring-2 .orbit-item:nth-child(3) { bottom: -15px; left: 30%; animation-delay: var(--delay); }

@keyframes counterRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Category Navigation (Animated) === */
.category-explorer {
    padding: 2rem 15px;
    padding-right: 20px;
    padding-left: 20px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    transition: var(--transition);
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

@media (max-width: 500px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-glow);
}

.category-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(45,122,79,0.08), rgba(45,122,79,0.02));
}

.category-card .cat-icon {
    font-size: calc(2rem + 0.5vw);
    margin-bottom: 0.8rem;
    display: block;
    transition: var(--transition);
}

.category-card:hover .cat-icon {
    transform: scale(1.15) rotateY(10deg);
}

.category-card .cat-name {
    font-family: 'IRANYekan', sans-serif !important;
    font-weight: 600;
    font-size: calc(0.85rem + 0.1vw);
    color: var(--text);
}

/* Category slide animation */
.category-slide-enter {
    animation: slideInFromRight 0.5s var(--bounce) forwards;
}

.category-slide-exit {
    animation: slideOutToLeft 0.4s ease forwards;
}

.subcategory-enter {
    animation: fadeInUp 0.4s ease forwards;
}

.subcategory-enter:nth-child(1) { animation-delay: 0.05s; }
.subcategory-enter:nth-child(2) { animation-delay: 0.1s; }
.subcategory-enter:nth-child(3) { animation-delay: 0.15s; }
.subcategory-enter:nth-child(4) { animation-delay: 0.2s; }
.subcategory-enter:nth-child(5) { animation-delay: 0.25s; }
.subcategory-enter:nth-child(6) { animation-delay: 0.3s; }

/* === Product Cards === */
.product-card {
    border-radius: var(--radius) !important;
    overflow: hidden;
    transition: var(--transition);
    background: var(--bg-card);
    border: none !important;
    position: relative;
}

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

.product-card .product-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-card .product-body {
    padding: 1rem;
}

.product-card .product-name {
    font-family: 'IRANYekan', sans-serif !important;
    font-weight: 600;
    font-size: calc(0.85rem + 0.05vw);
    margin-bottom: 0.5rem;
    color: var(--text);
}

.product-card .product-price {
    font-weight: bold;
    color: var(--primary);
    font-size: calc(0.9rem + 0.1vw);
}

.product-card .add-to-cart-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
    margin-top: 0.5rem;
    cursor: pointer;
}

.product-card .add-to-cart-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: scale(1.02);
}

.product-card .add-to-cart-btn i {
    margin-left: 5px;
}

/* === Bottom Navigation (Premium) === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 5px 12px 5px;
    z-index: 1000;
    border-radius: 20px 20px 0 0;
}

.bottom-nav .nav-item {
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: #94a3b8;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav .nav-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.bottom-nav .nav-item.active .nav-icon-wrap {
    color: var(--primary);
    transform: translateY(-2px);
}

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

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

.bottom-nav .nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.bottom-nav .nav-item.active span {
    color: var(--primary-dark);
    font-weight: 700;
}

.bottom-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.bottom-nav .cart-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
    box-sizing: content-box;
    transition: all 0.3s ease;
}

.bottom-nav .nav-item.active .cart-badge {
    border-color: #fff;
}

@media (max-width: 767.98px) {
    .page-content {
        padding-bottom: 100px; /* Make space for floating nav */
    }
}

/* === Desktop Top Navigation (Premium Glassmorphism) === */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(45, 122, 79, 0.1);
    transition: var(--transition);
}

.top-navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
}

.top-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
    font-family: 'Vazirmatn', sans-serif !important;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary) !important;
    transition: var(--transition);
}

.top-navbar-brand:hover {
    transform: scale(1.02);
}

.top-navbar-brand .brand-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

.top-navbar-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-navbar-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    color: var(--text);
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.top-navbar-links a:hover,
.top-navbar-links a.active {
    color: var(--primary);
    background: rgba(45, 122, 79, 0.1);
}

.top-navbar-links a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.top-nav-login-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

.top-nav-login-btn:hover {
    box-shadow: var(--shadow-glow) !important;
    transform: translateY(-2px);
}

.top-nav-logout {
    background: transparent;
    border: none;
    color: var(--danger);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.top-nav-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.top-cart-badge {
    position: absolute;
    top: -5px;
    right: 5px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: bounceIn 0.5s var(--bounce);
}

/* === Breadcrumb (Category Trail) === */
.category-trail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.trail-item {
    background: var(--accent);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: calc(0.75rem + 0.05vw);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.trail-item:hover {
    background: var(--primary);
    color: #fff;
}

.trail-item.active {
    background: var(--primary);
    color: #fff;
}

.trail-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.custom-toast {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: slideDown 0.5s var(--bounce);
    border-right: 4px solid var(--success);
}

.custom-toast.error {
    border-right-color: var(--danger);
}

.custom-toast .toast-icon {
    font-size: 1.2rem;
}

.custom-toast .toast-message {
    flex: 1;
    font-size: calc(0.8rem + 0.05vw);
}

/* === Skeleton Loading === */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-img {
    height: 160px;
    width: 100%;
}

.skeleton-card {
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--bg-card);
}

/* === Auth Pages === */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 1rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.5s var(--bounce);
}

.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .auth-logo h2 {
    color: var(--primary);
    margin-top: 0.5rem;
}

.auth-card .form-control {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    border: 2px solid var(--border);
    transition: var(--transition);
    font-size: calc(0.9rem + 0.05vw);
    text-align: center;
    letter-spacing: 2px;
}

.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
}

.otp-inputs input {
    width: 50px;
    height: 55px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.otp-inputs input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    outline: none;
}

/* === Section Titles === */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to left, var(--primary), var(--primary-light));
    border-radius: 4px;
}

/* === Floating Elements === */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

.float-animation-delayed {
    animation: float 3s ease-in-out 1s infinite;
}

/* === Pull to Refresh Indicator === */
.pull-indicator {
    text-align: center;
    padding: 10px;
    color: var(--text-muted);
    transition: var(--transition);
    display: none;
}

.pull-indicator.active {
    display: block;
}

/* === Page Transitions === */
.page-content {
    animation: fadeIn 0.4s ease;
}

/* Desktop page content spacing with fixed navbar */
@media (min-width: 768px) {
    .page-content {
        padding-top: 0;
    }
}

/* Ensure content doesn't overlap with navbar on mobile */
body {
    padding-top: 0;
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 80px;
    }
}

/* === Checkout === */
.checkout-group {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.checkout-group .group-title {
    font-family: 'Vazirmatn', sans-serif !important;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.address-select {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.address-select:hover, .address-select.selected {
    border-color: var(--primary);
    background: rgba(45,122,79,0.05);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

/* === Badge === */
.badge-status {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: calc(0.7rem + 0.05vw);
    font-weight: 500;
}

/* === Install App Page === */
.install-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.install-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.2);
}

.install-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInFromRight {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutToLeft {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-60px); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-30px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* === Stagger animations for lists === */
.stagger-item { opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }

/* === Loading Spinner === */
.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* === Counter animation === */
.counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    font-weight: bold;
    animation: bounceIn 0.5s var(--bounce);
}

/* === Quantity Controls === */
.qty-control {
    display: inline-flex;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border);
}

.qty-control button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    color: var(--text);
}

.qty-control button:hover {
    background: var(--primary);
    color: #fff;
}

.qty-control span {
    padding: 0 12px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

/* === Responsive === */
@media (max-width: 768px) {
    body {
        font-size: calc(12px + 0.2vw);
    }

    .hero-section {
        padding: calc(40px + 2vw) 0 calc(30px + 1.5vw);
    }

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

    .category-card {
        padding: 1rem 0.5rem;
    }

    .category-card .cat-icon {
        font-size: calc(1.6rem + 0.3vw);
    }

    .product-card .product-img {
        height: 130px;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .otp-inputs input {
        width: 44px;
        height: 48px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .hero-title {
        font-size: calc(1.3rem + 0.5vw) !important;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

/* === Selection === */
::selection {
    background: var(--primary);
    color: white;
}

/* === PWA standalone mode === */
@media (display-mode: standalone) {
    .install-prompt {
        display: none !important;
    }
} 
 