/* ===================================
   Основные стили
   =================================== */

:root {
    --primary-color: #6c4320;
    --primary-dark: #4d2e17;
    --primary-light: #8b5a2b;
    --bg-light: #F5EBDC;
    --bg-card: #FCF6EC;
    --bg-active: #F0E6D2;
    --text-primary: #6c4320;
    --text-secondary: #8b5a2b;
    --border-color: #6c4320;
    --shadow-sm: 0 1px 4px rgba(108, 67, 32, 0.25);
    --shadow-md: 0 3px 8px rgba(108, 67, 32, 0.3);
    --shadow-lg: 0 6px 14px rgba(108, 67, 32, 0.32);
    --radius-sm: 8px;
    --radius-md: 20px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: visible;
}

body {
    font-family: 'SN Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: visible;
}

::selection {
    background-color: #E88C1E;
    color: #fff;
}

/* ===================================
   Навигация (Header)
   =================================== */

.header-top {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 2;
    max-width: 500px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-mobile-info {
    display: none;
}

.navbar-brand img {
    height: 60px;
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input-custom {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 12px 20px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-light);
    transition: all 0.3s ease;
}

.search-input-custom:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(108, 67, 32, 0.15);
}

.search-btn-custom {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: -50px;
    z-index: 10;
}

.search-btn-custom:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-active);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cart-link:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.cart-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    padding: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.account-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 20px;
    min-height: 48px;
    box-sizing: border-box;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* С аватаром — фото прижимается к левому краю, справа равный отступ. */
.account-link--avatar {
    padding-left: 4px;
}

.account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.7);
    display: block;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.account-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

.account-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(108, 67, 32, 0.3);
    color: white;
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: var(--bg-active);
}

.mobile-menu-icon {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    position: relative;
}

.mobile-menu-icon::before,
.mobile-menu-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    left: 0;
}

.mobile-menu-icon::before { top: -8px; }
.mobile-menu-icon::after { top: 8px; }

/* ===================================
   Основной контейнер
   =================================== */

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    gap: 24px;
    overflow: visible;
}

/* ===================================
   Сайдбар с категориями
   =================================== */

.category-sidebar {
    width: 270px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    border: 2px solid rgba(108, 67, 32, 0.1);
    display: flex;
    flex-direction: column;
} 

.category-sidebar-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 12px 0;
    text-align: center;
    padding-bottom: 0;
    border-bottom: none;
    flex-shrink: 0;
    display: block;
    visibility: visible;
    opacity: 1;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

/* Скрываем скроллбар для всех браузеров */
.category-list::-webkit-scrollbar {
    display: none;
}

.category-list {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.category-item {
    margin-bottom: 8px;
    transition: transform 0.6s ease;
}

.category-item:first-child {
    margin-top: 4px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    position: relative;
}

.category-link:hover {
    background: linear-gradient(135deg, #FCF6EC 0%, #F0E6D2 100%);
    border-color: rgba(108, 67, 32, 0.5);
}

.category-link.active {
    background: linear-gradient(135deg, #5C3A1A 0%, #B57D3E 35%, #F2C94C 50%, #B57D3E 65%, #5C3A1A 100%);
    background-size: 200% 100%;
    color: white;
    border: none;
    box-shadow: none;
    animation: categoryActiveShimmer 5s linear infinite;
}

@keyframes categoryActiveShimmer {
    from {
        background-position: 0% 0;
    }
    to {
        background-position: 200% 0;
    }
}

.category-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: none;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.category-icon-placeholder {
    font-size: 2rem;
    flex-shrink: 0;
    filter: none;
    transition: transform 0.25s ease;
}

.category-link:hover .category-icon {
    filter: brightness(1.1);
    transform: scale(1.15);
}

.category-link:hover .category-icon-placeholder {
    transform: scale(1.1);
}

.category-link.active .category-icon {
    filter: brightness(1.2);
}

.category-link.active .category-icon-placeholder {
    transform: scale(1.2);
    opacity: 0.85;
}

/* ===================================
   Основной контент (витрина)
   =================================== */

.main-content {
    flex: 1;
    min-width: 0;
}

.shop-header {
    text-align: center;
    margin-bottom: 32px;
    margin-top: 50px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.shop-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.shop-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ===================================
   Секции категорий (якоря)
   =================================== */

.category-section {
    scroll-margin-top: 100px;
    margin-bottom: 48px;
}

.category-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.category-section-title::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #6C4320 0%, #B57D3E 25%, #F2C94C 50%, #B57D3E 75%, #6C4320 100%);
    background-size: 200% auto;
    animation: categoryTitleTextShimmer 4s linear infinite;
}

.category-section-title .category-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    animation: categoryTitleIconFloat 2.4s ease-in-out infinite;
}

.category-section-title .category-icon-placeholder {
    display: inline-block;
    animation: categoryTitleIconFloat 2.4s ease-in-out infinite;
}

.category-section-title .category-section-animated-text {
    background: linear-gradient(90deg, #6C4320 0%, #B57D3E 25%, #F2C94C 50%, #B57D3E 75%, #6C4320 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: categoryTitleTextShimmer 4s linear infinite;
}

@keyframes categoryTitleIconFloat {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
    30% {
        transform: translateY(-10px) scale(1.3) rotate(-6deg);
    }
    70% {
        transform: translateY(-4px) scale(1.18) rotate(5deg);
    }
}

@keyframes categoryTitleTextShimmer {
    to {
        background-position: 200% center;
    }
}

/* ===================================
   Сетка товаров (3 колонки на десктопе)
   =================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ===================================
   Карточка товара
   =================================== */

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(108, 67, 32, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 4px 12px rgba(108, 67, 32, 0.32);
}

.product-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: linear-gradient(135deg, #f0e6d2 0%, #fcf6ec 100%);
    border: 5px solid white;
    border-radius: var(--radius-lg);
}

/* Стикеры товара (новинка / хит продаж / акция) */
.product-card .product-stickers {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 70%;
    pointer-events: none;
}

.product-sticker {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(45, 22, 4, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    border: 3px solid #ffffff;
    white-space: nowrap;
}

.product-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.product-card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--bg-active);
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-color);
}

.product-price-block {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.1;
}

.product-price-old {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: line-through;
    padding-left: 4px;
}

.product-add-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.product-add-btn:hover {
    background: var(--primary-light);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ===================================
   Корзина
   =================================== */

.cart-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    animation: cartFadeIn 0.5s ease;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.cart-table th {
    background: var(--bg-active);
    color: var(--text-primary);
    font-weight: 700;
    padding: 16px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.cart-table td {
    padding: 16px;
    color: var(--text-primary);
}

.cart-table tbody tr {
    background-image: radial-gradient(circle, rgba(108, 67, 32, 0.2) 2.5px, transparent 2.5px);
    background-position: bottom;
    background-size: 10px 5px;
    background-repeat: repeat-x;
}

.cart-table tbody tr:last-child {
    background-image: none;
}

.order-hide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(192, 57, 43, 0.35);
    background: transparent;
    color: #c0392b;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.order-hide-btn:hover {
    background: #c0392b;
    color: white;
    transform: scale(1.1);
}

.cart-action-cell {
    white-space: nowrap;
}

.cart-action-cell form {
    vertical-align: middle;
}

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

.quantity-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-close-btn {
    color: #E53935;
    border-color: #E53935;
}

.modal-close-btn:hover {
    background: #E53935;
    border-color: #E53935;
    color: white;
}

.quantity-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.cart-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-active);
    padding: 16px 24px;
    border-radius: var(--radius-xl);
    border: 3px solid var(--border-color);
    display: inline-block;
}

