* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body {
    background: #f0f2f5;
    color: #1d2129;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
header {
    background: #fff;
    border-bottom: 1px solid #e5e0db;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 0;
}
.header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.header-logo img {
    display: block;
    height: 36px;
    width: auto;
}
.header-title {
    flex: 1;
    text-align: center;
    font-size: 2.8rem;
    font-weight: 800;
    color: #9D1C1C;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.header-phone {
    flex-shrink: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1d2129;
    text-decoration: none;
    white-space: nowrap;
    text-align: right;
}
.header-phone:hover {
    color: #9D1C1C;
}
.sub-title {
    text-align: center;
    font-size: 1.1rem;
    color: #3f2e24;
    background: rgba(255, 215, 0, 0.2);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e0db;
}
main {
    padding: 0 1.5rem 2rem;
}
.main-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Полоса превью баннеров */
.banner-wrapper {
    max-width: 1200px;
    margin: 0.8rem auto 0.5rem;
    padding: 0 3rem;
    position: relative;
}
.banner-strip {
    height: 240px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.banner-strip::-webkit-scrollbar {
    display: none;
}
.banner-thumb {
    flex-shrink: 0;
    height: calc(100% - 8px);
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    scroll-snap-align: start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.banner-thumb:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.banner-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    cursor: pointer;
    font-size: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
    line-height: 1;
}
.banner-arrow:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.banner-arrow--left {
    left: 4px;
}
.banner-arrow--right {
    right: 4px;
}

/* Лайтбокс */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.lightbox-overlay.open {
    display: flex;
}
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.lightbox-close:hover {
    opacity: 1;
}

/* Панель управления: табы + поиск в одной строке */
.controls-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.brand-tabs {
    display: flex;
    gap: 0.8rem;
    flex-shrink: 0;
}
.brand-tab {
    padding: 0.7rem 2.5rem;
    border: 2px solid #d0d7e6;
    border-radius: 60px;
    background: #fff;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #4e5a6b;
}
.brand-tab.active {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
    box-shadow: 0 4px 12px rgba(22,119,255,0.3);
}
.brand-tab:hover:not(.active) {
    border-color: #1677ff;
    color: #1677ff;
}
.search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.search-input {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 1.2rem;
    border: 2px solid #d0d7e6;
    border-radius: 60px;
    font-size: 1rem;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus {
    border-color: #1677ff;
}
.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.1rem;
    color: #999;
    line-height: 1;
    user-select: none;
    display: none;
}
.search-clear:hover {
    color: #333;
}
.search-input:not(:placeholder-shown) ~ .search-clear {
    display: block;
}

.group-wrapper {
    margin-bottom: 0.8rem;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid #ede7e1;
}
.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.8rem;
    background: #fcf9f6;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    font-weight: 700;
    font-size: 1.2rem;
    color: #2d1f17;
    border-bottom: 1px solid transparent;
}
.group-header:hover {
    background: #f5eee8;
}
.group-header .arrow {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
    color: #b88d7a;
}
.group-header .arrow.open {
    transform: rotate(180deg);
}
.group-header .count-badge {
    font-size: 0.8rem;
    font-weight: 600;
    background: #e8ddd5;
    color: #4d3a2c;
    padding: 0.1rem 0.9rem;
    border-radius: 30px;
    margin-left: 0.8rem;
}
.group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s ease, padding 0.3s ease;
    padding: 0 1.5rem;
    background: #ffffff;
}
.group-body.open {
    max-height: 20000px;
    padding: 1.5rem 1.5rem 1.8rem;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.4rem;
}
.product-card {
    background: #fefcfb;
    border-radius: 22px;
    padding: 1.2rem 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #f0e8e2;
    height: 100%;
    min-height: 360px;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.12);
}
.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 16px;
    background: #eae3db;
    margin-bottom: 0.6rem;
    flex-shrink: 0;
    padding: 0.5rem;
}
.product-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1f1813;
    line-height: 1.4;
    margin: 0.2rem 0 0.1rem;
    min-height: 3.6rem;
    max-height: 4.8rem;
    overflow: hidden;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    width: 100%;
}
.product-sku {
    font-size: 0.65rem;
    color: #8e7a6a;
    margin-bottom: 0.3rem;
    background: #f0eae4;
    padding: 0.05rem 0.8rem;
    border-radius: 30px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-details {
    margin-top: 0.2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #1d2129;
}
.product-details .stock {
    font-weight: 600;
}
.product-details .sum {
    color: #1677ff;
    font-weight: 700;
}
.old-price {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}
.footer-note {
    margin-top: 2.8rem;
    text-align: center;
    color: #4d3a2c;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.6rem 1.5rem;
    border-radius: 60px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 215, 0, 0.12);
    font-size: 0.9rem;
}
.subgroup-title {
    font-weight: 600;
    font-size: 1rem;
    color: #4d3a2c;
    margin-bottom: 0.6rem;
    border-bottom: 1px dashed #e0d6ce;
    padding-bottom: 0.3rem;
}
.subgroup-title span {
    font-weight: 400;
    font-size: 0.8rem;
    color: #8e7a6a;
}
@media (max-width: 780px) {
    .container { padding: 0 0.8rem; }
    .header-inner { padding: 0.5rem 0; }
    .header-title { font-size: 1.2rem; letter-spacing: 0.5px; }
    .header-logo img { height: 28px; }
    .header-phone { display: none; }
    .sub-title { font-size: 0.85rem; padding: 0.5rem 0.8rem; }
    main { padding: 0 0.8rem 1.5rem; }
    .controls-row { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .brand-tabs { overflow-x: visible; flex-wrap: wrap; justify-content: flex-start; gap: 0.4rem; }
    .brand-tab { flex-shrink: 1; padding: 0.35rem 0.75rem; font-size: 0.8rem; border-width: 1.5px; }
    .search-wrap { min-width: 0; max-width: 100%; }
    .search-input { font-size: 0.9rem; padding: 0.5rem 2.2rem 0.5rem 1rem; max-width: 100%; }
    .banner-wrapper { padding: 0 2rem; }
    .banner-strip { height: 160px; gap: 6px; }
    .banner-thumb { border-radius: 8px; }
    .banner-arrow { width: 32px; height: 32px; font-size: 1rem; }
    .group-wrapper { border-radius: 12px; }
    .group-header { padding: 0.7rem 1rem; font-size: 1rem; }
    .group-body.open { padding: 1rem 1rem 1.3rem; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
    .product-card { padding: 0.8rem 0.5rem; min-height: 280px; border-radius: 16px; }
    .product-title { font-size: 0.72rem; min-height: 2.8rem; max-height: 3.6rem; -webkit-line-clamp: 2; }
    .product-sku { font-size: 0.6rem; }
    .product-details { font-size: 0.78rem; }
    .old-price { font-size: 0.72rem; }
    .lightbox-img { max-width: 95vw; max-height: 70vh; }
    .footer-note { font-size: 0.78rem; }
}

@media (max-width: 480px) {
    .header-title { font-size: 1.1rem; }
}

@media (max-width: 360px) {
    .brand-tab {
        flex: 1 1 calc(50% - 0.4rem);
        text-align: center;
        padding: 0.35rem 0.4rem;
        font-size: 0.75rem;
    }
}