/* style.css (Merged) */

html {
    scroll-behavior: smooth;
}

:root {
    --primary: #FF9800;
    --secondary: #FFF8E6;
    --background: #FFFFFF;
    --text: #333333;
    --light: #F5F5F5;
    --success: #4CAF50;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --overlay: rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --button-radius: 8px;

    /* === SETTINGS === */
    --header-height: 60px;
    --scroll-offset: 140px;
}

/* Add offset so header doesn't cover products */
.product-card,
section[id],
h2[id],
.product-category-section {
    scroll-margin-top: var(--scroll-offset);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background-color: var(--light);
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Helpers */
.hidden {
    display: none !important;
}

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

/* Header */
.header {
    background-color: var(--background);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-content {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
}

.header-spacer {
    flex: 1;
}

.logo {
    width: 164px;
    height: 45px;
    object-fit: contain;
    transform: translateY(2px); /* Визуальный сдвиг вниз для выравнивания с иконками хедера */
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

/* Header Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
}

.header-nav-link {
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-nav-link:hover {
    background-color: var(--secondary);
    color: var(--primary);
}

.header-nav-link.active {
    background-color: var(--primary);
    color: #fff;
}

/* === Ссылка «Мои заказы» в хедере === */
.header-orders-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-orders-link .btn-icon {
    transition: filter 0.2s;
}

.header-orders-link:hover,
.header-orders-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.header-orders-link:hover .btn-icon,
.header-orders-link.active .btn-icon {
    filter: brightness(0) invert(1);
}

/* Sidebar Profile / Personal Account */
.sidebar-profile {
    border-bottom: 1px solid #F0F0F0;
}

.sidebar-profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.sidebar-profile-link:hover {
    background-color: var(--light);
}

.sidebar-profile-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    border-bottom: 1px solid #F0F0F0;
    margin-bottom: 0;
}

.sidebar-nav-link {
    display: block;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 400;
    color: #666666;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-nav-link:hover {
    background-color: var(--secondary);
    color: var(--text);
}

/* Page Container (for inner pages: about, contacts, vacancies) */
.page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-card {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--shadow);
    padding: 40px;
    overflow: hidden;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 32px;
}

/* About Page */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.about-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.about-section p {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 12px;
}

.about-principles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.principle-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: transform 0.2s ease;
}

.principle-card:hover {
    transform: translateY(-3px);
}

.principle-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 36px;
    margin-bottom: 12px;
    color: var(--primary);
}

.principle-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.principle-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Vacancies Page */
.vacancies-intro {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 24px;
}

.vacancy-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.vacancy-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 24px;
    border-left: 4px solid var(--primary);
}

.vacancy-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.vacancy-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.vacancy-badge {
    background-color: #E8F5E9;
    color: #2E7D32;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.vacancy-card p {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
}

.vacancy-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.vacancy-detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #444;
}

.vacancy-detail-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.vacancy-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.vacancy-section-block h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.vacancy-section-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vacancy-section-block li {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
}

.vacancy-section-block li::before {
    content: "•";
    color: var(--primary);
    font-size: 18px;
    position: absolute;
    left: 0;
    top: -2px;
}