/* Общий блок «Итого + кнопки» в корзине */
.cart-summary {
    margin-top: 24px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.cart-summary-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.cart-summary-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}
.cart-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}
.cart-summary-actions .btn {
    flex: 1 1 180px;
    min-width: 0;
}
@media (max-width: 576px) {
    .cart-summary-actions {
        flex-direction: column;
    }
    .cart-summary-actions .btn {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* ===================================
   Оформление заказа
   =================================== */

.checkout-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    animation: checkoutFadeIn 0.5s ease;
}

.checkout-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.delivery-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.delivery-option {
    padding: 12px 20px;
    border: 3px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.delivery-option:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.delivery-option.selected {
    background: var(--bg-active);
    border-color: var(--primary-color);
}

.delivery-option-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.delivery-option-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===================================
   Формы
   =================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-control-custom {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-light);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control-custom:focus {
    outline: none;
    border-color: #6c4320 !important;
    box-shadow: 0 0 0 0.25rem rgba(108, 67, 32, 0.25) !important;
    background: white;
}

.form-control-custom::placeholder {
    color: rgba(108, 67, 32, 0.5);
}

/* ===================================
   Чекбоксы и радио кнопки
   =================================== */

.form-check-input:checked {
    background-color: #513218 !important;
    border-color: #513218 !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(81, 50, 24, 0.25) !important;
    border-color: #513218 !important;
}

.form-check-input {
    border-color: #513218;
    accent-color: #513218;
}

/* ===================================
   Глобальная защита от горизонтальной прокрутки
   =================================== */

html,
body {
    /* clip не создаёт scroll-контейнер и НЕ ломает position: sticky
       у десктопного сайдбара категорий (в отличие от hidden) */
    overflow-x: clip;
}

body {
    /* 100vw включает в себя ширину вертикального скроллбара, из-за чего тело
       становится шире видимой области и правый отступ контента (баннеры,
       карточки товаров) уезжает за экран и срезается overflow-x: clip.
       100% берёт ширину без скроллбара. */
    max-width: 100%;
}

img,
video,
canvas,
iframe {
    max-width: 100%;
}

input,
textarea,
select {
    max-width: 100%;
}

/* ===================================
   Кнопки
   =================================== */

.btn-primary-custom {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary-custom:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-secondary-custom {
    background: var(--bg-active);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-secondary-custom:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Анимированный градиент при наведении на все кнопки */
.btn-primary-custom:hover,
.btn-secondary-custom:hover,
.product-add-btn:hover,
.cart-summary-actions .btn:hover,
.add-to-cart-form button:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 35%, #F2C94C 50%, var(--primary-light) 65%, var(--primary-color) 100%);
    background-size: 200% 100%;
    color: white;
    animation: categoryActiveShimmer 2.5s linear infinite;
}

/* Внутреннее свечение кнопки "В корзину" (модалка + карточки в сетке) */
.add-to-cart-modal-btn,
.product-add-btn {
    box-shadow: inset 0 0 14px rgba(255, 214, 130, 0.6), inset 0 0 5px rgba(255, 255, 255, 0.45), var(--shadow-sm);
}

/* ===================================
   Уведомления (Toasts)
   =================================== */

.toast-custom {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #7a4a1e 0%, #a8631f 45%, #e0a52e 100%);
    color: white;
    border-radius: 18px;
    padding: 16px 22px;
    font-size: 1.05rem;
    font-weight: 600;
    box-shadow: 0 16px 44px rgba(60, 35, 10, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    border: none;
    animation: toastPopIn 0.45s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes toastPopIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Контейнер тоста: по центру экрана */
.toast-fixed {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) !important;
    z-index: 1080;
    min-width: 400px;
    max-width: 90vw;
}

/* На мобильных не даём контейнеру уезжать влево */
@media (max-width: 576px) {
    .toast-fixed {
        left: 8px;
        right: 8px;
        top: 50%;
        transform: translateY(-50%) !important;
        min-width: 0;
        width: auto;
        max-width: none;
    }

    /* Корзина: таблица → карточки только на узких (вертикальных) экранах,
       чтобы колонки «Сумма»/«Действия» не выходили за экран */
    .cart-table {
        display: block;
    }
    .cart-table thead {
        display: none;
    }
    .cart-table tbody {
        display: block;
    }
    .cart-table tbody tr {
        display: block;
        background: var(--bg-light);
        border: 2px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        padding: 12px;
        background-image: none;
    }
    .cart-table tbody tr td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        border: none;
        text-align: right !important;
    }
    .cart-table tbody tr td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        text-align: left;
    }
    .cart-table tbody tr td[data-label="Товар"] {
        display: block;
        text-align: left !important;
        font-size: 1rem;
    }
    .cart-table tbody tr td[data-label="Товар"]::before {
        display: none;
    }
    .cart-table tbody tr.cart-row {
        position: relative;
    }
    .cart-table tbody tr .cart-action-cell {
        position: absolute;
        top: 8px;
        right: 8px;
        display: block;
        padding: 0;
        text-align: right;
        border: none;
    }
    .cart-table tbody tr .cart-action-cell::before {
        display: none;
    }
    .cart-table tbody tr.cart-row td[data-label="Товар"] {
        padding-right: 48px;
    }
}

/* На 767px и ниже: крестик над кнопкой «Повторить», чтобы действия заказа не разваливали страницу */
@media (max-width: 767.98px) {
    .cart-table tbody tr .cart-action-cell {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-start;
        gap: 6px;
    }
    .cart-action-cell form {
        display: block !important;
    }
}

/* Карточный режим (<=575px): действия заказа — вверху карточки в потоке,
   кнопка «Повторить» слева, крестик справа, не поверх текста */
@media (max-width: 575.98px) {
    .cart-table tbody tr:has(.order-hide-btn) {
        display: flex;
        flex-direction: column;
    }
    .cart-table tbody tr .cart-action-cell:has(.order-hide-btn) {
        order: -1;
        position: static;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        padding: 2px 0 10px;
        margin-bottom: 8px;
        border-bottom: 1px dashed var(--border-color);
    }
    .cart-table tbody tr .cart-action-cell:has(.order-hide-btn) form:first-child {
        order: 2;
    }
}

/* ===================================
   Модальное окно
   =================================== */

.modal-content-custom {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: none;
}

.modal-header-custom {
    border-bottom: 2px solid var(--border-color);
    padding: 20px 24px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body-custom {
    padding: 24px;
}

.modal-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

/* ===================================
   Анимации
   =================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

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

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

/* ===================================
   Адаптивность
   =================================== */

/* Планшеты портрет (iPad вертикальный: 768px - 1024px) - 3 колонки */
@media (min-width: 768px) and (max-width: 1024.98px) {
    html, body {
        overflow-x: visible !important;
    }

    main {
        padding: 0 !important;
        margin: 0 !important;
    }

    .container {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .header-top {
        overflow: visible !important;
    }

    .header-top .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .header-content {
        overflow: visible !important;
    }

    .main-container {
        padding: 16px 0 !important;
        gap: 8px !important;
    }
    
    /* Скрываем горизонтальную панель категорий на планшетах */
    .category-sidebar-mobile {
        display: none !important;
    }

    .search-results-header {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 20px 24px !important;
        box-sizing: border-box !important;
    }

    .header-left {
        gap: 12px;
    }

    .header-center {
        flex: 0;
        max-width: none;
        margin-left: auto;
        margin-right: 8px;
    }

    .header-right {
        gap: 8px;
        margin-right: 0;
        padding-right: 0;
    }

    .header-right .work-time {
        font-size: 0.8rem;
    }

    .header-right .phone-number {
        font-size: 0.85rem;
    }

    .cart-link,
    .account-link {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .search-input-modern {
        padding: 8px 45px 8px 18px;
        font-size: 1rem;
        max-width: 390px;
    }

    .search-btn-modern {
        width: 36px;
        height: 36px;
    }

    .main-container {
        max-width: 100% !important;
        /* Боковые отступы обязательны: при padding 16px 0 баннеры и карточки
           товаров прилегали к краям экрана вплотную. */
        padding: 16px 12px !important;
        overflow: visible !important;
    }

    .main-content {
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .shop-header {
        padding: 16px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    .search-results-header {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 20px 24px !important;
        box-sizing: border-box !important;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        /* Отступ задаёт .main-container, иначе карточки уезжают от баннеров */
        padding: 0;
    }

    .category-sidebar {
        width: 180px !important;
        padding: 12px 8px 15px 8px !important;
        margin-left: 10px !important;
        position: sticky !important;
        top: 100px !important;
        transform: none !important;
        max-height: calc(100vh - 120px) !important;
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
    }

    .category-list {
        margin-bottom: 0 !important;
    }

    .category-sidebar-title {
        font-size: 1.1rem !important;
        margin: 0 0 10px 0 !important;
    }

    .category-link {
        font-size: 0.85rem !important;
        padding: 4px 8px !important;
        margin-bottom: 4px !important;
    }

    .category-icon {
        width: 24px !important;
        height: 24px !important;
    }

    .product-card-title {
        font-size: 1rem !important;
    }

    .product-card-description {
        font-size: 0.85rem !important;
    }

    .product-price {
        font-size: 1.05rem !important;
        padding: 4px 10px !important;
        white-space: nowrap;
    }

    .product-add-btn {
        font-size: 0.78rem !important;
        padding: 6px 10px !important;
        white-space: nowrap;
    }

    .product-card-footer {
        gap: 8px;
    }
}

/* Экраны 1024px и больше - уменьшенный поиск */
@media (min-width: 1025px) {
    .header-center {
        max-width: 350px;
    }

    .search-input-modern {
        padding: 10px 45px 10px 16px;
        font-size: 0.95rem;
    }

    .search-btn-modern {
        width: 36px;
        height: 36px;
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .checkout-section-title {
        font-size: 1.5rem;
    }

    .delivery-option-label {
        font-size: 1.1rem;
    }

    .category-section-title {
        font-size: 1.25rem;
    }

    .category-link {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}

/* Ноутбуки 1025-1199px - компактная цена и кнопка в карточках */
@media (min-width: 1025px) and (max-width: 1199.98px) {
    .product-price {
        font-size: 1.05rem !important;
        padding: 4px 10px !important;
        white-space: nowrap;
    }

    .product-add-btn {
        font-size: 0.8rem !important;
        padding: 8px 12px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .product-card-footer {
        gap: 8px;
    }
}

.category-sidebar-mobile {
    display: none;
}

/* Планшеты ландшафт и маленькие планшеты (576px - 768px) - 2 колонки */
@media (max-width: 767.98px) {
    .header-center {
        display: none;
    }

    .header-left {
        flex: 1;
        gap: 8px;
        min-width: 0;
    }

    .mobile-menu-btn {
        display: none;
    }

    .header-contact-info {
        display: none !important;
    }

    /* Телефон и часы работы в шапке */
    .header-top .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .header-content {
        gap: 12px;
    }

    .header-right {
        gap: 10px;
        padding-right: 0;
        min-width: 0;
    }

    .header-right .header-mobile-info {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        order: 1;
        min-width: 0;
    }

    .header-right .mobile-phone {
        font-size: 0.82rem;
        line-height: 1.2;
        color: var(--text-primary);
        font-weight: 700;
        white-space: nowrap;
        text-decoration: none;
    }

    .header-right .mobile-phone:hover {
        color: var(--primary-color);
    }

    .header-right .mobile-hours {
        font-size: 0.72rem;
        line-height: 1.2;
        color: var(--text-secondary);
        white-space: nowrap;
    }

    .header-right .account-link {
        order: 2;
        flex-shrink: 0;
    }

    .header-right .cart-link {
        order: 3;
        flex-shrink: 0;
    }

    .main-container {
        flex-direction: column;
        padding: 16px 12px;
    }

    .category-sidebar {
        display: none; /* Скрываем вертикальный сайдбар */
    }

    /* Баннеры для экранов до 767px - показываем в натуральных пропорциях */
    .banner-image {
        height: auto !important;
    }

    .shop-header {
        margin-top: 60px !important;
        margin-bottom: 20px !important;
    }

    /* Панель категорий выше position: fixed, поэтому компенсирующий
       отступ нужен каждому элементу потока, а не только .shop-header.
       Сезонный баннер идёт первым и раньше прятался под неё. */
    .season-holiday-banner {
        margin-top: 50px;
    }

    /* Горизонтальная фиксированная панель категорий для мобильных */
    .category-sidebar-mobile {
        display: flex !important;
        flex-wrap: nowrap;
        width: 100%;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        z-index: 100;
        padding: 8px 0;
        overflow-x: auto;
        overflow-y: hidden;
        border-bottom: 2px solid var(--border-color);
        -webkit-overflow-scrolling: touch;
        cursor: grab;
        user-select: none;
        -ms-overflow-style: none;
        scrollbar-width: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .category-sidebar-mobile::-webkit-scrollbar {
        display: none;  /* Chrome, Safari, Opera */
    }

    .category-sidebar-mobile:active {
        cursor: grabbing;
    }

    .category-sidebar-mobile .category-item {
        display: flex;
        align-items: center;
        margin: 0 4px;
        flex-shrink: 0;
        position: relative;
        z-index: 1;
    }

    .category-sidebar-mobile .category-item:first-child {
        margin-left: 20px;
    }

    .category-sidebar-mobile .category-item:last-child {
        margin-right: 20px;
    }

    .category-sidebar-mobile .category-link {
        padding: 5px 10px;
        font-size: 0.85rem;
        transition: none;
        pointer-events: auto;
        cursor: pointer;
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }

    .category-sidebar-mobile .category-link:hover {
        transform: none;
    }

    .category-sidebar-mobile .category-link.active {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 35%, #F2C94C 50%, var(--primary-light) 65%, var(--primary-color) 100%);
        background-size: 200% 100%;
        color: white;
        border-color: var(--primary-color);
        box-shadow: 0 4px 16px rgba(108, 67, 32, 0.3);
        animation: categoryActiveShimmer 5s linear infinite;
    }

    .category-sidebar-mobile .category-link.active .category-icon-placeholder {
        transform: scale(1.2);
        opacity: 0.8;
    }

    .category-sidebar-mobile .category-sidebar-title,
    .category-sidebar-mobile .category-list {
        display: none;
    }

    /* Скрываем старое мобильное меню */
    .mobile-category-nav {
        display: none !important;
    }

    .category-sidebar::-webkit-scrollbar {
        height: 4px;
    }

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

    .category-item {
        display: inline-flex;
        margin-bottom: 0;
        margin-right: 8px;
        flex-shrink: 0;
    }

    .category-link {
        padding: 5px 8px;
        font-size: 0.85rem;
    }

    .category-sidebar-title {
        display: none;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .shop-title {
        font-size: 1.75rem;
    }

    .shop-header {
        padding: 16px;
        margin-top: 50px;
    }

    .category-section-title {
        font-size: 1.5rem;
    }

    .product-card-title {
        font-size: 1rem;
    }

    .product-card-description {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .product-price {
        font-size: 1.1rem;
        padding: 4px 10px;
        white-space: nowrap;
    }

    .product-add-btn {
        padding: 6px 10px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .product-card-footer {
        gap: 8px;
    }

    .cart-table {
        font-size: 0.9rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 12px 8px;
    }

    .checkout-container {
        padding: 20px;
    }

    .delivery-options {
        grid-template-columns: 1fr;
    }

    .header-top {
        padding: 8px 0;
    }

    .navbar-brand img {
        height: 32px;
    }
}

/* Телефоны (480px) */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .shop-title {
        font-size: 1.5rem;
    }

    .shop-subtitle {
        font-size: 0.9rem;
    }

    .product-card-image-wrapper {
        padding-top: 60%;
    }

    .product-card-content {
        padding: 16px;
    }

    .product-card-title {
        font-size: 1.1rem;
    }

    .product-card-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .product-price {
        text-align: left;
        font-size: 1.1rem;
    }

    .product-add-btn {
        font-size: 0;
        min-width: 100px !important;
        height: 44px;
        padding: 0 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background: var(--bg-card);
        border: 2px solid var(--border-color);
        color: var(--text-primary);
        box-shadow: var(--shadow-sm);
        border-radius: var(--radius-xl);
    }

    .product-add-btn:hover {
        background: var(--bg-active);
        color: var(--text-primary);
        transform: scale(1.05);
        animation: none;
    }

    .product-add-btn::before {
        content: '🛒';
        font-size: 1.5rem;
    }

    /* Уменьшаем расстояние в счётчике */
    #productOptions .cart-quantity-controls,
    .modal-body .cart-quantity-controls {
        gap: 4px !important;
    }
    
    .modal-body .quantity-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 1rem !important;
    }
    
    .modal-body .quantity-value {
        min-width: 30px !important;
        font-size: 0.9rem !important;
    }
    
    /* Кнопка "В корзину" в модальном окне -> только иконка 🛒 */
    .modal-body .btn-primary-custom {
        font-size: 0 !important;
        width: 75px !important;
        height: 44px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        min-width: 44px !important;
    }
    
    .modal-body .btn-primary-custom::before {
        content: '🛒';
        font-size: 1.5rem !important;
    }

    .cart-container {
        padding: 16px;
    }

    .cart-total {
        font-size: 1.25rem;
        padding: 12px 20px;
    }
    
    /* Кнопка корзины в шапке -> только иконка 🛒 и badge */
    .header-right .cart-link {
        font-size: 0 !important;
        width: 44px !important;
        height: 44px !important;
        padding-left: 5px !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        position: relative !important;
    }
    
    .header-right .cart-link::before {
        content: '🛒';
        font-size: 1.5rem !important;
    }
    
    .header-right .cart-badge {
        position: absolute !important;
        top: -4px !important;
        right: -4px !important;
        min-width: 20px !important;
        height: 20px !important;
        font-size: 0.75rem !important;
        padding: 2px 4px !important;
    }
    
    /* Убираем padding в блоке опций */
    #optionsContainer {
        padding: 0px !important;
    }
    
    /* Показываем телефон и время работы в шапке */
    .header-right {
        justify-content: flex-start !important;
        gap: 12px !important;
    }
    
    .header-right .header-mobile-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        order: 1 !important;
    }
    
    /* Кнопка «Войти / Кабинет» -> компактная, только иконка 👤, как корзина */
    .header-right .account-link {
        order: 2 !important;
        font-size: 0 !important;
        width: 44px !important;
        height: 44px !important;
        min-height: 0 !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        flex-shrink: 0 !important;
        background: var(--bg-active) !important;
        border: 2px solid var(--border-color) !important;
        border-radius: 50% !important;
        box-shadow: none !important;
    }
    
    .header-right .account-icon {
        width: 20px !important;
        height: 20px !important;
        color: var(--text-primary) !important;
    }

    .header-right .account-link .account-label {
        display: none !important;
    }

    .header-right .account-avatar {
        width: 100% !important;
        height: 100% !important;
        border: none !important;
        border-radius: 50% !important;
    }
    
    .header-right .cart-link {
        order: 3 !important;
    }
    
    .header-right .mobile-phone {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        color: var(--text-primary) !important;
        white-space: nowrap !important;
    }
    
    .header-right .mobile-hours {
        font-size: 0.68rem !important;
    }
}

/* Кнопка подтверждения заказа на checkout: 280px на десктопе, на всю ширину на мобильных */
.checkout-confirm-btn {
    min-width: 280px;
}

/* ≤430px и ниже: кнопка подтверждения заказа — на всю ширину */
@media (max-width: 430px) {
    .checkout-confirm-btn {
        width: 100% !important;
        min-width: 0 !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}

/* 516px и ниже: кнопка корзины — только иконка, чтобы телефон не наезжал на лого */
@media (max-width: 516.98px) {
    .header-right .cart-link {
        font-size: 0 !important;
        width: 44px !important;
        height: 44px !important;
        padding-left: 5px !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        position: relative !important;
        order: 3 !important;
        flex-shrink: 0 !important;
    }

    .header-right .cart-link::before {
        content: '🛒';
        font-size: 1.5rem !important;
    }

    .header-right .cart-badge {
        position: absolute !important;
        top: -4px !important;
        right: -4px !important;
        min-width: 20px !important;
        height: 20px !important;
        font-size: 0.75rem !important;
        padding: 2px 4px !important;
    }

    .header-right {
        justify-content: flex-start !important;
        gap: 10px !important;
    }

    .header-right .mobile-phone {
        font-size: 0.75rem !important;
    }

    .header-right .mobile-hours {
        font-size: 0.68rem !important;
    }
}

/* Маленькие телефоны (481px - 587px) */
@media (min-width: 481px) and (max-width: 587.98px) {
    /* Настройки для маленьких телефонов */
    
    /* Кнопка "В корзину" -> только иконка 🛒 */
    .product-add-btn {
        font-size: 0;
        width: 40px;
        height: 40px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-card);
        border: 2px solid var(--border-color);
        color: var(--text-primary);
        box-shadow: var(--shadow-sm);
        border-radius: var(--radius-xl);
    }

    .product-add-btn:hover {
        background: var(--bg-active);
        color: var(--text-primary);
        transform: scale(1.05);
        animation: none;
    }
    
    .product-add-btn::before {
        content: '🛒';
        font-size: 1.5rem;
    }
    
    .add-to-cart-form button {
        min-width: 80px !important;
    }
    
    /* Скрываем счётчик в шапке модального окна */
    .modal-header .cart-quantity-controls {
        display: none !important;
    }
    
    /* Уменьшаем счётчик в блоке опций */
    #productOptions .cart-quantity-controls {
        gap: 4px !important;
    }
    
    #productOptions .quantity-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 1rem !important;
    }
    
    #productOptions .quantity-value {
        min-width: 30px !important;
        font-size: 0.9rem !important;
    }
}

/* Телефоны (588px - 767px) */
@media (min-width: 588px) and (max-width: 767.98px) {
    /* Скрываем счётчик в шапке модального окна */
    .modal-header .cart-quantity-controls {
        display: none !important;
    }
    
    /* Уменьшаем счётчик в блоке опций */
    #productOptions .cart-quantity-controls {
        gap: 6px !important;
    }
    
    #productOptions .quantity-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 1rem !important;
    }
    
    #productOptions .quantity-value {
        min-width: 35px !important;
        font-size: 1rem !important;
    }
}

/* Граница md/lg (768-991px) - фиксируем модальное окно товара */
@media (min-width: 768px) and (max-width: 991px) {
    /* Увеличиваем модальное окно */
    .modal-lg {
        max-width: 900px !important;
    }

    /* Скрываем счётчик в шапке модального окна */
    .modal-header .cart-quantity-controls {
        display: none !important;
    }

    /* Показываем счётчик в блоке опций */
    #productOptions .cart-quantity-controls {
        gap: 8px !important;
        display: flex !important;
        margin-top: 12px !important;
        justify-content: flex-end !important;
    }

    #productOptions .quantity-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }

    #productOptions .quantity-value {
        min-width: 35px !important;
        font-size: 1rem !important;
    }

    /* Изображение на всю ширину */
    .modal-body .col-md-6:first-child {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Контент под изображением на всю ширину */
    .modal-body .col-md-6:last-child {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-top: 20px !important;
    }
}

/* Маленькие телефоны (360px) */
@media (max-width: 360px) {
    .navbar-brand img {
        height: 26px;
    }

    .header-right .mobile-hours {
        font-size: 0.6rem !important;
        line-height: 1.2 !important;
    }

    .header-right .mobile-phone {
        font-size: 0.7rem !important;
    }

    .header-right .cart-link,
    .header-right .account-link {
        width: 40px !important;
        height: 40px !important;
        min-height: 0 !important;
    }

    .shop-title {
        font-size: 1.25rem;
    }

    .main-container {
        padding: 12px 8px;
    }

    .category-section-title {
        font-size: 1.1rem;
    }
}

/* ===================================
   Утилиты
   =================================== */

.text-color-primary {
    color: var(--text-primary) !important;
}

.text-color-secondary {
    color: var(--text-secondary) !important;
}

.bg-primary-custom {
    background-color: var(--bg-card) !important;
}

.shadow-custom {
    box-shadow: var(--shadow-md) !important;
}

.rounded-custom {
    border-radius: var(--radius-lg) !important;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 1.25rem;
    margin-bottom: 24px;
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.no-products-icon {
    font-size: 5rem;
    margin-bottom: 16px;
}

.no-products-text {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ===================================
   РЕБРЕНДИНГ: ШАПКА И ФУТЕР
   тёплый градиент + золотое свечение (в стиле карточек и модалки)
   =================================== */

.header-top {
    background:
        radial-gradient(130% 130% at 100% 0%, rgba(242, 201, 76, 0.1) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, #fffdf6 0%, #f7ecd8 100%) !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-image: linear-gradient(90deg, #8b5a2b 0%, #B57D3E 25%, #F2C94C 50%, #B57D3E 75%, #8b5a2b 100%) 1;
    box-shadow: 0 4px 20px rgba(108, 67, 32, 0.12) !important;
}

/* Поиск: кнопка в золотом градиенте, тёплое свечение при фокусе */
.search-btn-modern {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%) !important;
    color: #3d2408 !important;
    box-shadow: 0 4px 14px rgba(240, 150, 30, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
.search-btn-modern:hover {
    background: linear-gradient(135deg, #FFDF6B 0%, #F8AE33 55%, #E5821F 100%) !important;
    box-shadow: 0 8px 22px rgba(240, 150, 30, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
.search-input-modern:focus {
    border-color: #F2C94C !important;
    box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.25) !important;
}

/* Корзина: тёплый градиент-стекло, золотое свечение при ховере */
.cart-link {
    background: linear-gradient(135deg, #fffdf6 0%, #f8e9cf 100%) !important;
    border: 2px solid rgba(181, 125, 62, 0.55) !important;
    color: #4d2e17 !important;
    box-shadow: 0 2px 10px rgba(108, 67, 32, 0.08) !important;
}
.cart-link:hover {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%) !important;
    border-color: #F5A623 !important;
    color: #3d2408 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 24px rgba(240, 150, 30, 0.45) !important;
}
.cart-badge {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%) !important;
    color: #3d2408 !important;
    box-shadow: 0 2px 8px rgba(240, 150, 30, 0.5) !important;
}

/* Кабинет: золотой градиент CTA */
.account-link {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%) !important;
    border: none !important;
    color: #3d2408 !important;
    box-shadow: 0 6px 18px rgba(240, 150, 30, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
.account-link:hover {
    background: linear-gradient(135deg, #FFDF6B 0%, #F8AE33 55%, #E5821F 100%) !important;
    transform: translateY(-2px) !important;
    color: #3d2408 !important;
    box-shadow: 0 12px 28px rgba(240, 150, 30, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
.account-icon {
    color: #3d2408 !important;
}
.account-avatar {
    border-color: rgba(255, 255, 255, 0.9) !important;
}

/* Мобильные кнопки шапки: тоже золото */
.header-right .account-link {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%) !important;
    border: none !important;
    color: #3d2408 !important;
    box-shadow: 0 4px 14px rgba(240, 150, 30, 0.4) !important;
}
.header-right .account-icon {
    color: #3d2408 !important;
}

.mobile-menu-btn {
    background: linear-gradient(135deg, #fffdf6 0%, #f8e9cf 100%) !important;
    border: 2px solid rgba(181, 125, 62, 0.55) !important;
}
.mobile-menu-btn:hover {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%) !important;
}

/* ===================================
   Футер: тёмный шоколадный градиент + золотая линия сверху
   =================================== */

.site-footer {
    background: linear-gradient(135deg, #241505 0%, #3a2210 50%, #5a3a1b 100%);
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, #8b5a2b 0%, #B57D3E 25%, #F2C94C 50%, #B57D3E 75%, #8b5a2b 100%) 1;
    padding: 32px 0;
    margin-top: 48px;
    box-shadow: 0 -10px 30px rgba(43, 26, 10, 0.25);
}

.footer-flex {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: 48px;
}

.footer-brand {
    text-align: left;
}

.footer-brand-title {
    color: #FFE9C2;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.footer-brand-copy {
    color: rgba(255, 233, 194, 0.6);
    font-size: 0.9rem;
    margin: 4px 0 0;
}

.footer-col {
    text-align: left;
}

.footer-col-title {
    color: #FFC96B;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.footer-col-item {
    margin: 6px 0;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #FFE9C2;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.25s ease, transform 0.25s ease, text-shadow 0.25s ease;
}

.footer-link:hover {
    color: #FFD447;
    transform: translateY(-1px);
    text-shadow: 0 0 18px rgba(255, 212, 71, 0.35);
}

/* Виджет 2ГИС в подвале */
.footer-2gis-widget {
    /* frameborder устарел в HTML5, рамку задаём через CSS */
    border: 0;
    display: block;
    border-radius: 4px;
}

/* ===================================
   РЕБРЕНДИНГ: КОРЗИНА И КНОПКИ
   тёплый градиент + золотое свечение
   =================================== */

.cart-container {
    background: linear-gradient(180deg, #fffdf6 0%, #fdf3e1 100%);
    border: 1px solid rgba(135, 95, 45, 0.12);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(80, 48, 16, 0.12), 0 0 0 1px rgba(255, 212, 71, 0.18);
}

.cart-table th {
    background: linear-gradient(135deg, #5a3a1b 0%, #8b5a2b 100%);
    color: #FFE9C2;
    border-bottom: none;
    box-shadow: 0 4px 14px rgba(60, 35, 10, 0.18);
}

.cart-table tbody tr {
    background-image: radial-gradient(circle, rgba(181, 125, 62, 0.35) 2.5px, transparent 2.5px);
    background-position: bottom;
    background-size: 10px 5px;
    background-repeat: repeat-x;
}

.cart-quantity-controls .quantity-btn {
    border: 2px solid rgba(181, 125, 62, 0.5);
    background: linear-gradient(135deg, #fffdf6 0%, #f8e9cf 100%);
    color: #4d2e17;
    box-shadow: 0 2px 8px rgba(108, 67, 32, 0.08);
}
.cart-quantity-controls .quantity-btn:hover {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%);
    color: #3d2408;
    /* Рамку оставляем цветной, а не transparent: у прозрачной границы
       внутренний край скругляется по радиусу padding-box, а фон — по
       радиусу border-box, и на круге шов расходится. */
    border-color: rgba(224, 123, 26, 0.85);
    box-shadow: 0 6px 16px rgba(240, 150, 30, 0.45);
}

.cart-quantity-controls .quantity-value {
    color: #4d2e17;
}

.cart-action-cell .btn-danger {
    background: linear-gradient(135deg, #fffdf6 0%, #f8e9cf 100%) !important;
    border: 2px solid rgba(192, 57, 43, 0.35) !important;
    color: #c0392b !important;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.15) !important;
}
.cart-action-cell .btn-danger:hover {
    background: linear-gradient(135deg, #e35d5b 0%, #c0392b 100%) !important;
    color: #fff !important;
    border-color: rgba(192, 57, 43, 0.85) !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 20px rgba(192, 57, 43, 0.4) !important;
}

.cart-summary {
    background: linear-gradient(180deg, #fffdf6 0%, #fdf3e1 100%);
    border: 1px solid rgba(135, 95, 45, 0.14);
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(80, 48, 16, 0.1);
}

.cart-summary-label {
    color: #96663a;
}

.cart-summary-amount {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(240, 150, 30, 0.35));
}

/* Кнопки: первичные — золотой градиент, вторичные — тёплое стекло */
.btn-primary-custom {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%) !important;
    color: #3d2408 !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(240, 150, 30, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
.btn-primary-custom:hover {
    background: linear-gradient(135deg, #FFDF6B 0%, #F8AE33 55%, #E5821F 100%) !important;
    color: #3d2408 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(240, 150, 30, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    animation: none !important;
}

.btn-secondary-custom {
    background: linear-gradient(135deg, #fffdf6 0%, #f8e9cf 100%) !important;
    color: #4d2e17 !important;
    border: 2px solid rgba(181, 125, 62, 0.55) !important;
    box-shadow: 0 2px 6px rgba(108, 67, 32, 0.2) !important;
}
.btn-secondary-custom:hover {
    background: linear-gradient(135deg, #FFD447 0%, #F5A623 55%, #E07B1A 100%) !important;
    color: #3d2408 !important;
    /* Рамку оставляем цветной, а не transparent: у прозрачной границы
       внутренний край имеет радиус R − 2px, тогда как фон и тень — R.
       Из-за этого закругление границы и заливки расходилось. */
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 14px rgba(240, 150, 30, 0.55) !important;
    animation: none !important;
}
