/* ===== БАЗОВЫЕ НАСТРОЙКИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #f9f7f4;
    color: #2c2c2c;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(10px, 3vw, 24px);
}

/* ===== ВЕРХНЯЯ КОНТАКТНАЯ СТРОКА ===== */
.top-contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 6px;
    border-bottom: 1px solid #e0d8ce;
    font-size: clamp(0.7rem, 1.8vw, 0.95rem);
    color: #3f382d;
    gap: 4px 10px;
}

.top-contacts .contact-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-contacts .contact-item i {
    color: #7f6e58;
    width: 16px;
    font-size: clamp(0.65rem, 1.4vw, 1rem);
    flex-shrink: 0;
}

.top-contacts .contact-item span {
    font-size: clamp(0.6rem, 1.4vw, 0.95rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: clamp(60px, 20vw, 200px);
}

.top-contacts .right-block {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 14px);
    flex-wrap: wrap;
}

.top-contacts .social-icons {
    display: flex;
    gap: clamp(6px, 1.5vw, 14px);
}

.top-contacts .social-icons a {
    color: #4d3e2e;
    font-size: clamp(0.8rem, 1.8vw, 1.2rem);
    transition: 0.2s;
    padding: 2px 4px;
}

.top-contacts .social-icons a:hover {
    color: #1d170f;
    transform: scale(1.1);
}

.top-contacts .ask-link {
    font-weight: 500;
    color: #3d352a;
    text-decoration: none;
    border-bottom: 1px dashed #b7a185;
    padding-bottom: 2px;
    font-size: clamp(0.65rem, 1.4vw, 0.95rem);
    white-space: nowrap;
}

.top-contacts .ask-link:hover {
    border-bottom-style: solid;
    color: #1d170f;
}

@media (max-width: 600px) {
    .top-contacts {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .top-contacts .contact-item span {
        max-width: none;
        white-space: normal;
        word-break: break-word;
    }
    .top-contacts .right-block {
        justify-content: space-between;
        width: 100%;
    }
}

@media (max-width: 400px) {
    .top-contacts .contact-item {
        font-size: 0.65rem;
    }
    .top-contacts .social-icons a {
        font-size: 0.75rem;
    }
}

/* ===== ОБНОВЛЕННАЯ ШАПКА С КОРЗИНОЙ СПРАВА ===== */
.main-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: clamp(10px, 2vw, 18px) 0 clamp(8px, 1.5vw, 14px);
    border-bottom: 1px solid #ddd9d2;
    position: relative;
    gap: 8px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
}

.header-center {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-icon {
    font-size: clamp(20px, 4vw, 28px);
    color: #8b7a64;
}

.logo-text {
    font-weight: 700;
    font-size: clamp(16px, 3.5vw, 22px);
    letter-spacing: 1px;
    color: #3d352a;
}

.logo-text span {
    font-weight: 300;
    color: #7f6e58;
}

/* ===== БУРГЕР-МЕНЮ ===== */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    z-index: 101;
}

.burger-menu span {
    display: block;
    width: 28px;
    height: 3px;
    background: #3d352a;
    border-radius: 3px;
    transition: 0.3s;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

.menu-overlay.active {
    display: block;
}

/* ===== НАВИГАЦИЯ ===== */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(10px, 2.5vw, 28px);
    font-weight: 500;
    font-size: clamp(13px, 1.8vw, 16px);
    list-style: none;
    transition: 0.3s;
    justify-content: center;
}

.nav-links > li {
    position: relative;
    padding: 4px 0;
}

.nav-links > li > a {
    text-decoration: none;
    color: #2c2c2c;
    transition: 0.2s;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    display: inline-block;
    font-size: clamp(13px, 1.8vw, 16px);
    white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
    border-bottom-color: #b7a185;
    color: #4d3e2e;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 210px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    border-radius: 14px;
    padding: 12px 0;
    border: 1px solid #e7e0d6;
    z-index: 100;
    list-style: none;
}

.dropdown li a {
    display: block;
    padding: 8px 24px;
    text-decoration: none;
    color: #2c2c2c;
    font-weight: 400;
    font-size: 0.95rem;
    transition: 0.15s;
}

.dropdown li a:hover {
    background: #f1ede8;
    color: #1d170f;
}

.nav-links > li:hover .dropdown {
    display: block;
}

/* ===== КОРЗИНА (кнопка) ===== */
.cart-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 4px 6px;
    font-size: 1.2rem;
    color: #3d352a;
}

.cart-btn .cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #c0392b;
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 16px;
    text-align: center;
}