.vacancy-cta {
    background: var(--secondary);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.vacancy-cta p {
    font-size: 15px;
    color: var(--text);
    margin: 0;
}

.vacancy-cta a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.vacancy-cta a:hover {
    text-decoration: underline;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Sidebar Menu */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    left: auto;
    width: 300px;
    height: 100vh;
    background-color: var(--background);
    box-shadow: 4px 0 12px var(--shadow);
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-sidebar.open {
    right: 0;
    left: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-sidebar-btn {
    width: 36px;
    height: 36px;
    background-color: var(--light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-categories {
    padding: 16px 0;
    border-bottom: 1px solid #F0F0F0;
}

.sidebar-category {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    background-color: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-category:hover {
    background-color: var(--light);
}

.sidebar-category.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-category.active .sidebar-category-icon {
    filter: brightness(0) invert(1);
}

.sidebar-category-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* SVG Icon helper classes */
.section-icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    object-fit: contain;
}

.chip-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    object-fit: contain;
}

.btn-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    object-fit: contain;
}

.sidebar-contacts {
    padding: 20px 24px;
}

.sidebar-contact-item {
    margin-bottom: 16px;
    font-size: 14px;
}

.sidebar-contact-item strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.sidebar-contact-item span {
    color: #666;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

/* Hero Section */
.hero {
    width: 100%;
    display: block;
    background: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)), url('../images/hero-bg.webp');
    background-size: cover;
    background-position: right center;
    color: white;
    text-align: center;
    min-height: 380px;
    position: relative;
}

.hero-container {
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    flex-direction: column;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 24px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary {
    padding: 14px 28px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

.btn-outline {
    padding: 14px 28px;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

.hero-image img {
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-top: 30px;
}

/* Main Layout */
.main-container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 30px;
    align-items: flex-start;
    flex: 1;
}


.catalog-section {
    flex: 0 0 70%;
    min-width: 0;
}

.cart-section {
    flex: 0 0 calc(30% - 30px);
    position: sticky;
    top: calc(var(--header-height) + 10px);
    margin-top: 10px;
    align-self: flex-start;
    max-height: calc(100vh - var(--header-height) - 40px);
    filter: drop-shadow(-4px 0 16px rgba(0, 0, 0, 0.1));
    z-index: 95;
}

/* Categories */
.categories-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: var(--header-height);
    z-index: 90;
    background: transparent;
    width: 100%;
    padding: 10px 0;
    margin-bottom: 20px;
    overflow: visible;
}

.categories-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -100vw;
    right: -100vw;
    background-color: var(--light);
    z-index: -1;
}

.categories {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background-color: var(--background);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: var(--radius);
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #f1f1f1;
}

.categories::-webkit-scrollbar {
    height: 6px;
}

.categories::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.categories::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

.category-chip {
    padding: 8px 16px;
    background-color: var(--background);
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.category-chip:hover {
    background-color: var(--light);
    border-color: var(--primary);
}

.category-chip.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.category-chip.active .chip-icon {
    filter: brightness(0) invert(1);
}

.category-chip:active {
    transform: scale(0.95);
}

.category-chip.hint-pulse {
    animation: pulse 1.2s ease-out infinite;
    transform-origin: center;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background-color: var(--background);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--shadow-hover);
}

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

.product-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    border-radius: var(--radius) var(--radius) 0 0;
    background-color: var(--light);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    z-index: 2;
    pointer-events: none;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

/* Эффект блика */
.badge-pill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
}

.badge-pill.shimmer::after {
    animation: badgeShimmer 4s infinite;
}

@keyframes badgeShimmer {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

/* Цвета плашек */
.badge-hit {
    background: linear-gradient(135deg, #FF8C00, #FF4500);
}
.badge-new {
    background: linear-gradient(135deg, #00CEC9, #00B894);
}
.badge-discount {
    background: linear-gradient(135deg, #E17055, #D63031);
}
.badge-eco {
    background: linear-gradient(135deg, #2ED573, #10AC84);
}
.badge-chef {
    background: linear-gradient(135deg, #A29BFE, #6C5CE7);
}
.badge-custom {
    background: var(--badge-bg, #333);
    color: var(--badge-color, #fff);
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.product-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.weight-selector {
    display: inline-flex;
    gap: 0;
    margin-bottom: 12px;
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 3px;
    align-self: flex-start;
}

.weight-option {
    padding: 6px 16px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
    background-color: transparent;
    color: #666;
    white-space: nowrap;
    user-select: none;
}

.weight-option:hover {
    color: var(--text);
    background-color: rgba(255, 152, 0, 0.08);
}

.weight-option.selected {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

/* Один вес — компактный тег */
.weight-option:only-child {
    background-color: transparent;
    color: #888;
    cursor: default;
    font-size: 12px;
    padding: 4px 12px;
}

.weight-option:only-child.selected {
    background-color: #eee;
    color: #666;
    box-shadow: none;
    font-weight: 500;
}

.weight-selector:has(.weight-option:only-child) {
    background-color: transparent;
    padding: 0;
}

/* Нижний ряд: цена + кнопка */
.product-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 12px;
    min-height: 44px;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.add-to-cart-btn {
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-to-cart-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.add-to-cart-btn:active {
    transform: scale(0.97);
}

/* Cart */
.cart {
    background-color: var(--background);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    height: fit-content;
    max-height: calc(100vh - var(--header-height) - 60px);
    overflow-y: auto;
}

.cart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 152, 0, 0.15);
}

.cart-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.cart-title-icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    /* Фильтр превращает белый (#FEFEFE) в оранжевый (#FF9800) */
    filter: brightness(0) saturate(100%) invert(62%) sepia(85%) saturate(1500%) hue-rotate(360deg) brightness(100%) contrast(105%);
}

.cart-count-badge {
    background-color: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    max-height: 400px;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    background-color: var(--light);
    border-radius: 8px;
    margin-bottom: 12px;
}

.cart-item-info {
    flex: 1;
    margin-right: 12px;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.cart-item-weight {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 2px solid #ddd;
    background-color: transparent;
    color: var(--text);
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--secondary);
}

.quantity-btn:active,
.remove-btn:active {
    transform: scale(0.9);
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
}

.remove-btn {
    width: 24px;
    height: 24px;
    border: none;
    background-color: transparent;
    color: #999;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
}

.cart-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

.cart-total {
    padding: 20px 0;
    border-top: 2px solid var(--light);
    margin-bottom: 16px;
}

.total-label {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.total-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background-color: #45a049;
    transform: scale(1.02);
}

.checkout-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.clear-cart-btn {
    width: 100%;
    padding: 8px;
    background-color: transparent;
    color: #999;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 6px;
}

.clear-cart-btn .btn-icon {
    filter: grayscale(1) brightness(1.2);
    transition: filter 0.2s ease;
}

.clear-cart-btn:hover:not(:disabled) {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.06);
}

.clear-cart-btn:hover:not(:disabled) .btn-icon {
    filter: brightness(0) saturate(100%) invert(36%) sepia(93%) saturate(3542%) hue-rotate(345deg) brightness(98%) contrast(97%);
}

.clear-cart-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}



/* Mobile & Header Cart Buttons */
.mobile-cart-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.header-cart-btn {
    display: none;
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    position: relative;
    align-items: center;
    justify-content: center;
}

.header-cart-btn img {
    width: 24px;
    height: 20px;
    object-fit: contain;
}

.cart-badge,
.header-cart-badge {
    position: absolute;
    top: -5px;
    /* Чуть выступает сверху */
    right: -5px;
    /* Чуть выступает справа */
    background-color: #F44336;
    /* Красный, как на карточках */
    color: white;
    border: 2px solid #ffffff;
    /* Белая обводка, чтобы отделить от иконки */
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    /* Небольшой отступ внутри, если число большое */
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* Убрали анимацию, чтобы было статично, как ты просил */
}

.hidden {
    display: none !important;
}

.cart-badge {
    width: 20x;
    height: 20px;
    font-size: 11px;
}

.close-cart-btn {
    display: none;
    position: absolute;
    top: 36px;
    right: 36px;
    width: 48px;
    height: 48px;
    background-color: var(--light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--text);
    align-items: center;
    justify-content: center;
}

.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-overlay.open {
    display: block;
    opacity: 1;
}

/* Toast Notification (Basic) */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 1003;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* === Undo Toast (Advanced from style2.css) === */
.undo-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #323232;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    padding: 14px 24px;
    border-radius: 8px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 20px;
    width: auto;
    min-width: 300px;
    justify-content: space-between;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    transition: opacity 0.3s ease;
}

.undo-toast.fade-out {
    opacity: 0;
}

.undo-btn {
    background-color: transparent;
    color: #FF9800;
    border: 1px solid #FF9800;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.undo-btn:hover {
    background-color: rgba(255, 152, 0, 0.15);
}

.undo-progress {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 3px;
    background-color: #FF9800;
    transition: width linear;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay);
    align-items: center;
    justify-content: center;
    z-index: 1004;
}

.modal-content {
    background-color: var(--background);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 24px var(--shadow);
    border: 2px solid var(--primary);
}

.modal-content h3 {
    font-size: 22px;
    color: var(--success);
    margin-bottom: 12px;
}

.modal-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-btn {
    padding: 12px 24px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

.modal-btn:hover {
    background-color: #F57C00;
}

/* Dev Banner */
.dev-banner {
    background-color: #FFF3E0;
    border-bottom: 1px solid #FFB74D;
    color: #E65100;
    padding: 10px 20px;
    position: relative;
    z-index: 2000;
    font-size: 14px;
    text-align: center;
}

.dev-banner-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.dev-banner a {
    color: #E65100;
    text-decoration: underline;
    font-weight: 700;
}

.dev-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #E65100;
    padding: 0 5px;
}

/* Sidebar phone links */
.sidebar-phone {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.sidebar-phone:hover {
    color: #F57C00;
}

/* === Contacts Section === */
.contacts-section {
    background-color: var(--light);
    padding: 48px 20px;
}

.contacts-container {
    max-width: 1440px;
    margin: 0 auto;
}

.contacts-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 32px;
    text-align: center;
}

.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.contacts-bakeries {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-bakery-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--background);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 2px 12px var(--shadow);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-bakery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-hover);
}

.contact-bakery-icon {
    width: 44px;
    height: 44px;
    background-color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-bakery-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-bakery-info strong {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.contact-bakery-phone {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: color 0.2s ease;
}

.contact-bakery-phone:hover {
    color: #F57C00;
}

.contact-bakery-hours {
    font-size: 14px;
    color: #666;
}

/* Feedback Form */
.feedback-form-wrapper {
    background: var(--background);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 2px 12px var(--shadow);
}

.feedback-form-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.feedback-form-subtitle {
    font-size: 13.5px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feedback-field input,
.feedback-field textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background-color: var(--light);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    outline: none;
}

.feedback-field input:focus,
.feedback-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
}

.feedback-field textarea {
    resize: vertical;
    min-height: 100px;
}

.feedback-submit-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.feedback-submit-btn:hover {
    background-color: #F57C00;
}

.feedback-submit-btn:active {
    transform: scale(0.98);
}

.feedback-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Consent Checkbox */
.consent-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    margin-bottom: 4px;
    width: 100%;
    margin-top: 10px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    text-align: left;
    margin: 0;
    padding: 2px 0;
}

.consent-label input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    margin-top: 1px;
    cursor: pointer;
    min-width: 20px;
    min-height: 20px;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.consent-label input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.consent-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.consent-label input[type="checkbox"]:hover {
    border-color: var(--primary);
}

.consent-label a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.consent-label a:hover {
    border-bottom-color: var(--primary);
}


.feedback-success,
.feedback-error {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}

.feedback-success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.feedback-error {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* Feedback Success Screen */
.feedback-success-container {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 10px;
    animation: feedbackFadeIn 0.3s ease-in-out;
}

.success-icon-circle {
    width: 64px;
    height: 64px;
    background-color: #E8F5E9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2E7D32;
    margin-bottom: 18px;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.15);
}

.success-icon {
    width: 32px;
    height: 32px;
}

.success-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.success-message {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.feedback-reset-btn {
    padding: 10px 20px;
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.feedback-reset-btn:hover {
    background-color: var(--primary);
    color: white;
}

.feedback-reset-btn:active {
    transform: scale(0.98);
}

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

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 16px 20px 5px;
    text-align: center;
    background-color: var(--background);
    font-size: 12px;
    color: #666;
    border-top: 1px solid var(--light);
}

.footer p {
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.footer-links {
    margin-top: 10px;
    font-size: 11px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    margin: 0 5px;
}

/* Cookie Banner (Global Styles) */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    z-index: 9999;
    transition: all 0.4s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.cookie-banner.show {
    bottom: 0;
}

.cookie-text {
    font-size: 14px;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.cookie-btn {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.cookie-btn:hover {
    opacity: 0.8;
}

@media (max-width: 600px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        width: calc(100% - 24px);
        border-radius: 16px;
        padding: 12px 16px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        gap: 12px;
        bottom: -200px;
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    .cookie-banner.show {
        bottom: 12px;
    }

    .cookie-text {
        font-size: 13px;
    }

    .cookie-btn {
        padding: 8px 18px;
        font-size: 13px;
        border-radius: 20px;
    }
}

/* === Legal Pages (from style2.css) === */
.legal-page-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.legal-card {
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--shadow);
    padding: 40px;
    overflow: hidden;
}

.legal-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text);
}

/* Блок "Простыми словами" */
.legal-summary {
    background-color: var(--secondary);
    border-left: 5px solid var(--primary);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 40px;
}

.summary-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #E65100;
}

.summary-text {
    font-size: 15px;
    line-height: 1.6;
    color: #5D4037;
}

/* Основной юридический текст */
.legal-text h2 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text);
}

.legal-text p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
    color: #555;
    text-align: justify;
}

