/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-white: #FFFFFF;
    --color-dark-gray: #2D2D2D;
    --color-gold: #D4AF37;
    --color-light-gray: #f5f5f5;
    --color-border: #e0e0e0;
    --color-text: #666;
    --color-error: #dc3545;
    --color-success: #28a745;

    --font-primary: 'Montserrat', sans-serif;
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 18px;
    --font-size-h1: 32px;
    --font-size-h2: 28px;
    --font-size-h3: 24px;

    --transition: all 0.3s ease;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --box-shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--color-dark-gray);
    background-color: var(--color-white);
    line-height: 1.6;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }

p {
    margin-bottom: 1rem;
    color: var(--color-text);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: var(--transition);
}

/* Header */
.header {
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: var(--box-shadow);
    z-index: 1000;
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    flex-direction: row;
}

.header__logo-link {
    font-size: var(--font-size-h3);
    font-weight: 700;
    color: var(--color-dark-gray);
}

.header__nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.header__nav-item {
    position: relative;
}

.header__nav-link--toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.header__nav-caret {
    font-size: 0.85em;
}

.header__nav-submenu {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    min-width: 220px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 0.5rem 0;
    display: none;
    z-index: 1200;
}

.header__nav-item.is-open .header__nav-submenu {
    display: block;
}

.header__nav-sublink {
    display: block;
    padding: 0.65rem 1rem;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
}

.header__nav-sublink:hover {
    background: var(--color-light-gray);
    color: var(--color-gold);
}

.header__nav-link {
    color: var(--color-text);
    font-weight: 500;
    position: relative;
}

.header__nav-link:hover,
.header__nav-link--active {
    color: var(--color-gold);
}

.header__nav-link--active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-gold);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header__search {
    display: flex;
    align-items: center;
    background: var(--color-light-gray);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    min-width: 200px;
    position: relative;
}

.header__search-mobile-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}

.header__search-input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-family: inherit;
}

.header__search-btn {
    color: var(--color-text);
    padding: 0.25rem;
}

.header__search-suggest {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 1500;
    overflow: hidden;
}

.header__search-suggest-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
}

.header__search-suggest-item:hover {
    background: var(--color-light-gray);
}

.header__search-suggest-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 auto;
}

.header__search-suggest-name {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
}

.header__search-suggest-price {
    font-size: 0.9rem;
    color: var(--color-gold);
    font-weight: 600;
}

.header__search-suggest-old {
    font-size: 0.85rem;
    color: var(--color-dark-gray);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.header__favorites {
    position: relative;
    color: var(--color-dark-gray);
    font-size: var(--font-size-large);
}

.header__favorites:hover {
    color: var(--color-gold);
}

.header__cart {
    position: relative;
    color: var(--color-dark-gray);
    font-size: var(--font-size-large);
}

.header__cart:hover {
    color: var(--color-gold);
}

.header__cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-gold);
    color: var(--color-white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-small);
    font-weight: 600;
}

.header__burger {
    display: none;
    flex-direction: column;
    width: 30px;
    height: 24px;
    justify-content: space-between;
}

.header__burger span {
    width: 100%;
    height: 3px;
    background: var(--color-dark-gray);
    transition: var(--transition);
}

/* Hero Slider */
.hero {
    position: relative;
    height: 500px;
    overflow: hidden;
    margin-top: 80px;
}

.hero__slider {
    position: relative;
    height: 100%;
}

.hero__slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    opacity: 0;
    transition: opacity 0.5s ease;
    margin: 0 auto;
    width: fit-content;
}

.hero__slide--active {
    opacity: 1;
}

.hero__content {
    flex: 1;
    max-width: 500px;
}

.hero__title {
    font-size: 48px;
    margin-bottom: 1rem;
    color: var(--color-dark-gray);
}

.hero__subtitle {
    font-size: var(--font-size-large);
    margin-bottom: 2rem;
    color: var(--color-text);
}

.hero__btn {
    display: inline-block;
    background: var(--color-gold);
    color: var(--color-white);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}

.hero__btn:hover {
    background: color-mix(in srgb, var(--color-gold) 80%, black);
    transform: translateY(-2px);
}

.hero__image {
    flex: 1;
    text-align: center;
}

.hero__image img {
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.hero__controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.hero__control {
    background: var(--color-white);
    color: var(--color-dark-gray);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.hero__control:hover {
    background: var(--color-gold);
    color: var(--color-white);
}

.hero__indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.hero__indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: var(--transition);
}

.hero__indicator--active {
    background: var(--color-gold);
}

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

section.categories .categories {
    margin-top: 20px;
}

.categories__title {
    text-align: left;
    margin-bottom: 1rem;
}

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

.categories__item {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    text-align: center;
    padding: 1.5rem;
}

.categories__item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.categories__image {
    margin-bottom: 1rem;
}

.categories__image img {
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin: 0 auto;
}

.categories__name {
    margin-bottom: 1rem;
    font-size: var(--font-size-large);
}

.categories__image-link,
.categories__name-link {
    color: inherit;
    text-decoration: none;
}

.categories__subcats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--color-dark-gray);
}

.categories__subcat-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.25);
}

.categories__subcat-link:hover {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
}

.categories__link {
    color: var(--color-gold);
    font-weight: 600;
}

.categories__link:hover {
    color: color-mix(in srgb, var(--color-gold) 80%, black);
}

/* Bestsellers */
.bestsellers {
    background: var(--color-light-gray);
    padding: 2rem 0;
}

.bestsellers__title {
    text-align: center;
    margin-bottom: 3rem;
}

