﻿/* ==========================================
   ОНЛАЙН ДЭЛГҮҮР - ҮНДСЭН CSS
   Orчин үеийн, mobile-first загвар
   ========================================== */

:root {
    --primary-black: #2d5016;
    --soft-white: #fafafa;
    --accent-green: #2d5016;
    --accent-yellow: #f4d03f;
    --gray-light: #e8e8e8;
    --gray-mid: #666;
    --gray-dark: #333;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--soft-white);
    color: var(--primary-black);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 70px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 2px;
    color: var(--primary-black);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}

.logo:hover {
    color: var(--accent-green);
}

.header-search {
    flex: 1;
    max-width: 500px;
    display: none;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 11px 45px 11px 18px;
    border: 1px solid var(--gray-light);
    border-radius: 30px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--soft-white);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.08);
    background: white;
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-green);
    border: none;
    padding: 8px;
    cursor: pointer;
    color: white;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-black);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    color: var(--primary-black);
    text-decoration: none;
    transition: var(--transition);
    border-radius: 50%;
}

.header-btn:hover {
    background: var(--gray-light);
    color: var(--accent-green);
}

.header-btn:active {
    transform: scale(0.95);
}

.header-btn-text {
    display: none;
    font-size: 14px;
    font-weight: 500;
}

.icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-sm {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--accent-yellow);
    color: var(--primary-black);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 30px;
    transition: var(--transition);
}

.user-profile:hover {
    background: var(--gray-light);
}

.user-avatar,
.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    background: var(--accent-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px 0;
    display: none;
    animation: fadeIn 0.2s ease;
}

.user-dropdown.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--primary-black);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--gray-light);
}

.dropdown-item.text-danger {
    color: #dc3545;
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-light);
    margin: 8px 0;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--primary-black);
    transition: var(--transition);
}

/* ========== HERO ========== */
.hero {
    margin-top: 65px;
    padding: 50px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-green) 0%, #1a3009 100%);
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: var(--accent-yellow);
    opacity: 0.12;
    border-radius: 50%;
    top: -180px;
    right: -120px;
    animation: float 8s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -100px;
    left: -80px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-30px, 30px) rotate(180deg);
    }
}

.hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px;
    letter-spacing: 4px;
    margin-bottom: 14px;
    position: relative;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero p {
    font-size: 16px;
    opacity: 0.95;
    position: relative;
    font-weight: 300;
    letter-spacing: 0.5px;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-cta {
    margin-top: 24px;
    position: relative;
    animation: fadeInUp 0.6s ease 0.6s both;
}

.hero-btn {
    display: inline-block;
    background: var(--accent-yellow);
    color: var(--primary-black);
    padding: 14px 32px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(244, 208, 63, 0.4);
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 208, 63, 0.6);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== CATEGORIES ========== */
.categories {
    padding: 16px 0;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 64px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px;
    align-items: flex-start;
}

.category-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-main-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-main {
    background: white;
    border: 1.5px solid var(--gray-light);
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--gray-dark);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.category-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.category-name {
    white-space: nowrap;
}

.category-main:hover {
    background: var(--gray-light);
    border-color: var(--gray-mid);
    transform: translateY(-1px);
}

.category-main.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.3);
}

.category-toggle {
    background: white;
    border: 1.5px solid var(--gray-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.category-toggle:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.category-toggle svg {
    transition: transform 0.3s ease;
}

.category-group.active .category-toggle svg {
    transform: rotate(180deg);
}

.category-children {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 32px;
}

.category-children.show {
    display: flex;
    animation: slideDownCat 0.3s ease;
}

@keyframes slideDownCat {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-child {
    background: white;
    border: 1.5px solid var(--gray-light);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--gray-dark);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.category-child:hover {
    background: var(--gray-light);
    border-color: var(--gray-mid);
}

.category-child.active {
    background: rgba(45, 80, 22, 0.1);
    border-color: var(--accent-green);
    color: var(--accent-green);
    font-weight: 600;
}

@media (max-width: 768px) {
    .categories-grid {
        gap: 6px;
        padding: 0 16px;
    }
    
    .category-main {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .category-toggle {
        width: 28px;
        height: 28px;
    }
    
    .category-child {
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        gap: 5px;
        padding: 0 12px;
    }
    
    .category-main {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .category-toggle {
        width: 26px;
        height: 26px;
    }
}

/* ========== SECTIONS ========== */
.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 32px;
    letter-spacing: 1px;
    margin-bottom: 24px;
    color: var(--primary-black);
}

.featured-section,
.products-section {
    padding: 40px 0;
}

/* ========== PRODUCTS GRID ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    animation: fadeInScale 0.5s ease both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

.product-card:active {
    transform: scale(0.97);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-yellow);
    color: var(--primary-black);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(244, 208, 63, 0.4);
    letter-spacing: 0.3px;
}

.product-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: none;
}

.product-wishlist:active {
    transform: scale(0.9);
}

.product-wishlist.active {
    background: #ff4757;
    color: white;
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.05) 100%);
}

.product-placeholder {
    font-size: 56px;
    opacity: 0.5;
}

.product-info {
    padding: 14px;
}

.product-category {
    font-size: 10px;
    color: var(--gray-mid);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    font-weight: 600;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
    color: var(--primary-black);
}

.product-rating {
    font-size: 11px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-stars {
    color: #fbbf24;
    letter-spacing: 1px;
}

.rating-count {
    color: var(--gray-mid);
    font-size: 11px;
    margin-left: 2px;
}

.product-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.product-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--accent-green);
}

.product-price-old {
    font-size: 13px;
    color: var(--gray-mid);
    text-decoration: line-through;
}

.product-discount {
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--primary-black);
    color: white;
    border: none;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.add-to-cart-btn:hover {
    background: var(--accent-green);
}

.add-to-cart-btn:active {
    transform: scale(0.96);
}

.add-to-cart-btn svg {
    width: 16px;
    height: 16px;
}

/* No Products */
.no-products {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-mid);
}

.no-products-icon {
    font-size: 72px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ========== CART MODAL ========== */
.cart-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-end;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.cart-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cart-content {
    background: white;
    width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    animation: slideUp 0.4s ease;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-light);
}

.cart-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 1px;
}

.close-cart {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-mid);
}

.cart-items {
    margin-bottom: 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-light);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
}