.legal-text ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.legal-text li {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 8px;
    color: #555;
}

@media (max-width: 768px) {
    .legal-page-container {
        padding: 0;
        margin: 0;
    }

    .legal-card {
        padding: 20px 16px;
        border-radius: 0;
        box-shadow: none;
    }

    .legal-title {
        font-size: 24px;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.3);
    }

    50% {
        transform: scale(1.06);
        box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%);
    }
}

/* Media Queries */
@media (min-width: 768px) {
    .hero {
        background-position: center;
    }

    .hero-container {
        flex-direction: row;
        text-align: left;
        padding: 80px 40px;
    }

    .hero-content {
        max-width: 600px;
        text-align: left;
    }

    .hero-buttons {
        justify-content: flex-start;
    }
}

@media (max-width: 1024px) {

    body,
    html {
        overflow-x: clip !important;
        width: 100%;
        position: relative;
    }

    .header {
        position: fixed;
        width: 100%;
        padding: 0 12px;
    }

    body {
        padding-top: var(--header-height);
    }

    .hamburger-btn,
    .header-cart-btn,
    .close-cart-btn {
        display: flex;
    }

    .header-nav,
    .header-orders-link {
        display: none;
    }

    .page-container {
        margin-top: 20px;
    }

    .page-card {
        padding: 20px;
    }

    .about-principles {
        grid-template-columns: 1fr;
    }

    .header-content {
        gap: 12px;
        padding: 0;
        height: 100%;
    }


    .main-container {
        overflow: unset !important;
        max-width: 100vw;
        padding: 0 16px 16px 16px;
        flex-direction: column;
    }

    .catalog-section {
        width: 100%;
        margin-bottom: 16px;
    }

    .categories-wrapper {
        position: sticky;
        top: var(--header-height);
        z-index: 990;
        background-color: var(--background);
        width: calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
        padding: 10px 0 0 0;
    }

    .categories-wrapper::before {
        display: none;
    }

    .categories {
        padding: 0 16px 12px 16px;
        box-shadow: none;
        border-radius: 0;
    }

    .dev-banner {
        padding-right: 40px;
    }

    /* Mobile style Undo Toast */
    .undo-toast {
        min-width: 280px;
        max-width: 90%;
        padding: 14px 20px;
        flex-direction: row;
        gap: 16px;
    }

    .undo-btn {
        padding: 6px 14px;
        white-space: nowrap;
    }

    /* Включаем кнопку корзины на мобильных */
    .mobile-cart-btn {
        display: flex;
        bottom: 30px;
        /* Чуть выше от края */
        right: 20px;
    }

    /* Корзина: полноэкранная панель (мобайл) */
    .cart-section {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        z-index: 2000;
        padding: 20px;
        padding-top: 70px;
        overflow-y: auto;
        background: white;
        transition: transform 0.3s ease;
        transform: translateX(100%);
    }

    .cart-section.open {
        transform: translateX(0);
    }

    /* Кнопка закрытия корзины должна быть видна */
    .close-cart-btn {
        top: 15px;
        right: 15px;
        z-index: 2001;
        background: #f0f0f0;
    }

    /* Contacts section mobile */
    .contacts-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .contacts-section {
        padding: 32px 16px;
    }

    .contacts-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .contact-bakery-card {
        padding: 20px;
    }

    .feedback-form-wrapper {
        padding: 20px;
    }
}

