/* ============================================== */
/* === 1. ПЕРЕМЕННЫЕ И БАЗОВЫЕ СТИЛИ === */
/* ============================================== */
:root {
    --primary-blue: #1C2B54;
    --primary-blue-hover: #26386b;
    --accent-red: #DC2626;
    --text-main: #1F2937;
    --text-muted: #4B5563;
    --bg-body: #FFFFFF;
    --bg-light: #F3F4F6;
    --border-color: #E5E7EB;
    --container-width: 1440px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

button {
    font-family: inherit;
}

/* ============================================== */
/* === 2. КОНТЕЙНЕР === */
/* ============================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ============================================== */
/* === 3. ШАПКА (HEADER) === */
/* ============================================== */
.header {
    background: #fff;
    box-shadow: 0 1px 0 var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* --- Top Bar --- */
.top-bar {
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
    background: #fff;
}

.top-bar__container {
    display: flex;
    justify-content: space-between;
    height: 40px;
    align-items: center;
}

/* --- Location --- */
.location {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-main);
    font-weight: 500;
}

/* --- Nav Menu --- */
.nav-menu {
    display: flex;
    gap: 24px;
}

.nav-menu__link {
    transition: color 0.2s;
}

.nav-menu__link:hover {
    color: var(--primary-blue);
}

.nav-menu__link--accent {
    color: var(--accent-red);
    font-weight: 600;
}

/* --- Main Header --- */
.main-header {
    padding: 16px 0;
    transition: all 0.2s;
}

.main-header__container {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* --- Burger --- */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
    color: var(--primary-blue);
    border: none;
    background: transparent;
    padding: 0;
    margin-right: 12px;
    cursor: pointer;
}

.burger__line {
    width: 20px;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
}

.burger__line--short {
    width: 16px;
}

/* --- Logo --- */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
    flex-shrink: 0;
}

.logo__icon {
    width: 32px;
    height: 32px;
    background-color: var(--primary-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.logo__text {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

/* --- Catalog Button --- */
.catalog-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.catalog-btn:hover {
    background-color: var(--primary-blue-hover);
}

.catalog-btn__icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.catalog-btn__line {
    display: block;
    width: 16px;
    height: 2px;
    background-color: #fff;
    border-radius: 1px;
}

/* --- Search --- */
.search {
    flex-grow: 1;
    max-width: 600px;
}

.search__form {
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 6px 16px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.search__form:focus-within {
    background-color: #fff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(28, 43, 84, 0.1);
}

.search__input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 15px;
    outline: none;
}

.search__btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
}

/* --- User Actions --- */
.user-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.user-actions__mobile-search {
    display: none;
    background: none;
    border: none;
    padding: 0;
    color: var(--primary-blue);
    cursor: pointer;
}

/* --- Action Link --- */
.action-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-main);
    position: relative;
}

.action-link:hover {
    color: var(--primary-blue);
}

.action-link__icon-wrapper {
    position: relative;
    display: flex;
}

.action-link__icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.action-link__badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background-color: var(--accent-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    height: 16px;
    min-width: 16px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.action-link__label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================== */
/* === 4. ОСНОВНОЙ КОНТЕНТ === */
/* ============================================== */
.main {
    flex: 1;
}

/* --- Breadcrumb --- */
.breadcrumb {
    padding: 20px 0;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb__current {
    color: var(--text-main);
}

/* --- Page Title --- */
.page-title {
    margin: 0 0 24px 0;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.page-title__count {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
}

/* --- Layout Grid --- */
.layout-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    padding-bottom: 80px;
    align-items: start;
}

/* ============================================== */
/* === 5. САЙДБАР === */
/* ============================================== */
.sidebar__section {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.sidebar__section:last-child {
    border: none;
}

.sidebar__title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

/* --- Price Filter --- */
.price-filter__inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.price-filter__input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-main);
}

/* --- Filter List --- */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-main);
}

.filter-list__item:hover {
    color: var(--primary-blue);
}

/* --- Checkbox --- */
.checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #fff;
}

.checkbox--checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox__icon {
    width: 12px;
    height: 12px;
    color: #fff;
    display: none;
}

.checkbox--checked .checkbox__icon {
    display: block;
}

.filter-list__count {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
}

/* --- Sidebar Close Button (mobile) --- */
.sidebar__close-btn {
    display: none;
}

/* --- Mobile Filter Button --- */
.mobile-filter-btn {
    display: none;
}

/* ============================================== */
/* === 6. КАТАЛОГ И ТУЛБАР === */
/* ============================================== */
/* --- Categories Nav --- */
.categories-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-nav::-webkit-scrollbar {
    display: none;
}

