/* === ПЕРЕМЕННЫЕ И ТЕПЛАЯ ЦВЕТОВАЯ ПАЛИТРА === */
:root {
    --bg-page: #FAF7F2;          /* Теплый мягкий кремовый */
    --bg-card: #FFFFFF;          /* Чистый белый для блоков */
    --bg-accent: #F4ECE1;        /* Нежный бежево-льняной */
    --text-main: #3C332A;        /* Теплый глубокий кофейный */
    --text-muted: #7C7267;       /* Мягкий серый для подписей */
    --primary: #C87D65;          /* Теплая терракота / пудровый коралл */
    --primary-hover: #B66C54;
    --sage: #7A8B7B;             /* Уютный шалфейный зеленый */
    --border-color: #EAE2D7;     /* Тонкая мягкая граница */
    --shadow-sm: 0 4px 12px rgba(60, 51, 42, 0.05);
    --shadow-md: 0 10px 30px rgba(60, 51, 42, 0.08);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.25s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
}

img {
    max-width: 100%;
    display: block;
    object-fit: cover;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
}

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

/* === ШАПКА === */
.site-header {
    background-color: rgba(250, 247, 242, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
}

.logo-mark {
    font-size: 1.6rem;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    transition: var(--transition);
}

.cart-btn:hover {
    background: #ebdccf;
}

.cart-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 12px;
}

/* === КНОПКИ И ТЭГИ === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(200, 125, 101, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-accent);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #e4d7c8;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.9rem;
}

.tag-pill {
    display: inline-block;
    background: var(--bg-accent);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* === УПРАВЛЕНИЕ ЭКРАНАМИ (SPA) === */
.page-view {
    display: none;
    padding: 30px 0 60px;
    animation: fadeIn 0.3s ease-in-out;
}

.page-view.active {
    display: block;
}

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

/* === HERO БЛОК === */
.hero-section {
    padding: 30px 0 60px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 40px;
}

.hero-title {
    font-size: 3.2rem;
    margin-bottom: 18px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-image-wrapper {
    position: relative;
}

.hero-img {
    width: 100%;
    height: 440px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.hero-floating-badge {
    position: absolute;
    bottom: -15px;
    left: -15px;
    background: var(--bg-card);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-floating-badge span {
    font-size: 1.8rem;
}

.hero-floating-badge p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* === КАТЕГОРИИ === */
.categories-section {
    padding: 50px 0;
}

.section-head {
    margin-bottom: 32px;
}

.section-head.text-center {
    text-align: center;
}

.section-head-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.section-head h2, .section-head-between h2 {
    font-size: 2.2rem;
    margin-bottom: 6px;
}

.section-head p, .section-head-between p {
    color: var(--text-muted);
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.cat-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 200px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.cat-card img {
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
}

.cat-card:hover img {
    transform: scale(1.05);
}

.cat-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(60,51,42,0.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    color: #fff;
}

.cat-card-overlay h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.cat-card-overlay span {
    font-size: 0.85rem;
    opacity: 0.9;
}

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

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.product-card-img-wrap {
    position: relative;
    height: 220px;
    cursor: pointer;
    overflow: hidden;
}

.product-card-img-wrap img {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-img-wrap img {
    transform: scale(1.04);
}

.badge-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-title {
    font-size: 1.15rem;
    margin-bottom: 6px;
    cursor: pointer;
}

.product-card-title:hover {
    color: var(--primary);
}

.product-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

/* === ОТЗЫВЫ И О НАС === */
.reviews-section {
    padding: 60px 0;
    background: var(--bg-accent);
    border-radius: var(--radius-lg);
    margin: 40px 0;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.review-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.review-stars {
    color: #F4A261;
    margin-bottom: 12px;
}

.review-text {
    font-style: italic;
    color: var(--text-main);
    margin-bottom: 16px;
}

.review-author strong {
    display: block;
}

.review-author span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.about-section {
    padding: 40px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    align-items: center;
    gap: 40px;
}

.about-img {
    border-radius: var(--radius-lg);
    height: 380px;
    width: 100%;
}

.about-features {
    list-style: none;
    margin-top: 20px;
}

.about-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 500;
}

/* === СТРАНИЦА КАТАЛОГА === */
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.catalog-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
}

.catalog-sidebar {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h4 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.filter-radio-group label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.price-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.catalog-empty {
    text-align: center;
    padding: 40px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

/* === СТРАНИЦА ТОВАРА === */
.back-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 20px;
    display: inline-block;
}

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

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-detail-img {
    width: 100%;
    height: 420px;
    border-radius: var(--radius-md);
}

.detail-info h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.detail-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.detail-composition {
    background: var(--bg-page);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.option-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: block;
}

.options-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.option-chip {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    background: #fff;
    transition: var(--transition);
}

.option-chip.active {
    border-color: var(--primary);
    background: var(--bg-accent);
    color: var(--text-main);
    font-weight: 600;
}

.detail-actions {
    display: flex;
    gap: 14px;
    margin-top: 24px;
}

.related-section {
    margin-top: 50px;
}

.related-section h3 {
    font-size: 1.8rem;
    margin-bottom: 24px;
}

/* === КОРЗИНА И ОФОРМЛЕНИЕ === */
.cart-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    align-items: flex-start;
}

.cart-items-column, .checkout-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border-color);
}

.cart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.text-btn:hover {
    color: #e63946;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
}

.cart-qty-ctrl {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.qty-btn {
    background: none;
    border: none;
    padding: 4px 10px;
    cursor: pointer;
    font-weight: bold;
}

.qty-count {
    padding: 0 6px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    background: #FAF7F2;
}

.form-input:focus {
    border-color: var(--primary);
    background: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.delivery-toggle {
    display: flex;
    gap: 10px;
}

.toggle-option {
    flex: 1;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle-option.active {
    border-color: var(--primary);
    background: var(--bg-accent);
    font-weight: 600;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pay-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.summary-block {
    margin: 20px 0;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.empty-cart-card {
    background: var(--bg-card);
    text-align: center;
    padding: 60px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 12px;
}

/* === МОДАЛЬНОЕ ОКНО УСПЕХА === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(40, 30, 20, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: var(--bg-card);
    max-width: 500px;
    width: 100%;
    padding: 36px;
    border-radius: var(--radius-lg);
    text-align: center;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.success-check-icon {
    width: 60px;
    height: 60px;
    background: #E8F5E9;
    color: #2E7D32;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.order-num-pill {
    background: var(--bg-accent);
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    margin: 12px 0;
}

.order-brief {
    background: var(--bg-page);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: left;
    margin: 20px 0;
    font-size: 0.9rem;
}

/* === УВЕДОМЛЕНИЕ (TOAST) === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-main);
    color: #fff;
    padding: 14px 24px;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* === ПОДВАЛ (FOOTER) === */
.site-footer {
    background: #2E2722;
    color: #E2DBD4;
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
}

.footer-logo {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 14px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

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

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul a {
    color: #C2B8AD;
    text-decoration: none;
}

.footer-col ul a:hover {
    color: #fff;
}

.copy {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #8C8276;
}

.hidden {
    display: none !important;
}

/* === АДАПТИВНОСТЬ (MOBILE & TABLET) === */
@media (max-width: 900px) {
    .hero-grid, .about-grid, .cart-layout, .product-detail-layout {
        grid-template-columns: 1fr;
    }
    .hero-img {
        height: 320px;
    }
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    .category-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.2rem;
    }
    .nav-links {
        display: none; /* Компактный режим */
    }
    .category-cards {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}