/* Mobile optimizations for small screens (max-width: 600px) */
@media (max-width: 600px) {
    .page-container {
        padding: 0 12px;
        margin-top: 16px;
        margin-bottom: 24px;
    }

    .page-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .contacts-grid {
        gap: 20px;
    }

    .contact-bakery-card {
        padding: 16px;
        gap: 12px;
    }

    .contact-bakery-icon {
        width: 38px;
        height: 38px;
    }

    .contact-bakery-phone {
        font-size: 16px;
    }

    .feedback-form-wrapper {
        padding: 20px 16px;
    }
}


/* Контейнер кнопок (заменен на product-bottom-row) */
.product-actions {
    display: contents;
}

/* Компактный степпер */
.amount-controls {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background-color: #fff;
    border: 2px solid var(--primary);
    border-radius: 22px;
    padding: 3px;
    animation: fadeScaleIn 0.25s ease;
}

.amount-btn {
    width: 32px;
    height: 32px;
    border: none;
    background-color: transparent;
    color: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.amount-btn:hover {
    background-color: var(--secondary);
}

.amount-btn:active {
    transform: scale(0.85);
}

.amount-count {
    font-weight: 700;
    font-size: 15px;
    min-width: 24px;
    text-align: center;
    color: var(--text);
}

/* Анимация появления степпера */
@keyframes fadeScaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Скрываем ненужное */
.hidden-action {
    display: none !important;
}



/* 3. Бейджи корзины (в шапке и плавающая кнопка) */
.cart-badge,
.header-cart-badge {
    background-color: #F44336 !important;
    color: white !important;
    border: 2px solid #fff;

    /* РАЗМЕРЫ И ФОРМА */
    border-radius: 50%;
    min-width: 20px;
    /* Минимальная ширина */
    height: 20px;
    /* Высота */

    /* ЦЕНТРОВКА И ТЕКСТ */
    font-size: 11px;
    font-weight: 700;
    padding: 0;
    /* ВАЖНО: Убираем боковой padding, который делал овал */
    line-height: 1;
    /* ВАЖНО: Выравнивает цифру по вертикали */

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

/* Специфичный размер для плавающей кнопки (она чуть больше) */
.cart-badge {
    width: 20px;
    /* Жесткая ширина */
    height: 20px;
    /* Жесткая высота */
    min-width: 20px;
    /* Запрещаем сжиматься */
    font-size: 11px;
    /* Чуть крупнее шрифт */
}

/* === Delivery Modal (index.html) === */
.delivery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeInModal 0.25s ease;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.delivery-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 520px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.3s ease;
}

@keyframes slideUpModal {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.delivery-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.delivery-modal-close:hover {
    background: #eee;
    color: #333;
}

.delivery-modal-header {
    padding: 28px 28px 0;
}

.delivery-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.delivery-modal-body {
    padding: 20px 28px 28px;
}

.delivery-modal-section {
    margin-bottom: 24px;
}

.delivery-modal-section:last-child {
    margin-bottom: 0;
}

.delivery-modal-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px;
}

/* === Shared Delivery Zones Table === */
.delivery-zones-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
}

