/* Палитра: тёмный синевато-серый, тёмный бордо, пыльная роза, тёмный бирюзовый */
:root {
    --color-bg-dark: #1C3334;
    --color-bg-mid: #2F4454;
    --color-maroon: #2E151B;
    --color-accent: #DA7B93;
    --color-teal: #376E6F;
    --color-accent-hover: #c96b82;
    --color-accent-soft: rgba(218, 123, 147, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f5f6f8;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Хлебные крошки: все уровни — ссылки на внутренний каталог */
.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: #666;
}
.breadcrumb a {
    color: var(--color-teal);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}
.breadcrumb a.breadcrumb-current {
    font-weight: 600;
    color: var(--color-bg-dark);
}

/* Flash messages */
.flash-message {
    padding: 1rem 2rem;
    margin: 1.5rem auto;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
    max-width: 800px;
}

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

.flash-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.flash-message.error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

/* Header — двухуровневый, в стиле крупных маркетплейсов */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
@media (max-width: 768px) {
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    .main-content {
        padding-top: 110px;
    }
}

/* Верхняя полоска: аккаунт */
.header-top {
    background: var(--color-bg-mid);
    color: rgba(255,255,255,0.95);
    font-size: 0.8125rem;
    min-height: 32px;
}

.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
}

.header-top-tagline {
    color: rgba(255,255,255,0.85);
}

.header-top-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-top-nav a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    transition: color 0.2s;
}

.header-top-help {
    display: none;
}

.header-top-nav a:hover {
    color: #fff;
}

/* Основная панель: логотип, поиск, навигация */
.header-main {
    background: #fff;
    padding: 0.75rem 0;
}

.header-main-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-logo-search-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-logo img {
    display: block;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
}

/* Поиск: единый блок с рамкой и тенью */
.header-search {
    display: flex;
    flex: 1;
    max-width: 560px;
    min-width: 0;
    height: 44px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.header-search:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.header-search-cat {
    padding: 0 1rem;
    border: none;
    background: #fafafa;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
    border-right: 1px solid #eee;
    min-width: 0;
}

.header-search-input {
    flex: 1;
    padding: 0 1rem;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    min-width: 0;
}

.header-search-input::placeholder {
    color: #9e9e9e;
}

.header-search-btn {
    padding: 0 1.25rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.header-search-btn:hover {
    background: var(--color-accent-hover);
}

/* Навигационные ссылки */
.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.header-nav-link {
    color: #333;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

.header-nav-link:hover {
    color: var(--color-accent);
}

.header-nav-link-msg {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.header-msg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    background: var(--color-accent);
    color: #fff;
    border-radius: 10px;
    margin-left: 2px;
}

/* Корзина: счётчик и мини-корзина */
.header-cart-wrap {
    position: relative;
    display: inline-flex;
}
.header-cart-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 0;
    text-decoration: none;
}
.header-cart-trigger:hover {
    text-decoration: underline;
}
.header-nav-link-cart {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.header-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    background: var(--color-accent);
    color: #fff;
    border-radius: 9px;
}
.header-mini-cart {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 320px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 0.75rem;
    z-index: 100;
}
.header-mini-cart[aria-hidden="true"] {
    display: none;
}
.mini-cart-items {
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}
.mini-cart-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}
.mini-cart-item:last-child {
    border-bottom: none;
}
.mini-cart-item-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.mini-cart-item-placeholder {
    width: 48px;
    height: 48px;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.mini-cart-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.mini-cart-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-cart-item-qty {
    font-size: 0.85rem;
    color: #666;
}
.mini-cart-total {
    padding: 0.5rem 0;
    font-size: 1rem;
    border-top: 1px solid #eee;
}
.mini-cart-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.6rem 1rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.5rem;
    transition: background 0.2s;
}
.mini-cart-btn:hover {
    background: #6d3410;
    color: #fff;
}
.mini-cart-empty {
    margin: 0 0 0.5rem;
    color: #666;
    font-size: 0.95rem;
}

/* Пользователь: выпадающее меню */
.header-user {
    position: relative;
    flex-shrink: 0;
}

.header-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.header-user-trigger:hover {
    border-color: var(--color-accent);
    background: #fafafa;
}

.header-user-name {
    font-weight: 500;
}

.header-user-chevron {
    transition: transform 0.2s;
}

.header-user-trigger[aria-expanded="true"] .header-user-chevron {
    transform: rotate(180deg);
}

.header-user-dropdown[hidden] {
    display: none;
}

.header-user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 0.5rem 0;
    z-index: 100;
}