.categories-nav__btn {
    background: var(--bg-light);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.2s;
    border: none;
}

.categories-nav__btn:hover {
    background: #e5e7eb;
}

/* --- Catalog Toolbar --- */
.catalog-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    margin-bottom: 24px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.catalog-toolbar::-webkit-scrollbar {
    display: none;
}

/* --- Sort Dropdown --- */
.sort-dropdown {
    position: relative;
    flex-shrink: 0;
}

.sort-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-blue);
    cursor: pointer;
    white-space: nowrap;
    background: #fff;
    border-radius: 6px;
    padding: 4px 0;
    user-select: none;
    border: none;
}

.sort-dropdown__trigger:hover {
    opacity: 0.8;
}

.sort-dropdown__list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 50;
    padding: 8px 0;
    margin-top: 8px;
}

.sort-dropdown__list--active {
    display: block;
}

.sort-dropdown__item {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s;
}

.sort-dropdown__item:hover,
.sort-dropdown__item--selected {
    background: var(--bg-light);
    color: var(--primary-blue);
    font-weight: 500;
}

/* --- Filter Tags --- */
.filter-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    list-style: none;
    flex-wrap: nowrap;
}

.filter-tags__item {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-light);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-tags__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    color: #9ca3af;
    margin-left: 6px;
}

.filter-tags__remove:hover {
    color: var(--accent-red);
}

/* ============================================== */
/* === 7. КАТАЛОГ ТОВАРОВ === */
/* ============================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

/* --- Product Card --- */
.product-card {
    background: #fff;
    border-radius: 12px;
    position: relative;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-card__image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
    aspect-ratio: 3/4;
    margin-bottom: 12px;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.product-card__badge--new {
    background: #fff;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-card__badge--sale {
    background: var(--accent-red);
    color: #fff;
}

.product-card__favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    border: none;
}

.product-card__image-wrapper:hover .product-card__favorite {
    opacity: 1;
}

.product-card__price {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.product-card__old-price {
    font-size: 14px;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: line-through;
    margin-left: 8px;
}

.product-card__brand {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.product-card__title {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 8px;
}

.product-card__rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #fbbf24;
}

.product-card__rating-count {
    color: #9ca3af;
}

/* ============================================== */
/* === 8. ПОДВАЛ (FOOTER) === */
/* ============================================== */
.footer {
    border-top: 1px solid #e0e6ed;
    padding-top: 60px;
    padding-bottom: 40px;
    margin-top: 60px;
    background-color: #fff;
}

.footer__top {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 60px;
}

.footer__columns {
    display: flex;
    gap: 30px;
    flex: 1;
}

.footer__column {
    flex: 1;
}

.footer__social {
    flex-shrink: 0;
}

.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
}

/* --- Footer Column --- */
.footer-column__title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--text-main);
}

/* --- Footer Links --- */
.footer-links__item {
    margin-bottom: 12px;
}

.footer-links__link {
    font-size: 13px;
    color: #555;
    transition: color 0.2s;
}

.footer-links__link:hover {
    color: var(--primary-blue);
}

/* --- Social Block --- */
.social-block__title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--text-main);
}

.social-block__icons {
    display: flex;
    gap: 12px;
}

.social-block__link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: opacity 0.2s;
}

.social-block__link:hover {
    opacity: 0.9;
}

/* --- Legal Block --- */
.legal-block {
    max-width: 600px;
}

.legal-block__payments {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    opacity: 0.6;
    filter: grayscale(100%);
}

.legal-block__copyright {
    font-size: 12px;
    color: #4B5563;
    line-height: 1.5;
    margin-top: 10px;
}

/* --- Newsletter --- */
.newsletter {
    width: 320px;
}

.newsletter__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.newsletter__form {
    position: relative;
}