.delivery-zones-table thead th {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 14px;
    text-align: left;
}

.delivery-zones-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text);
}

.delivery-zones-table tbody tr:last-child td {
    border-bottom: none;
}

.delivery-zones-table tbody tr:hover {
    background: #FFF8E1;
}

.delivery-zones-table .discount-price {
    color: #2E7D32;
    font-weight: 600;
}

.delivery-zones-table .no-delivery-row td {
    color: #999;
    font-style: italic;
}

.delivery-conditions-note {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
    line-height: 1.4;
}

.delivery-note-small {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

/* Bakery Cards */
.delivery-bakeries {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bakery-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #FFF8E1;
    border-radius: 12px;
    border: 1px solid #FFE0B2;
}

.bakery-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.bakery-card strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}

.bakery-hours {
    font-size: 12px;
    color: #888;
}

.bakery-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #FFF8E1;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    border: 1px solid #FFE0B2;
}

@media (max-width: 600px) {
    .delivery-modal-content {
        width: 96%;
        border-radius: 16px;
        max-height: 90vh;
    }

    .delivery-modal-header {
        padding: 20px 20px 0;
    }

    .delivery-modal-body {
        padding: 16px 20px 20px;
    }

    .delivery-modal-header h2 {
        font-size: 20px;
    }
}


