/* ============================================
   WOODEN DREAMS - Основные стили
   Московская эстетика: строго, дорого, спокойно
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f7f4;
    --bg-tertiary: #f3f1ec;
    --bg-dark: #1e1b18;
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-muted: #8c8c8c;
    --text-light: #d9d4cc;
    --accent: #b4975a;
    --accent-hover: #9a7d45;
    --accent-light: #d4c5a0;
    --border-light: #e0dcd3;
    --border-lighter: #ede9e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    line-height: 1.3;
    color: #1e1b18;
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.8px;
}

h2 {
    font-size: 2.2rem;
    letter-spacing: -0.4px;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.2rem;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* НАВИГАЦИЯ */
nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow var(--transition-smooth);
}

nav.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 500;
    color: #2c2416;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 450;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width var(--transition-smooth);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

#cartCount {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

/* HERO */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f4f2ed 100%);
}

.hero h1 {
    margin-bottom: 16px;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 28px;
}

.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid var(--border-light);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: #3d3d3d;
    box-shadow: var(--shadow-sm);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* СЕКЦИЯ ЦЕН */
.price-section {
    background: white;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 48px 0;
}

.price-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 48px;
    text-align: center;
}

.price-item .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.price-value {
    font-size: 2.2rem;
    font-weight: 600;
}

.price-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* КАСТОМНЫЙ SELECT */
.city-select-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.city-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.custom-select {
    position: relative;
    min-width: 240px;
    user-select: none;
    z-index: 10;
}

.select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: white;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select-header:hover {
    border-color: var(--accent-light);
}

.select-header.active {
    border-color: var(--accent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.select-arrow {
    transition: transform var(--transition-smooth);
}

.select-header.active .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid var(--accent);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-lg);
    z-index: 20;
}

.select-dropdown.open {
    max-height: 500px;
    opacity: 1;
}

.select-option {
    padding: 13px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.select-option:hover {
    background: #f9f7f2;
    padding-left: 24px;
}

.select-option.selected {
    background: #f5f1e8;
    font-weight: 500;
}

.select-option.selected::after {
    content: '✓';
    position: absolute;
    right: 20px;
    color: var(--accent);
}

.custom-city-option {
    color: var(--accent) !important;
}

.custom-city-input {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.custom-city-input input {
    padding: 11px 18px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-full);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    width: 200px;
}

.custom-city-input input:focus {
    border-color: var(--accent);
}

.delivery-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.select-overlay {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: none;
}

.select-overlay.active {
    display: block;
}

/* ПОРТФОЛИО */
.portfolio {
    padding: 80px 0;
}

.section-title {
    margin-bottom: 40px;
    display: inline-block;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent);
}

#portfolioGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-lighter);
    transition: all var(--transition-smooth);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #eae6dd;
}

.card h4 {
    font-size: 1.05rem;
    padding: 16px 20px 6px;
}

.card p {
    padding: 0 20px 8px;
    color: var(--text-secondary);
}

.card-buttons {
    display: flex;
    gap: 8px;
    padding: 8px 20px 20px;
}

.card-buttons button {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: 1.5px solid #2c2416;
    color: #2c2416;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-buttons button:hover {
    background: #2c2416;
    color: white;
}

.card-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pay {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: white !important;
}

.btn-pay:hover {
    background: var(--accent-hover) !important;
}

/* КОНТАКТЫ */
.contacts {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 64px 0;
}

.contacts .section-title {
    color: white;
}

.contacts .section-title::after {
    background: var(--accent);
}

.contact-items {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    font-size: 1rem;
}

.contact-items a {
    color: #e0d9cd;
    border-bottom: 1px dotted #5a5548;
}

.contact-items a:hover {
    color: white;
}

/* ЧАТ */
.chat-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: white;
    border-radius: var(--radius-lg);
    width: 280px;
    box-shadow: var(--shadow-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    z-index: 50;
}