.header-user-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background 0.2s;
}

.header-user-dropdown a:hover {
    background: #f5f5f5;
}

/* Кнопки входа/регистрации в основной панели */
.header-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-auth-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.header-auth-login {
    color: #333;
    border: 1px solid #e0e0e0;
    background: #fff;
}

.header-auth-login:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.header-auth-register {
    background: var(--color-accent);
    color: #fff;
    border: 1px solid var(--color-accent);
}

.header-auth-register:hover {
    background: #c62828;
}

.push-toast {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #2e7d32;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 0.95rem;
    font-weight: 500;
    animation: pushToastIn 0.3s ease-out;
}
@keyframes pushToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.banner-content {
    max-width: 800px;
    margin: 0 auto;
}

.banner-content h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.banner-content p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
}

.banner-btn {
    background: var(--color-accent);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.banner-btn:hover {
    background: #A0522D;
}

/* Special Offers */
.special-offers {
    padding: 2rem 0;
    background: #fff8e1;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h2 {
    color: var(--color-accent);
    font-size: 1.8rem;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.offer-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.offer-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.offer-card-link:hover .offer-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

.offer-img {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-bottom: 1px solid #eee;
}

.offer-img img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-placeholder {
    font-size: 3rem;
    color: #ccc;
}

.offer-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.offer-info h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    display: block;
    min-height: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.offer-info p {
    color: #666;
    margin-bottom: auto;
    font-size: 0.9rem;
    flex: 1;
}

.offer-price-container {
    margin-top: auto;
    padding-top: 0.5rem;
}

.offer-price {
    background: #FFD700;
    color: #333;
    padding: 0.5rem;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
}

.offer-price-old {
    text-align: center;
    margin-bottom: 0.25rem;
}

.price-old-value {
    color: #999;
    font-size: 0.9rem;
    text-decoration: line-through;
    text-decoration-color: #c62828;
    text-decoration-thickness: 2px;
}

.offer-price-new {
    background: #c62828;
    color: #fff;
    padding: 0.5rem;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
}

.offers-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.offers-empty .btn-primary {
    margin-top: 1rem;
    display: inline-block;
}

/* Categories */
.categories {
    padding: 3rem 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
}

/* Products */
.featured-products {
    padding: 3rem 0;
    background: white;
    margin: 3rem 0;
}

.featured-products h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-accent);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Сетка в стиле Amazon: базово 4 колонки, равная высота карточек */
.product-grid-amazon {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}
/* На главной хотим 6 карточек в ряд на широких экранах */
.featured-products .product-grid-amazon {
    grid-template-columns: repeat(6, 1fr);
}
@media (max-width: 1100px) {
    .product-grid-amazon { grid-template-columns: repeat(3, 1fr); }
    .featured-products .product-grid-amazon { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .product-grid-amazon { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .featured-products .product-grid-amazon { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}
/* На мобильной оставляем 2 товара в строке (на очень узких экранах тоже) */
@media (max-width: 480px) {
    .product-grid-amazon { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .featured-products .product-grid-amazon { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

/* Карточка в стиле Amazon: колонка, равная высота, кликабельное фото и заголовок */
.product-card-amazon {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e5e5;
    transition: box-shadow 0.2s;
}
.product-card-amazon:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-card-amazon .product-card-image-wrap {
    position: relative;
}

.product-card-amazon .product-card-image-link {
    display: block;
    padding: 1rem;
    background: #fff;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card-amazon .product-card-image-link img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}
.product-card-amazon .product-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #f5f5f5;
}

.product-card-amazon .product-card-badges {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    max-width: 80%;
    padding: 0.35rem 0.6rem;
    background: #c62828;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.3;
    border-radius: 6px;
}
.product-card-amazon .product-card-badge-line {
    display: block;
    margin-bottom: 0.15rem;
}
.product-card-amazon .product-card-badge-line:last-child {
    margin-bottom: 0;
}

.product-card-amazon .product-card-favorite-form {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}
.product-card-amazon .product-card-favorite-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: rgba(0,0,0,0.35);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: color 0.2s, transform 0.15s;
}
.product-card-amazon .product-card-favorite-btn:hover {
    color: #e6a800;
    transform: scale(1.1);
}
.product-card-amazon .product-card-favorite-btn.is-favorite {
    color: #e6a800;
}

.product-card-amazon .product-card-body {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.product-card-amazon .product-card-title {
    font-size: 1rem;
    line-height: 1.35;
    color: #007185;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.35rem;
}
.product-card-amazon .product-card-title:hover {
    color: #c7511f;
    text-decoration: underline;
}

.product-card-amazon .product-card-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem 0.5rem;
    font-size: 0.9rem;
    color: #565959;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}
.product-card-amazon .product-card-rating-stars {
    color: #e6a800;
}
.product-card-amazon .product-card-rating-value {
    font-weight: 600;
    color: #0f1111;
}
.product-card-amazon .product-card-rating-count {
    color: #565959;
}

.product-card-amazon .product-card-desc {
    font-size: 0.85rem;
    color: #565959;
    margin: 0 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-card-amazon .product-card-price {
    font-size: 1.1rem;
    color: #0f1111;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.product-card-amazon .product-card-price strong.product-card-price-current {
    color: #b12704;
}
.product-card-amazon .product-card-price-old {
    font-family: inherit;
    font-size: 90%;
    font-weight: inherit;
    color: #565959;
    text-decoration: line-through;
}
.product-card-amazon .product-card-price-extra {
    display: block;
    font-size: 0.75rem;
    color: #565959;
    font-weight: normal;
    margin-top: 0.35rem;
    line-height: 1.35;
}

.product-card-amazon .product-card-actions-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-top: auto;
    margin-bottom: 0;
    padding-top: 0.5rem;
    min-height: 40px;
}
.product-card-amazon .product-card-form {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
}
.product-card-amazon .product-card-btn-cart {
    width: 100%;
    height: 40px;
    min-height: 40px;
    flex: 1;
    margin: 0;
    padding: 0;
    background: #ffd814;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f1111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background 0.2s;
}
.product-card-amazon .product-card-btn-cart:hover {
    background: #f7ca00;
}

.product-card-btn-added,
.product-btn-add.added,
button.product-card-btn-cart.product-card-btn-added {
    background: #2e7d32 !important;
    color: #fff !important;
    cursor: default;
}

.product-card-amazon .product-card-btn-info {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    margin: 0;
    margin-top: 10px;
    padding: 0;
    align-self: stretch;
    background: #007185;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    font-style: italic;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background 0.2s;
}
.product-card-amazon .product-card-btn-info:hover {
    background: #005f6b;
    color: #fff;
}

/* Старые карточки (если без -amazon) */
.product-card .product-card-form,
.product-card .product-card-actions {
    margin: 0.5rem 1rem 0;
    display: block;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #ffecb3;
}

.product-card h3 {
    padding: 1rem;
    font-size: 1.1rem;
}

.product-desc {
    padding: 0 1rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.product-price {
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price {
    color: var(--color-accent);
    font-weight: bold;
}

.btn-secondary {
    display: block;
    width: calc(100% - 2rem);
    margin: 1rem;
    padding: 0.8rem;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #A0522D;
}

/* Универсальные кнопки */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
    color: #fff;
}
.btn-secondary {
    width: auto;
    margin: 0;
    display: inline-block;
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-bg-mid) 100%);
    color: #fff;
}
.btn-cart {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
    color: #fff;
    width: 100%;
    padding: 0.65rem 1rem;
}
.btn-cart:hover {
    background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
    color: #fff;
}
.btn-outline {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    margin-top: 0.4rem;
    width: 100%;
    display: block;
    padding: 0.6rem 1rem;
    box-sizing: border-box;
}
.btn-outline:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

/* Footer — цвета/размеры могут переопределяться из настроек (CSS-переменные) */
.site-footer,
footer {
    padding: 3rem 0;
    margin-top: auto;
}

.site-footer .footer-section h3,
.footer-section h3 {
    font-size: var(--footer-heading-size, 1.3rem);
    margin-bottom: 1rem;
    color: var(--footer-heading-color, var(--color-accent));
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    font-size: var(--footer-item-size, 1rem);
}

.footer-section a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--footer-link-hover, var(--color-accent));
}

.footer-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 0.5rem;
}
.footer-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 180px;
}
.footer-trust-icon {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}
.footer-trust-item a {
    color: var(--footer-heading-color, var(--color-accent));
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
}
.footer-trust-item a:hover {
    text-decoration: underline;
}
.footer-trust-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    margin-top: 0.25rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.footer-bottom p {
    font-size: var(--footer-copyright-size, 0.9rem);
    color: rgba(255,255,255,0.8);
    margin: 0;
}

/* Бургер и нижняя панель — только на мобильных */
.header-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
}
.header-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    margin: 0 auto;
    transition: transform 0.2s, opacity 0.2s;
}
.header-burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.header-burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.header-burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    z-index: 999;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    text-decoration: none;
    color: #666;
    font-size: 0.7rem;
    position: relative;
    min-width: 64px;
}
.bottom-nav-item:hover, .bottom-nav-item:active {
    color: var(--color-accent);
}
.bottom-nav-icon {
    font-size: 1.35rem;
    margin-bottom: 2px;
}
.bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translate(50%, -50%);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .header-burger { display: none !important; }
    .header-top-help { display: inline-block; }
    .header-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: #fff;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        flex-direction: column;
        align-items: stretch;
        padding: 4rem 1rem 1rem;
        z-index: 1001;
        transition: right 0.25s ease;
        overflow-y: auto;
    }
    .header-nav.is-open { right: 0; }
    .header-nav .header-nav-link,
    .header-nav .header-cart-trigger {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #eee;
        justify-content: flex-start;
    }
    .header-nav .header-cart-wrap { position: static; }
    .header-mini-cart {
        position: static;
        width: 100%;
        max-width: none;
        margin-top: 0.5rem;
        box-shadow: none;
        border: 1px solid #eee;
    }
    .header-user, .header-auth { display: none !important; }
    .bottom-nav { display: flex; }
    .main-content { padding-bottom: 72px; }
    .header-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.25s;
    }
    .header-nav-overlay.is-visible {
        display: block;
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 992px) {
    .header-main-inner {
        flex-wrap: wrap;
    }
    .header-search {
        order: 3;
        max-width: none;
        width: 100%;
    }
    .header-nav {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-top-tagline {
        display: none;
    }
    .header-top-inner {
        justify-content: center;
    }
    .header-top-nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }
    .header-top-nav a {
        font-size: 0.8rem;
    }
    .header-top-nav a.header-top-favorites {
        display: none !important;
    }
    .header-main-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    /* Лого и поиск в одну строку: лого слева, поиск справа */
    .header-logo-search-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        order: 0;
    }
    .header-logo {
        justify-content: flex-start;
        flex-shrink: 0;
    }
    .header-logo img {
        max-height: 40px;
    }
    .header-search-wrap {
        flex: 1;
        min-width: 0;
    }
    /* В мобильной версии оставляем только строку поиска — категории уже отображаются в блоке ниже */
    .header-search-cat {
        display: none !important;
    }
    .header-search {
        order: 0;
        border-left: 1px solid #eee;
    }
    .header-nav {
        justify-content: center;
        flex-wrap: wrap;
    }
    .header-user,
    .header-auth {
        justify-content: center;
    }
    .header-user-dropdown {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    .banner-content h1 {
        font-size: 1.8rem;
    }
}