/* =====================================================
   ШТОРКА ТОВАРА (PRODUCT DETAIL BOTTOM SHEET)
   ===================================================== */

/* Оверлей */
.product-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.product-sheet-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Шторка — мобильная версия (полная ширина, выезжает снизу) */
.product-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2501;
    background: #fff;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    will-change: transform;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
    overscroll-behavior-y: contain;
}

.product-sheet.open {
    transform: translateY(0);
}

/* Десктоп: центрируем шторку как боковую панель */
@media (min-width: 600px) {
    .product-sheet {
        left: 50%;
        right: auto;
        width: 460px;
        transform: translateX(-50%) translateY(100%);
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
    }

    .product-sheet.open {
        transform: translateX(-50%) translateY(0);
    }
}

/* Ручка для свайпа */
.sheet-drag-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0 6px;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
}

.sheet-drag-bar:active {
    cursor: grabbing;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    transition: background 0.2s;
}

.sheet-drag-bar:hover .sheet-handle {
    background: #bbb;
}

/* Прокручиваемая область контента */
.product-sheet-content {
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    position: relative;
}

/* Кнопка закрытия */
.sheet-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    line-height: 1;
}

.sheet-close-btn:hover {
    background: #f5f5f5;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Фото товара в шторке */
.sheet-image-wrap {
    width: 100%;
    height: 230px;
    overflow: hidden;
    background: var(--light);
    flex-shrink: 0;
}

.sheet-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Тело шторки */
.sheet-body {
    padding: 20px 20px 32px;
}

.sheet-product-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-right: 36px;
    line-height: 1.3;
}