.chat-widget strong {
    display: block;
    margin-bottom: 10px;
}

.chat-widget textarea {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    background: var(--bg-secondary);
    outline: none;
}

.chat-widget textarea:focus {
    border-color: var(--accent);
}

.chat-widget button {
    width: 100%;
    margin-top: 10px;
    background: var(--bg-tertiary);
    border: none;
    padding: 11px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
}

.chat-widget button:hover {
    background: #e2dcd0;
}

/* МОДАЛКИ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    z-index: 200;
    overflow-y: auto;
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    margin: 8% auto;
    padding: 40px;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 440px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-modal-content {
    max-width: 560px;
}

.payment-modal-content {
    max-width: 480px;
    text-align: center;
}

.close {
    position: absolute;
    right: 24px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h3 {
    margin-bottom: 24px;
    font-size: 1.6rem;
}

.modal-content input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    background: var(--bg-secondary);
}

.modal-content input:focus {
    border-color: var(--accent);
    background: white;
}

.modal-content button {
    width: 100%;
    padding: 14px;
    background: #2c2416;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 6px;
}

.modal-content button:hover {
    background: #1a1510;
}

.modal-content p {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-content p a {
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
}

/* ОПЛАТА */
.payment-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.payment-info p {
    margin-bottom: 8px;
    text-align: left;
}

.qr-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-container img {
    border-radius: var(--radius-md);
}

.qr-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.pay-confirm-btn {
    background: var(--accent) !important;
}

.pay-confirm-btn:hover {
    background: var(--accent-hover) !important;
}

.payment-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px !important;
}

/* КОРЗИНА */
#cartItems {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-lighter);
}

.cart-item-info h4 {
    font-size: 0.95rem;
}

.cart-item-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    text-align: left;
}

.cart-item-remove {
    color: #c44;
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.cart-item-remove:hover {
    background: #fef0f0;
}

#cartTotal {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: right;
    padding-top: 10px;
    border-top: 2px solid var(--border-light);
}

/* ЛИЧНЫЙ КАБИНЕТ */
.profile-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-light);
}

.profile-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted) !important;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-tab.active {
    color: var(--accent) !important;
    border-bottom-color: var(--accent);
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.profile-info p {
    text-align: left;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.logout-btn {
    background: transparent !important;
    border: 1.5px solid #c44 !important;
    color: #c44 !important;
    margin-top: 16px !important;
}

.logout-btn:hover {
    background: #c44 !important;
    color: white !important;
}

.bonuses-card {
    background: linear-gradient(135deg, #f9f7f2 0%, #f3f1ec 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.bonuses-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.bonuses-value {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent);
}

.bonuses-info {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#ordersList {
    max-height: 300px;
    overflow-y: auto;
}

.order-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-lighter);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.order-card-id {
    font-weight: 600;
}

.order-card-status {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: #e8f5e9;
    color: #2e7d32;
}

.order-card-price {
    font-weight: 600;
}

.order-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .nav-container {
        height: 60px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .hero {
        padding: 60px 0 50px;
    }

    .price-grid {
        gap: 24px;
    }

    .price-value {
        font-size: 1.8rem;
    }

    #portfolioGrid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .chat-widget {
        width: 260px;
        right: 12px;
        bottom: 12px;
        padding: 16px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 28px 20px;
    }

    .bonuses-value {
        font-size: 2rem;
    }

    .card-buttons {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .city-select-wrapper {
        flex-direction: column;
    }

    .custom-select {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nav-links {
        gap: 10px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .price-grid {
        flex-direction: column;
        gap: 20px;
    }

    .contact-items {
        flex-direction: column;
        gap: 16px;
    }

    #portfolioGrid {
        grid-template-columns: 1fr;
    }

    .chat-widget {
        width: calc(100% - 24px);
        left: 12px;
        right: 12px;
    }
}

::selection {
    background: rgba(180, 151, 90, 0.2);
}

html {
    scroll-behavior: smooth;
}