.cart-item-price {
    color: var(--accent-green);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--gray-light);
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--primary-black);
    color: white;
    border-color: var(--primary-black);
}

.qty-btn:active {
    transform: scale(0.9);
}

.cart-total {
    padding: 24px 0 0;
    border-top: 2px solid var(--primary-black);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

.checkout-btn {
    width: 100%;
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 18px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: block;
    text-align: center;
}

.checkout-btn:hover {
    background: var(--primary-black);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-mid);
}

.empty-cart-icon {
    font-size: 72px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--primary-black);
    color: white;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.footer-heading {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-text {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.8;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-link:hover {
    background: white;
    color: var(--primary-black);
    border-color: white;
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-contact {
    list-style: none;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 14px;
    opacity: 0.8;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    opacity: 0.7;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a {
    color: white;
    text-decoration: none;
}

.footer-bottom-links a:hover {
    text-decoration: underline;
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
    animation: slideUpNav 0.5s ease;
}

@keyframes slideUpNav {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    padding: 8px 16px;
    color: var(--gray-mid);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    border-radius: 12px;
    min-width: 64px;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent-green);
    border-radius: 0 0 3px 3px;
    transition: var(--transition);
}

.nav-item.active::before {
    width: 32px;
}

.nav-item:active {
    transform: scale(0.95);
    background: var(--gray-light);
}

.nav-item.active {
    color: var(--accent-green);
}

.nav-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
}

.nav-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* ========== FLASH MESSAGE ========== */
.flash-message {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.4s ease;
    max-width: 90%;
}

.flash-success {
    background: var(--accent-green);
    color: white;
}

.flash-error {
    background: #dc3545;
    color: white;
}

.flash-info {
    background: #0dcaf0;
    color: white;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ========== RESPONSIVE ========== */

/* Tablet болон том утас */
@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .hero h1 {
        font-size: 56px;
    }
    
    .categories-scroll {
        padding: 0 40px 12px;
    }
}

/* Desktop */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
    
    .header-content {
        padding: 16px 40px;
    }
    
    .header-search {
        display: block;
    }
    
    .header-btn-text {
        display: inline;
    }
    
    .header-btn {
        padding: 10px 14px;
        border-radius: 30px;
    }
    
    .user-name {
        display: block;
    }
    
    .hero {
        margin-top: 70px;
        padding: 80px 40px;
        min-height: 350px;
    }
    
    .hero h1 {
        font-size: 72px;
        letter-spacing: 6px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    
    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }
    
    .product-card:active {
        transform: translateY(-4px);
    }
    
    .cart-content {
        max-width: 520px;
        margin: 0 auto;
        border-radius: 20px;
    }
    
    .cart-modal {
        align-items: center;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .section-title {
        font-size: 42px;
    }
}

/* Large Desktop */
@media (min-width: 1024px) {
    .hero h1 {
        font-size: 84px;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px;
    }
    
    .container {
        padding: 0 40px;
    }
}

/* Extra Large */
@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Mobile landscape */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: 200px;
        padding: 30px 20px;
    }
    
    .hero h1 {
        font-size: 36px;
    }
}

/* Small mobile */
@media (max-width: 374px) {
    .logo {
        font-size: 22px;
    }
    
    .hero h1 {
        font-size: 38px;
    }
    
    .products-grid {
        gap: 12px;
    }
    
    .product-info {
        padding: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --soft-white: #1a1a1a;
        --primary-black: #f5f5f5;
        --gray-light: #2a2a2a;
        --gray-mid: #999;
    }
    
    body {
        background: #0f0f0f;
    }
    
    .header {
        background: rgba(26, 26, 26, 0.98);
    }
    
    .product-card,
    .cart-content,
    .bottom-nav,
    .categories {
        background: #1a1a1a;
    }
    
    .search-input {
        background: #2a2a2a;
        color: white;
    }
}

/* Print styles */
@media print {
    .header,
    .bottom-nav,
    .categories,
    .hero,
    .add-to-cart-btn {
        display: none;
    }
    
    .product-card {
        break-inside: avoid;
    }
}

/* ========== UTILITIES ========== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