/* Секции (описание, состав, КБЖУ) */
.sheet-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.sheet-section:last-of-type,
.sheet-section:nth-last-child(2) {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sheet-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.sheet-description {
    font-size: 15px;
    color: #555;
    line-height: 1.65;
    margin: 0;
}

.sheet-composition {
    font-size: 14px;
    color: #666;
    line-height: 1.65;
    margin: 0;
}

/* === КБЖУ === */
.nutrition-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nutrition-section-label {
    font-size: 11px;
    color: #bbb;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* Базовая ячейка */
.nutrition-cell {
    border-radius: 14px;
    padding: 11px 6px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.nutrition-cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Цветные фоны по типу (FatSecret Style) */
.nutrition-cell--kcal   { background: #FFF2E5; }
.nutrition-cell--protein { background: #EBF7FC; }
.nutrition-cell--fat    { background: #F7EBF5; }
.nutrition-cell--carbs  { background: #F9F7E8; }

/* Буквенный значок */
.nutrition-badge {
    height: 22px;
    background: #FF9800;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    flex-shrink: 0;
}

.nutrition-badge--kcal {
    padding: 0 8px;
}

.nutrition-badge--protein,
.nutrition-badge--fat,
.nutrition-badge--carbs {
    width: 32px;
}

.nutrition-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.nutrition-unit-name {
    font-size: 10px;
    color: #aaa;
    line-height: 1.2;
    text-align: center;
}

/* Плейсхолдер когда КБЖУ не заполнено */
.nutrition-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--light);
    border-radius: 12px;
    color: #bbb;
    font-size: 14px;
    border: 1.5px dashed #e0e0e0;
}

.nutrition-placeholder-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}


/* === Нижняя панель (выбор веса + цена + корзина) === */
.sheet-bottom {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

/* Выбор веса в шторке — такой же как в карточке */
.sheet-weight-selector {
    display: inline-flex;
    margin-bottom: 16px;
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 3px;
    gap: 0;
}

.sheet-weight-option {
    padding: 7px 18px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: transparent;
    transition: all 0.2s;
    line-height: 1.2;
}

.sheet-weight-option.selected {
    background: var(--primary);
    color: #fff;
}

/* Одиночный вес (без кнопок) */
.sheet-weight-single {
    display: inline-block;
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
    padding: 5px 12px;
    background: var(--light);
    border-radius: 20px;
}

/* Строка цена + кнопка */
.sheet-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sheet-price {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.sheet-actions {
    display: flex;
    align-items: center;
}

.sheet-add-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.sheet-add-btn:hover {
    background: #e68900;
    transform: scale(1.03);
}

.sheet-add-btn:active {
    transform: scale(0.97);
}

/* Счётчик количества в шторке (тот же стиль что в карточках) */
.sheet-amount-controls {
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 25px;
    padding: 4px;
    gap: 0;
}

/* Курсор-указатель на фото карточки (hint что можно кликнуть) */
.product-image.sheet-trigger {
    cursor: pointer;
    position: relative;
}

.product-image.sheet-trigger::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background 0.2s;
    border-radius: var(--radius) var(--radius) 0 0;
}

.product-image.sheet-trigger:hover::after {
    background: rgba(0, 0, 0, 0.06);
}

/* Предотвращаем скролл body когда шторка или корзина открыты */
html.sheet-open,
body.sheet-open,
html.cart-open,
body.cart-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Скрывать плавающую кнопку корзины при открытой шторке */
body.sheet-open .mobile-cart-btn {
    display: none !important;
}

/* Оптимизация размеров карточки товара для мобильных экранов */
@media (max-width: 600px) {
    .sheet-body {
        padding: 12px 16px 20px;
    }
    
    .sheet-product-name {
        font-size: 18px;
        margin-bottom: 12px;
        padding-right: 32px;
    }
    
    .sheet-section {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    .sheet-section-title {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .sheet-description,
    .sheet-composition {
        font-size: 13px;
        line-height: 1.5;
    }
    
    /* Компактный блок КБЖУ */
    .nutrition-wrapper {
        gap: 10px;
    }
    
    .nutrition-section-label {
        font-size: 9.5px;
        margin-bottom: 6px;
    }
    
    .nutrition-grid {
        gap: 6px;
    }
    
    .nutrition-cell {
        border-radius: 12px;
        padding: 8px 4px;
        gap: 6px;
    }
    
    .nutrition-badge {
        height: 18px;
        font-size: 10px;
        border-radius: 100px;
    }
    
    .nutrition-badge--kcal {
        padding: 0 6px;
        width: auto;
    }
    
    .nutrition-badge--protein,
    .nutrition-badge--fat,
    .nutrition-badge--carbs {
        width: 26px;
    }
    
    .nutrition-value {
        font-size: 14px;
    }
    
    /* Оптимизация нижней панели */
    .sheet-bottom {
        padding-top: 12px;
        margin-top: 2px;
    }
    
    .sheet-weight-selector {
        margin-bottom: 12px;
    }
    
    .sheet-weight-option {
        padding: 5px 14px;
        font-size: 13px;
    }
    
    .sheet-weight-single {
        margin-bottom: 12px;
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .sheet-price {
        font-size: 22px;
    }
    
    .sheet-add-btn {
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 20px;
    }
    
    .sheet-amount-controls {
        border-radius: 20px;
        padding: 3px;
    }
}

/* === Стили для аватара в шапке сайта (Личный кабинет) === */
.header-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: #fff;
    vertical-align: middle;
}

.header-orders-link.active .header-avatar {
    filter: none !important;
}

.header-orders-link:hover .header-avatar {
    filter: none !important;
    border-color: #fff;
}

/* === Мобильный аватар в шапке === */
.mobile-header-avatar-link {
    display: none;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-right: 12px;
}

.mobile-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background-color: #fff;
    transition: transform 0.2s ease;
}

.mobile-header-avatar-link:active .mobile-header-avatar {
    transform: scale(0.92);
}

@media (max-width: 768px) {
    .mobile-header-avatar-link {
        display: flex;
    }
}