/* Очень узкие экраны: отступы и удобные зоны нажатия */
@media (max-width: 480px) {
    .container {
        padding-left: 14px;
        padding-right: 14px;
    }
    .header-top-nav a,
    .header-nav-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 0 6px;
    }
    .header-search-btn {
        min-width: 44px;
        min-height: 44px;
    }
    .product-card-amazon .product-card-btn-cart,
    .product-card-amazon .product-card-btn-info {
        min-height: 44px;
    }
}

/* Блок категорий и карусели */
.categories-carousel-section {
    margin: 2rem 0;
}

.categories-carousel-wrapper {
    display: flex;
    gap: 1rem;
    min-height: 500px;
}

/* Блок категорий слева (1/4): без внутренних скроллбаров, листинг вниз как на WB */
.categories-sidebar {
    width: 25%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.categories-sidebar-header {
    background: var(--color-teal);
    color: #fff;
    padding: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.categories-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.categories-sidebar-list {
    flex: 1;
    min-height: 200px;
    /* без max-height и overflow — категории и подкатегории листингом вниз, без бегунков */
}

.category-sidebar-item {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.category-sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
    gap: 0.75rem;
}

.category-sidebar-link:hover {
    background: #f8f8f8;
}

.category-sidebar-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.category-sidebar-name {
    flex: 1;
    font-size: 0.95rem;
}

.category-sidebar-arrow {
    color: #999;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Выпадающая панель подкатегорий в рабочей зоне справа — листинг вниз без скроллбара внутри (как WB) */
.category-subcategories {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    width: 320px;
    min-width: 280px;
    background: #fff;
    box-shadow: 2px 2px 12px rgba(0,0,0,0.15);
    border-radius: 0 8px 8px 0;
    z-index: 100;
    /* без max-height и overflow — подкатегории полным списком вниз */
}

.category-sidebar-item:hover .category-subcategories {
    display: block;
}

/* Открытие подкатегорий по классу (для мобильного: первый тап раскрывает, второй ведёт по ссылке) */
.category-sidebar-item.is-open .category-subcategories {
    display: block;
}

.category-subcategory-group {
    position: relative;
}

.category-subcategories-scroll {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.category-subcategory-group {
    display: flex;
    flex-direction: column;
}

.category-subcategory-item {
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    transition: background 0.2s;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-subcategory-item:hover {
    background: #f8f8f8;
    color: var(--color-accent);
}

.category-subcategory-level2 {
    font-weight: 500;
    background: #fafafa;
}

.category-subcategory-level3 {
    padding-left: 2rem;
    font-size: 0.85rem;
    color: #666;
    font-weight: normal;
}

.category-subcategory-level3:hover {
    background: #f0f0f0;
    color: var(--color-accent);
}

.subcategory-arrow {
    color: #999;
    font-size: 1rem;
    margin-left: 0.5rem;
}

.category-subcategories-level3 {
    display: none;
    flex-direction: column;
    background: #fff;
    border-left: 2px solid #e0e0e0;
    margin-left: 0.5rem;
}

.category-subcategory-group:hover .category-subcategories-level3 {
    display: flex;
}

/* Карусель баннеров справа (3/4) */
.banner-carousel {
    width: 75%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
    min-height: 500px;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: #fff;
    padding: 2rem 1.5rem 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.carousel-btn:hover {
    background: #fff;
}

.carousel-btn-prev {
    left: 1rem;
}

.carousel-btn-next {
    right: 1rem;
}

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background: #fff;
}

.carousel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 500px;
    color: #999;
}

/* Адаптивность */
@media (max-width: 992px) {
    .categories-carousel-wrapper {
        flex-direction: column;
    }
    
    .categories-sidebar {
        width: 100%;
        /* без max-height — подкатегории раскрываются листингом вниз в рабочей поверхности */
    }
    
    .banner-carousel {
        width: 100%;
    }
    
    /* На планшетах/мобиле подкатегории в потоке страницы, листинг вниз (как WB мобильный вид) */
    .category-subcategories {
        position: static;
        width: 100%;
        box-shadow: none;
        border-top: 1px solid #f0f0f0;
    }
    
    .category-sidebar-item:hover .category-subcategories {
        display: block;
    }
}

/* Мобильный вид в стиле Wildberries: пропорциональный баннер, отступы, аккуратная вёрстка */
@media (max-width: 768px) {
    .categories-carousel-section {
        margin: 1rem 0;
    }
    
    .categories-carousel-wrapper {
        gap: 1rem;
    }
    
    .categories-sidebar {
        border-radius: 12px;
        overflow: visible;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }
    
    .banner-carousel {
        min-height: 0;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        background: #f5f5f5;
    }
    
    .carousel-container {
        height: auto;
        aspect-ratio: 16 / 9;
        max-height: 220px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f5f5;
    }
    
    .carousel-slides {
        height: 100%;
    }
    
    .carousel-slide-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
    
    .carousel-image {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        object-position: center;
    }
    
    .carousel-slide-title {
        font-size: 0.9rem;
        padding: 0.6rem 0.75rem 0.5rem;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
    
    .carousel-btn-prev {
        left: 0.5rem;
    }
    
    .carousel-btn-next {
        right: 0.5rem;
    }
    
    .carousel-dots {
        bottom: 0.5rem;
    }
    
    .carousel-dot {
        width: 8px;
        height: 8px;
    }
    
    .carousel-placeholder {
        height: 0;
        min-height: 160px;
        padding: 2rem;
    }
}

/* Уведомление о cookies (баннер внизу экрана) */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.1);
    padding: 1rem 1.25rem;
}
.cookie-consent-inner {
    max-width: 900px;
    margin: 0 auto;
}
.cookie-consent-text {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #333;
}
.cookie-consent-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.cookie-consent-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.cookie-consent-agree {
    background: var(--color-teal);
    color: #fff;
}
.cookie-consent-agree:hover {
    background: #2d5a5b;
}
.cookie-consent-policy {
    background: var(--color-teal);
    color: #fff;
}
.cookie-consent-policy:hover {
    color: #fff;
    background: #2d5a5b;
}
@media (max-width: 768px) {
    .cookie-consent-banner { padding: 1rem; }
    .cookie-consent-text { font-size: 0.85rem; }
    .cookie-consent-buttons { flex-direction: column; }
    .cookie-consent-btn { width: 100%; text-align: center; }
}