/* ===== МОБИЛЬНОЕ МЕНЮ ===== */
@media (max-width: 820px) {
    .burger-menu {
        display: flex;
    }
    .header-center {
        display: none;
    }
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 340px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 70px 20px 30px;
        gap: 4px;
        box-shadow: -8px 0 30px rgba(0,0,0,0.1);
        transition: right 0.35s ease;
        overflow-y: auto;
        z-index: 100;
        border-radius: 0;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }
    .nav-links.open {
        display: flex;
        right: 0;
    }
    .nav-links > li {
        padding: 4px 0;
        border-bottom: 1px solid #f1ede8;
    }
    .nav-links > li > a {
        font-size: 1.1rem;
        padding: 8px 0;
        display: block;
        white-space: normal;
    }
    .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: #f5f1eb;
        border-radius: 10px;
        margin-top: 4px;
        padding: 6px 0;
        min-width: auto;
    }
    .nav-links > li:hover .dropdown {
        display: none;
    }
    .nav-links > li .dropdown.open {
        display: block !important;
    }
    .dropdown li a {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .nav-links {
        width: 85%;
        padding: 60px 16px 20px;
    }
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
    font-size: clamp(0.7rem, 1.6vw, 0.9rem);
    color: #5e4f3a;
    margin-bottom: clamp(12px, 2vw, 20px);
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.breadcrumbs::-webkit-scrollbar {
    height: 2px;
}

.breadcrumbs::-webkit-scrollbar-thumb {
    background: #d5cdc0;
    border-radius: 4px;
}

.breadcrumbs a {
    color: #5e4f3a;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
    color: #3d352a;
}

.breadcrumbs span {
    margin: 0 4px;
}

/* ===== ЗАГОЛОВКИ ===== */
.catalog-title {
    font-size: clamp(1.4rem, 5vw, 2.4rem);
    font-weight: 400;
    letter-spacing: -0.5px;
    color: #2b241b;
    border-left: 6px solid #b7a185;
    padding-left: clamp(12px, 3vw, 24px);
    margin-bottom: clamp(8px, 1.5vw, 12px);
    word-break: break-word;
}

.catalog-description {
    background: #f1ede8;
    padding: clamp(14px, 2.5vw, 24px) clamp(16px, 3vw, 28px);
    border-radius: clamp(14px, 2vw, 18px);
    margin-bottom: clamp(20px, 3vw, 32px);
    color: #2e281f;
    font-size: clamp(0.85rem, 1.8vw, 1.05rem);
}

/* ===== БЛОК "ЗАДАТЬ ВОПРОС" ===== */
.ask-block {
    background: #f1ede8;
    border-radius: clamp(20px, 3vw, 24px);
    padding: clamp(18px, 2.5vw, 28px) clamp(16px, 3vw, 32px);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(20px, 3vw, 30px);
}

.ask-block p {
    font-size: clamp(0.85rem, 1.8vw, 1.05rem);
    color: #2e281f;
}

.ask-block p strong {
    font-weight: 600;
}

.ask-block .btn-ask {
    background: #8b7a64;
    color: white;
    border: none;
    padding: clamp(10px, 1.6vw, 12px) clamp(20px, 4vw, 36px);
    border-radius: 60px;
    font-weight: 600;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-block;
    touch-action: manipulation;
    text-align: center;
    min-width: clamp(120px, 20vw, 160px);
}

.ask-block .btn-ask:active {
    transform: scale(0.96);
}

@media (max-width: 600px) {
    .ask-block {
        flex-direction: column;
        text-align: center;
    }
    .ask-block .btn-ask {
        width: 100%;
        min-width: auto;
    }
}

/* ===== ФУТЕР ===== */
.footer-section {
    background: #eae5dd;
    border-radius: clamp(24px, 4vw, 30px) clamp(24px, 4vw, 30px) 0 0;
    padding: clamp(24px, 4vw, 44px) clamp(14px, 3vw, 30px) clamp(18px, 3vw, 32px);
    margin-top: clamp(30px, 5vw, 40px);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: clamp(16px, 3vw, 30px);
}

.footer-col {
    flex: 1 1 min(140px, 100%);
    min-width: 120px;
}

.footer-col h4 {
    font-weight: 600;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    letter-spacing: 1px;
    margin-bottom: clamp(8px, 1.5vw, 14px);
    color: #332c21;
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: clamp(6px, 1vw, 10px);
}

.footer-col ul li a {
    text-decoration: none;
    color: #3f382d;
    transition: 0.15s;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    display: inline-block;
    padding: 2px 0;
}

.footer-col ul li a:hover {
    color: #1d170f;
    text-decoration: underline;
}

.newsletter-input {
    display: flex;
    background: white;
    border-radius: 60px;
    overflow: hidden;
    border: 1px solid #cbc1b2;
    flex-wrap: nowrap;
}

.newsletter-input input {
    border: none;
    padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2vw, 18px);
    flex: 1;
    outline: none;
    background: transparent;
    font-size: clamp(0.75rem, 1.4vw, 0.95rem);
    min-width: 60px;
}