.newsletter__input {
    width: 100%;
    padding: 12px 46px 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.newsletter__input:focus {
    border-color: var(--primary-blue);
}

.newsletter__submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.newsletter__submit:hover {
    background: var(--primary-blue-hover);
}

/* ============================================== */
/* === 9. АДАПТИВ: ПЛАНШЕТЫ === */
/* ============================================== */
@media (max-width: 1200px) {
    .footer__top {
        gap: 25px;
    }

    .footer__columns {
        gap: 25px;
    }
}

@media (max-width: 1024px) {
    .footer__top {
        gap: 20px;
    }

    .footer__columns {
        gap: 20px;
    }

    .footer__bottom {
        gap: 30px;
        align-items: flex-start;
    }

    .newsletter {
        width: 100%;
        max-width: 400px;
    }

    .user-actions {
        gap: 16px;
    }

    .action-link__label {
        display: none;
    }

    .search {
        max-width: 400px;
    }
}

@media (max-width: 900px) {
    .footer__top {
        gap: 30px;
        align-items: flex-start;
    }

    .footer__columns {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 25px 40px;
        flex: 1;
    }

    .footer-column__title,
    .social-block__title {
        font-size: 13px;
        margin-bottom: 14px;
    }

    .footer-links__link {
        font-size: 12px;
    }

    .footer-links__item {
        margin-bottom: 10px;
    }

    .nav-menu {
        gap: 12px;
    }

    .nav-menu__link {
        font-size: 12px;
    }

    .main-header__container {
        gap: 15px;
    }

    .catalog-btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .search {
        max-width: 280px;
    }
}

/* ============================================== */
/* === 10. АДАПТИВ: МОБИЛЬНЫЕ === */
/* ============================================== */
@media (max-width: 768px) {
    /* --- Container --- */
    .container {
        padding: 0 16px;
    }

    /* --- Header --- */
    .top-bar,
    .catalog-btn,
    .search,
    .action-link__label,
    .action-link--compare {
        display: none !important;
    }

    .main-header {
        padding: 0;
        height: 60px;
        display: flex;
        align-items: center;
    }

    .main-header__container {
        width: 100%;
        gap: 10px;
    }

    .burger {
        display: flex;
        order: 1;
    }

    .logo {
        order: 2;
        margin-right: auto;
    }

    .logo__text {
        font-size: 20px;
    }

    .logo__icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .user-actions {
        order: 3;
        gap: 16px;
        margin-left: 0;
    }

    .user-actions__mobile-search {
        display: block;
    }

    .action-link__icon {
        width: 26px;
        height: 26px;
        stroke-width: 2.2;
    }

    .action-link__badge {
        top: -2px;
        right: -6px;
    }

    /* --- Content --- */
    .breadcrumb {
        white-space: nowrap;
        overflow-x: auto;
        padding: 15px 0;
        margin-bottom: 10px;
        scrollbar-width: none;
    }

    .page-title {
        font-size: 22px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 20px;
    }

    .page-title__count {
        font-size: 14px;
    }

    .mobile-filter-btn {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background: #fff;
        border: 1px solid var(--border-color);
        padding: 12px;
        border-radius: 8px;
        font-weight: 600;
        margin-bottom: 24px;
        cursor: pointer;
    }

    /* --- Sidebar --- */
    .layout-grid {
        display: block;
        padding-bottom: 40px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #fff;
        z-index: 2000;
        padding: 20px;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s;
        display: block;
    }

    .sidebar--active {
        transform: translateX(0);
    }

    .sidebar__close-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #eee;
        font-weight: 700;
        font-size: 18px;
        width: 100%;
        background: none;
        border: none;
        border-bottom: 1px solid #eee;
    }

    /* --- Product Grid --- */
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-card__image-wrapper {
        margin-bottom: 8px;
    }

    .product-card__favorite {
        opacity: 1;
        width: 28px;
        height: 28px;
        background: rgba(255, 255, 255, 0.9);
    }

    .product-card__price {
        font-size: 16px;
    }

    .product-card__title {
        font-size: 13px;
        margin-bottom: 4px;
    }

    /* --- Footer --- */
    .footer {
        padding-top: 30px;
        margin-top: 30px;
    }

    .footer__top {
        flex-direction: column;
        gap: 0;
        margin-bottom: 30px;
    }

    .footer__columns {
        display: block;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .footer__column {
        flex: none;
        border-bottom: 1px solid #f3f4f6;
    }

    .footer-column__title {
        padding: 16px 0;
        margin: 0;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .footer-column__title::after {
        content: '';
        width: 8px;
        height: 8px;
        border-right: 2px solid #ccc;
        border-bottom: 2px solid #ccc;
        transform: rotate(45deg);
        transition: transform 0.2s;
        margin-right: 5px;
    }

    .footer__column--active .footer-column__title::after {
        transform: rotate(-135deg);
    }

    .footer-column__list {
        display: none;
        padding-bottom: 20px;
    }

    .footer__column--active .footer-column__list {
        display: block;
    }

    .footer__social {
        padding: 32px 0 16px;
    }

    .social-block__title {
        padding: 0;
        margin: 0 0 12px 0;
    }

    .footer__bottom {
        flex-direction: column-reverse;
        gap: 30px;
        align-items: flex-start;
    }

    .newsletter {
        width: 100%;
    }

    .legal-block__copyright {
        margin-top: 20px;
    }
}