.bestsellers__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    max-width: 400px;
}

.product-card__btn.is-added {
    background: #947206;
}

.product-card:hover {
    box-shadow: var(--box-shadow-hover);
}

.product-card__image {
    position: relative;
    padding-bottom: 75%;
    overflow: hidden;
}

.product-card__favorite {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--color-dark-gray);
    box-shadow: var(--box-shadow);
    z-index: 2;
    transition: var(--transition);
}

.product-card__favorite:hover {
    color: var(--color-gold);
    transform: scale(1.05);
}

.product-card__favorite.is-active {
    color: #c62828;
}

.product-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-card__content {
    padding: 0.5rem;
}

.product-card__title {
    font-size: var(--font-size-small);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1;
    height: 3em;
    text-align: center;
}

.product-card__rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.product-card__stars {
    color: var(--color-gold);
}

.product-card__price {
    font-size: var(--font-size-small);
    font-weight: 700;
    color: var(--color-dark-gray);
    margin-bottom: 1rem;
}

.product-card__btn {
    width: 100%;
    background: var(--color-gold);
    color: var(--color-white);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}

.product-card__btn:hover {
    background: color-mix(in srgb, var(--color-gold) 80%, black);
}

/* Advantages */
.advantages {
    padding: 4rem 0;
}

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

.advantages__item {
    text-align: center;
    padding: 2rem;
}

.advantages__icon {
    font-size: 48px;
    color: var(--color-gold);
    margin-bottom: 1rem;
}

.advantages__title {
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: var(--color-dark-gray);
    color: var(--color-white);
    padding: 3rem 0 1rem;
}

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

.footer__title {
    color: var(--color-gold);
    margin-bottom: 1rem;
}

.footer__text {
    color: rgba(255,255,255,0.8);
    margin-bottom: 1rem;
}

.footer__social {
    display: flex;
    gap: 1rem;
}

.footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--color-white);
    transition: var(--transition);
}

.footer__social-link:hover {
    background: var(--color-gold);
}

.footer__list {
    list-style: none;
}

.footer__list li {
    margin-bottom: 0.5rem;
}

.footer__link {
    color: rgba(255,255,255,0.8);
}

.footer__link:hover {
    color: var(--color-gold);
}

.footer__contacts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer__contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.8);
}

.footer__contact i {
    color: var(--color-gold);
}

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    text-align: center;
}

.footer__copyright {
    color: rgba(255,255,255,0.6);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .hero__title {
        font-size: 36px;
    }

    .hero__slide {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .hero__image {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .header__nav {
        position: fixed;
        top: 52px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--color-white);
        transition: left 0.3s ease;
        z-index: 999;
    }

    .header__nav--active {
        left: 0;
    }

    .header__nav-list {
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
    }

    .header__nav-submenu {
        position: static;
        border: none;
        box-shadow: none;
        padding: 0.25rem 0 0.25rem 1rem;
        min-width: 0;
    }

    .header__nav-item.is-open .header__nav-submenu {
        display: block;
    }

    .header__burger {
        display: flex;
    }

    .hero {
        height: 400px;
    }

    .hero__title {
        font-size: 28px;
    }

    .hero__subtitle {
        font-size: var(--font-size-base);
    }

    .categories__grid,
    .advantages__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .categories__image img {
        height: 120px;
    }

    .footer__content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-h1: 24px;
        --font-size-h2: 20px;
        --font-size-h3: 18px;
    }

    .hero {
        height: 350px;
    }

    .hero__title {
        font-size: 24px;
    }

    .hero__btn {
        padding: 0.75rem 1.5rem;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none; }
.visible { display: block; }

/* Animation for cart */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.cart-bounce {
    animation: bounce 0.3s ease;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.product-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.product-card__price-old {
    font-size: 0.95rem;
    color: var(--color-dark-gray);
    text-decoration: line-through;
}

@media (max-width: 480px) {
    .product-card__price-row {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .product-card__price {
        margin-bottom: 0;
        margin-top: 8px;
    }
}

@media (max-width: 768px) {
    .category-header {
        flex-direction: column;
    }
}
@media (max-width: 425px) {
    .category-header__sort {
        flex-direction: column;
    }
}

.category-sidebar-overlay {
    position: fixed;
}

.catalog-categories__grid {
    margin-bottom: 2rem;
}

@media (max-width: 1023px) {
    .header__separator {
        display: none;
    }
}
@media (min-width: 1025px) {
    .category-sidebar__close {
        display: none;
    }
}

.header__phone {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}
.header-row-group {
    display: flex;
    gap: 1em;
}

.header__phone-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--color-dark-gray);
}

@media (max-width: 980px) {
    .header__search-mobile-btn {
        display: block;
    }

    .header__search {
        display: none; /* По умолчанию скрыта */
        position: absolute;
        top: 60px; /* Высота хедера */
        left: 0;
        width: 100%;
        padding: 10px;
        background: #fff;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        z-index: 99;
    }

    .header__search.is-active {
        display: flex; /* Показываем при клике */
    }

    /* Растягиваем инпут на мобильных */
    .header__search-input {
        flex-grow: 1;
    }

    .header__phone-btn {
        display: block;
    }

    .header_phones {
        display: none;
        position: absolute;
        top: 40px;
        left: 10px;
        background: #fff;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        padding: 1rem;
        z-index: 100;
        flex-direction: column;
        gap: 0.5rem;
    }

    .header_phones.is-active {
        display: flex;
    }
}

@media (max-width: 768px) {
    .header__content {
        flex-direction: row;
    }
}