.newsletter-input button {
    background: #8b7a64;
    color: white;
    border: none;
    padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2.5vw, 22px);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    letter-spacing: 0.4px;
    font-size: clamp(0.65rem, 1.2vw, 0.9rem);
    white-space: nowrap;
    touch-action: manipulation;
}

.newsletter-input button:active {
    transform: scale(0.95);
}

.contacts-block {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vw, 12px);
    font-size: clamp(0.75rem, 1.4vw, 0.95rem);
}

.contacts-block .phone {
    font-weight: 600;
    font-size: clamp(0.85rem, 1.6vw, 1.15rem);
    color: #1d170f;
}

.contacts-block .address,
.contacts-block .email {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2f281d;
    word-break: break-word;
}

.contacts-block i {
    width: 18px;
    color: #5e4f3a;
    flex-shrink: 0;
}

.bottom-bar {
    background: #eae5dd;
    padding: clamp(8px, 1vw, 12px) 0 clamp(12px, 2vw, 20px);
    border-top: 1px solid #d0c8ba;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    color: #3d352a;
    text-align: center;
}

.bottom-bar span {
    opacity: 0.7;
}

@media (max-width: 600px) {
    .footer-section {
        flex-direction: column;
        gap: 20px;
    }
    .footer-col {
        flex: 1 1 100%;
    }
    .contacts-block .address,
    .contacts-block .email {
        font-size: 0.85rem;
    }
    .newsletter-input {
        flex-wrap: wrap;
        border-radius: 30px;
    }
    .newsletter-input input {
        width: 100%;
        border-radius: 30px 30px 0 0;
        text-align: center;
    }
    .newsletter-input button {
        width: 100%;
        border-radius: 0 0 30px 30px;
        justify-content: center;
        padding: 12px;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 0 8px;
    }
    .contacts-block .address,
    .contacts-block .email {
        font-size: 0.78rem;
        gap: 6px;
    }
    .contacts-block i {
        width: 14px;
    }
}

/* ===== КОРЗИНА (модальное окно) ===== */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.cart-modal.active {
    display: flex;
}
.cart-modal .cart-window {
    background: white;
    border-radius: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px 28px;
    position: relative;
    animation: modalFade 0.3s ease;
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
@keyframes modalFade {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.cart-modal .cart-close {
    position: sticky;
    float: right;
    top: 0;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #7f6e58;
    cursor: pointer;
    z-index: 10;
    padding: 4px 8px;
}
.cart-modal .cart-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2b241b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ede8e0;
}
.cart-modal .cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f1eb;
}
.cart-modal .cart-item .cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: #ded9d0;
    overflow: hidden;
    flex-shrink: 0;
}
.cart-modal .cart-item .cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cart-modal .cart-item .cart-item-info {
    flex: 1;
}
.cart-modal .cart-item .cart-item-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2b241b;
}
.cart-modal .cart-item .cart-item-info .cart-item-meta {
    font-size: 0.8rem;
    color: #7f6e58;
}
.cart-modal .cart-item .cart-item-remove {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    opacity: 0.5;
    transition: 0.2s;
}
.cart-modal .cart-item .cart-item-remove:hover {
    opacity: 1;
}
.cart-modal .cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #7f6e58;
}
.cart-modal .cart-empty i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 12px;
}
.cart-modal .cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 2px solid #ede8e0;
    margin-top: 8px;
}
.cart-modal .cart-total span {
    font-weight: 600;
    font-size: 1.1rem;
}
.cart-modal .cart-total .cart-total-price {
    font-size: 1.3rem;
    color: #2b241b;
}
.cart-modal .cart-checkout {
    width: 100%;
    background: #8b7a64;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 16px;
    transition: 0.2s;
    touch-action: manipulation;
}
.cart-modal .cart-checkout:hover {
    background: #6e5f4b;
}
.cart-modal .cart-checkout:active {
    transform: scale(0.96);
}
.cart-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 14px 28px;
    border-radius: 60px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 3000;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: modalFade 0.3s ease;
    border: 1px solid #e7e0d6;
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ===== */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(clamp(8px, 2vw, 16px), env(safe-area-inset-left));
        padding-right: max(clamp(8px, 2vw, 16px), env(safe-area-inset-right));
    }
}

* {
    -webkit-tap-highlight-color: transparent;
}

p, h1, h2, h3, h4, .product-item, .modal-window, .ask-block {
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 360px) {
    .top-contacts .contact-item span {
        font-size: 0.55rem;
    }
    .top-contacts .social-icons a {
        font-size: 0.7rem;
    }
    .logo-text {
        font-size: 14px;
    }
    .logo-icon {
        font-size: 18px;
    }
}

@media (pointer: coarse) {
    .product-item,
    .catalog-home-card,
    .sidebar ul li a,
    .dropdown li a,
    .btn,
    button,
    .btn-ask {
        min-height: 44px;
        min-width: 44px;
    }
}