@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

:root {
    --primary-color: #00A651; /* Vibrant VkusVill-like Green */
    --primary-hover: #008a43;
    --primary-light: #e6f6ec;
    --text-color: #1a1a1a;
    --text-muted: #757575;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-color: #eaeaea;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Header */
header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo svg {
    width: 32px;
    height: 32px;
    fill: var(--primary-color);
}

.search-bar {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background-color: var(--white);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-bar svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
}

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

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

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

.cart-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
    text-decoration: none;
}

.cart-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.4);
}

.cart-count {
    background-color: var(--white);
    color: var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}

/* Main Layout */
.main-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
}

.main-container.full-width {
    grid-template-columns: 1fr;
}

.content {
    min-width: 0;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-color);
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 600;
    font-size: 15px;
    background-color: transparent;
}

.category-list li a:hover {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
}

.category-list li a.active {
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.category-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    font-size: 14px;
}

.category-list li a.active .category-icon {
    background-color: var(--primary-light);
}

/* Hero Banner */
.hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #e6f6ec 0%, #f4fdf7 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px 60px;
    box-shadow: var(--shadow-md);
}

.hero-content {
    max-width: 50%;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background-color: #ff4757;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-color);
}

.hero p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.hero-btn {
    background-color: var(--text-color);
    color: var(--white);
    padding: 14px 30px;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
}

.hero-btn:hover {
    background-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.hero-image {
    position: absolute;
    right: -50px;
    bottom: -20px;
    width: 500px;
    height: auto;
    z-index: 1;
    pointer-events: none;
}

/* Products Section */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.products-header h2 {
    font-size: 28px;
    font-weight: 800;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

/* Product Card - Premium */
.product-card {
    background-color: transparent;
    padding: 0;
    box-shadow: none;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    border: none;
    gap: 8px;
}

.product-card:hover {
    transform: none;
    box-shadow: none;
    border: none;
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1;
    background-color: transparent;
    padding: 0;
    border-radius: 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.product-rating {
    position: absolute;
    bottom: -10px;
    left: 10px;
    background: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    color: #ff6b00;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.product-price-badge {
    display: inline-block;
    background: #f4f5f7;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 16px;
    align-self: flex-start;
    color: #000;
}

.product-title {
    font-size: 15px;
    font-weight: 400;
    color: #000;
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-weight {
    color: #888;
    font-size: 15px;
    font-weight: 400;
}

.add-to-cart {
    width: 100%;
    background-color: #1fa049;
    color: var(--white);
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
}

.add-to-cart:hover {
    background-color: #19883d;
    transform: none;
}

.add-to-cart svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 220px 1fr;
        gap: 30px;
    }
    .hero {
        padding: 30px 40px;
    }
    .hero h1 {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .search-bar {
        display: none;
    }
    .hero-image {
        display: none;
    }
    .hero-content {
        max-width: 100%;
    }
}

.loader {
    text-align: center;
    font-size: 20px;
    color: var(--primary-color);
    padding: 100px 0;
    font-weight: 600;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-weight: 800;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    outline: none;
    margin-bottom: 15px;
    transition: var(--transition);
}

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

/* Checkout Layout */
.checkout-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.cart-items {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.checkout-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 100px;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 800;
    margin: 20px 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

/* --- SKELETON LOADING --- */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton-box {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f4f5f7 4%, #e6e8eb 25%, #f4f5f7 36%);
    background-size: 1000px 100%;
}

.skeleton-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.skeleton-img {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-price {
    height: 24px;
    width: 50%;
    border-radius: 4px;
    margin-bottom: 15px;
}

.skeleton-btn {
    height: 40px;
    width: 100%;
    border-radius: var(--radius-md);
}

.skeleton-story {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: var(--primary-color);
}

.toast.error .toast-icon {
    background: #ff4757;
}

.toast.info .toast-icon {
    background: #0088cc;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    color: #111;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #666;
}

.toast-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}


.toast-close:hover {
    color: #333;
}

/* Product Modal Styles */
.pm-size-radio:checked + .pm-size-label {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: var(--primary-color);
}
.pm-topping-checkbox:checked + span {
    color: var(--primary-color);
}
.pm-topping-label:has(input:checked) {
    border-color: var(--primary-color);
    background: #f4fdf8;
}

/* Search Autocomplete Dropdown */
.search-bar {
    position: relative;
}
#search-results-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.06);
    padding: 6px 0;
}
#search-results-dropdown.hidden {
    display: none;
}
.search-suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}
.search-suggest-item:hover {
    background: #f5fbf7;
}
.search-suggest-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    background: #f8f9fa;
    flex-shrink: 0;
}
.search-suggest-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.search-suggest-name {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-suggest-price {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 1px;
}
.search-suggest-no-results {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Flying item animation */
.flying-item {
    position: fixed;
    z-index: 9999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    pointer-events: none;
    transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Cart bounce keyframes */
.cart-bump {
    animation: cart-bump-keyframes 0.4s ease-out;
}
@keyframes cart-bump-keyframes {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) translateY(-4px); }
    100% { transform: scale(1); }
}

@keyframes blink-keyframes {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}

.typing-dot {
    animation: blink-keyframes 1.4s infinite both;
}

/* Big Category Cards */
#dynamic-subcategory-chips {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 16px !important;
    padding-bottom: 20px;
    overflow-x: visible !important;
    margin-bottom: 40px !important;
}

.category-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 166, 81, 0.3);
}

.category-card.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.category-card .category-img {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 12px;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-card:hover .category-img {
    transform: scale(1.15) rotate(8deg);
}

.category-card .category-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    transition: color 0.3s;
}

.category-card:hover .category-title {
    color: var(--primary-color);
}

/* Fix for recommendations slider cards */
#dynamic-recommendations-slider .product-card {
    min-width: 160px !important;
    max-width: 160px !important;
    flex-shrink: 0 !important;
}

/* Fix for history slider cards */
#history-slider .product-card {
    min-width: 160px !important;
    max-width: 160px !important;
    flex-shrink: 0 !important;
}
