/* Reset and Base Styles */
html {
    scroll-behavior: smooth;
}

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

:root {
    /* Пастельная бежево-розовая палитра */
    --primary-color: #d9a894;      /* тёплый розово-бежевый для основных кнопок */
    --secondary-color: #f1ddc9;    /* светлый бежевый для фона карточек/кнопок */
    --accent-color: #b26a5a;       /* более тёмный акцент для заголовков и важных элементов */
    --text-color: #3b2f2a;         /* тёмно-коричневый текст для лучшей читаемости */
    --text-dark: #241a16;          /* ещё более тёмный для заголовков */
    --bg-light: #f7efe6;           /* общий бежевый фон страницы */
    --bg-white: #fffaf5;           /* тёплый «почти белый» фон блоков */
    --border-color: #e0cbb8;
    --success-color: #a3c9a8;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
    --admin-table-header-bg: #f2e3d4;
    --admin-table-row-hover: #f9efe4;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Плавное переключение темы (не навешиваем на *, чтобы не ломать анимации) */
@media (prefers-reduced-motion: no-preference) {
    html {
        transition: background-color 0.55s cubic-bezier(0.33, 1, 0.68, 1);
    }

    body,
    header,
    footer,
    main,
    .navbar .container,
    .product-card,
    .checkout-form,
    .checkout-page .confirm-card,
    .admin-login-box,
    .confirmation-box,
    .cart-page .cart-items,
    .cart-table .cart-row,
    .form-control,
    .btn-primary,
    .btn-secondary,
    .footer-inner,
    .nav-menu a,
    .nav-brand a,
    .cart-badge,
    .contact-modal-dialog,
    .welcome-section,
    .about-section,
    .hero-section {
        transition:
            background-color 0.55s cubic-bezier(0.33, 1, 0.68, 1),
            background 0.55s cubic-bezier(0.33, 1, 0.68, 1),
            color 0.55s cubic-bezier(0.33, 1, 0.68, 1),
            border-color 0.5s ease,
            box-shadow 0.55s ease;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: var(--text-dark);
    font-weight: 600;
}

/* Header and Navigation */
header {
    background: linear-gradient(90deg, #f7efe6 0%, #f1ddc9 100%);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

.cart-link {
    position: relative;
}

.cart-badge {
    background-color: var(--secondary-color);
    color: var(--text-dark);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
    margin-left: 0.4rem;
    min-width: 1.2rem;
    display: inline-block;
    text-align: center;
}

/* Main Content */
main {
    flex: 1;
}

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

/* Welcome Section */
.welcome-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff8f5 0%, #f8e8e8 100%);
    text-align: center;
    padding: 2rem;
    transition: background 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

.welcome-content {
    max-width: 800px;
}

.welcome-title {
    font-size: 5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out forwards;
}

.welcome-subtitle {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.welcome-text {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
}

.fade-in-up-delay {
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.fade-in-up-delay-2 {
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

.fade-in-up-delay-3 {
    animation: fadeInUp 1s ease-out 0.9s forwards;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-checkout, .btn-add-to-cart {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: white;
}

.btn-checkout {
    background-color: var(--accent-color);
    color: white;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

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

.btn-add-to-cart {
    background-color: var(--secondary-color);
    color: var(--text-dark);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.btn-add-to-cart:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Products Preview */
.products-preview {
    padding: 4rem 0;
    background-color: var(--bg-light);
}

.home-products-grid {
    margin-top: 0.5rem;
}

/* Главная: карточки отделены от фона секции */
.products-preview .home-products-grid .product-card {
    border-color: var(--border-color);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.075);
}

:root[data-theme="dark"] .products-preview .home-products-grid .product-card {
    box-shadow: var(--shadow), 0 0 0 1px rgba(232, 180, 196, 0.08);
}

.home-catalog-cta {
    margin-top: 2.5rem;
    text-align: center;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--accent-color);
}

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

.category-card {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    background-color: var(--bg-white);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

/* Products Page */
.products-page {
    padding: 2rem 0;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.products-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.categories-sidebar {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.categories-sidebar h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.category-list a:hover,
.category-list a.active {
    background-color: var(--primary-color);
    color: white;
}

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

.product-card {
    background-color: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.35s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(201, 125, 148, 0.35);
    background-color: var(--bg-white);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    background-color: var(--bg-light);
    border: none;
    margin: 0;
    padding: 0;
    max-width: 100%;
}

.product-link img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    background-color: var(--bg-light);
}

.product-link .product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    background-color: var(--bg-light);
}

.product-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.product-link:hover {
    text-decoration: none !important;
    color: inherit !important;
}

.product-link:visited {
    color: inherit !important;
}

.product-link:active {
    color: inherit !important;
}

.product-name {
    text-decoration: none !important;
}

.product-link h3,
.product-link .product-name,
.product-link h1,
.product-link h2 {
    text-decoration: none !important;
    border-bottom: none !important;
    text-decoration-line: none !important;
}

a.product-link {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Убираем подчеркивания у ссылок в карточках товаров */
.product-card a,
.product-card a:hover,
.product-card a:visited,
.product-card a:active {
    text-decoration: none !important;
    border-bottom: none !important;
}

.product-card h3,
.product-card .product-name {
    text-decoration: none !important;
    border-bottom: none !important;
}

.product-details-page a,
.product-details-page a:hover,
.product-details-page a:visited,
.product-details-page a:active {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Более строгие правила для убирания подчеркиваний */
.product-card a.product-link,
.product-card a.product-link:hover,
.product-card a.product-link:visited,
.product-card a.product-link:active,
.product-card a.product-link:focus {
    text-decoration: none !important;
    border-bottom: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-thickness: 0 !important;
    text-underline-offset: 0 !important;
}

.product-card .product-link h3.product-name,
.product-card .product-link .product-name,
.product-card h3.product-name,
.product-info .product-link h3,
.product-info .product-link .product-name {
    text-decoration: none !important;
    border-bottom: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-thickness: 0 !important;
    text-underline-offset: 0 !important;
    outline: none !important;
}

/* Убираем подчеркивания у изображений в ссылках */
.product-card a.product-link img,
.product-card .product-link .product-image {
    border: none !important;
    outline: none !important;
    text-decoration: none !important;
}

.product-image-placeholder {
    width: 100%;
    height: 250px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.product-name {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    text-decoration: none !important;
    border-bottom: none !important;
}

.product-description {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    flex: 1 1 auto;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    flex-shrink: 0;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
}

/* Cart Page */
.cart-page {
    padding: 2rem 0;
}

.cart-notice {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    color: var(--text-dark);
    font-size: 0.98rem;
    line-height: 1.45;
}

.checkout-page .cart-notice {
    margin-bottom: 1.5rem;
}

.cart-items {
    margin-bottom: 2rem;
}

.cart-item {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 100px 1fr 150px 120px 40px;
    gap: 1.5rem;
    align-items: center;
    box-shadow: var(--shadow);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background-color: var(--bg-light);
}

.cart-item-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: var(--text-color);
    font-size: 0.9rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border: 2px solid var(--primary-color);
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--accent-color);
    transition: all 0.3s;
}

.quantity-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.quantity-value {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.cart-item-total {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
}

.btn-remove {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.btn-remove:hover {
    color: var(--accent-color);
}

.cart-summary {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.total-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
}

.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--bg-white);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.empty-cart p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* Checkout Page */
.checkout-page {
    padding: 2rem 0;
    max-width: 600px;
}

.checkout-form {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.checkout-summary {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.checkout-summary-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
}

.checkout-summary .total-info,
.checkout-summary .checkout-summary-note {
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: left;
    font-size: 1.2rem;
    line-height: 1.45;
    box-sizing: border-box;
}

.checkout-summary .checkout-summary-note {
    color: var(--text-color);
}

.total-info {
    font-size: 1.2rem;
    text-align: center;
}

.total-info strong {
    color: var(--accent-color);
    font-size: 1.5rem;
}

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

.validation-summary {
    background-color: #FFE8E8;
    color: #D32F2F;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.text-danger {
    color: #D32F2F;
    font-size: 0.9rem;
    display: block;
    margin-top: 0.25rem;
}

/* Confirmation Page */
.confirmation-page {
    padding: 4rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.confirmation-box {
    background-color: var(--bg-white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 600px;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background-color: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 1.5rem;
}

.confirmation-box h1 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.order-number {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.confirmation-message {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    line-height: 1.8;
}

.order-details {
    text-align: left;
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.order-details h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.order-details p {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Page Content */
.page-content {
    padding: 2rem 0;
    min-height: 60vh;
}

.about-content,
.contacts-content,
.delivery-content,
.custom-order-content {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.about-content p,
.custom-order-content p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.about-subtitle {
    font-size: 1.35rem;
    margin: 2rem 0 1rem;
    color: var(--accent-color);
}

.about-subtitle--h3 {
    font-size: 1.15rem;
    margin: 1.75rem 0 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
}

.requisites-legal-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-dark);
}

.about-store-photo {
    margin: 1.75rem 0 1.75rem 0;
    text-align: center;
}

.about-store-photo img {
    width: 100%;
    max-width: 720px;
    height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: inline-block;
    vertical-align: middle;
}

.about-store-photo figcaption {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    color: #6a5b54;
}

.requisites-list {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 0.5rem 1.5rem;
    margin: 1rem 0 1.5rem;
    font-size: 1rem;
}

.requisites-list dt {
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.requisites-list dd {
    margin: 0;
}

.requisites-list--compact {
    grid-template-columns: minmax(100px, 160px) 1fr;
}

.requisites-note {
    font-size: 0.95rem;
    color: #6a5b54;
    margin-top: 1rem;
}

.legal-doc h2 {
    font-size: 1.25rem;
    margin: 1.75rem 0 0.75rem;
    color: var(--accent-color);
}

.legal-doc ul {
    margin: 0.5rem 0 1rem 1.25rem;
}

.legal-doc li {
    margin-bottom: 0.4rem;
}

.legal-disclaimer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #6a5b54;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem 1.25rem;
    max-width: 900px;
}

.footer-legal a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.footer-legal a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.footer-copy {
    font-size: 0.9rem;
    color: var(--text-color);
    margin: 0;
}

.footer-requisites {
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text-color);
    opacity: 0.92;
    text-align: center;
    max-width: 52rem;
    margin: 0;
}

.footer-requisites a {
    color: inherit;
    text-decoration: none;
}

.footer-requisites a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

/* Согласие на ПД — чекаут */
.pd-consent-block {
    margin-top: 0.25rem;
}

.pd-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.pd-consent-checkbox {
    margin-top: 0.35rem;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.pd-consent-label {
    font-size: 0.95rem;
    line-height: 1.45;
    cursor: pointer;
    color: var(--text-color);
}

.pd-consent-label a {
    color: var(--accent-color);
    text-decoration: underline;
}

.pd-consent-label a:hover {
    opacity: 0.9;
}

/* Баннер cookie */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 12000;
    padding: 0.75rem 1rem;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

.cookie-consent-banner[hidden] {
    display: none !important;
}

.cookie-consent-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
}

.cookie-consent-text {
    flex: 1 1 280px;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-color);
}

.cookie-consent-text a {
    color: var(--accent-color);
    font-weight: 500;
}

.cookie-consent-btn {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

html[data-theme="dark"] .cookie-consent-banner {
    background: var(--bg-white);
    border-top-color: var(--border-color);
}

@media (max-width: 600px) {
    .requisites-list {
        grid-template-columns: 1fr;
    }

    .requisites-list dt {
        margin-top: 0.75rem;
    }

    .requisites-list dt:first-of-type {
        margin-top: 0;
    }
}

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

.contact-item {
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 10px;
    height: 100%;
    box-sizing: border-box;
}

.contact-item h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.contact-item p a {
    color: inherit;
    text-decoration: none;
}

.contact-item p a:hover {
    opacity: 0.88;
}

.contact-item-split {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.contact-split-half {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1.5rem;
    min-height: 0;
}

.contact-split-half h3 {
    margin-bottom: 0.5rem;
}

.contact-split-half--bottom {
    border-top: 1px solid var(--border-color);
}

.contacts-seller-note {
    font-size: 0.95rem;
    line-height: 1.45;
    margin-top: 0.65rem;
    margin-bottom: 0;
    opacity: 0.95;
}

.delivery-content h3 {
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.delivery-content h3:first-child {
    margin-top: 0;
}

.delivery-list {
    margin: 0.75rem 0 1.2rem 1.2rem;
}

.delivery-list li {
    margin-bottom: 0.35rem;
}

.delivery-map {
    width: 100%;
    height: 420px;
    margin-top: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.delivery-note {
    margin-top: 0.8rem;
    font-size: 0.95rem;
    color: #6a5b54;
}

.no-products {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

/* Admin pages */
.admin-page .page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-actions {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-orders-hint {
    margin: -0.5rem 0 1.25rem;
    font-size: 0.9rem;
    color: #6a5b54;
}

.admin-maintenance-block {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 100%;
}

.admin-maintenance-form {
    margin: 0;
}

.admin-flash-message {
    width: 100%;
    max-width: 520px;
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background-color: #f5e6d4;
    color: var(--text-dark);
    font-size: 0.95rem;
    text-align: left;
}

.admin-table-wrapper {
    background-color: var(--bg-white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.95rem;
    table-layout: fixed;
}

.admin-table th,
.admin-table td {
    padding: 0.65rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
    box-sizing: border-box;
}

.admin-table thead th {
    vertical-align: bottom;
}

.admin-table th {
    font-weight: 600;
    color: var(--text-dark);
    background-color: var(--admin-table-header-bg);
}

.admin-table tbody tr:last-child td {
    border-bottom: 1px solid var(--border-color);
}

.admin-table tr:hover td {
    background-color: var(--admin-table-row-hover);
}

.admin-table .admin-col-id {
    width: 3.25rem;
    text-align: center;
}

.admin-table .admin-col-name {
    width: 26%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.admin-table .admin-col-category {
    width: 18%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.admin-table th.admin-col-price,
.admin-table td.admin-col-price {
    width: 6.5rem;
    text-align: right;
    white-space: nowrap;
}

.admin-table .admin-price-cell {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.admin-table th.admin-col-flag,
.admin-table td.admin-col-flag {
    width: 7.5rem;
    text-align: center;
    vertical-align: middle;
}

.admin-table th.admin-col-flag {
    white-space: normal;
    line-height: 1.25;
    hyphens: auto;
}

.admin-table th.admin-col-actions-head {
    text-align: right;
    width: 11.5rem;
    vertical-align: middle;
}

.admin-table td.admin-col-actions {
    vertical-align: middle;
    text-align: right;
    width: 11.5rem;
}

.admin-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    justify-content: flex-end;
    align-items: center;
    align-content: center;
    min-height: 2.25rem;
    box-sizing: border-box;
}

.admin-table-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

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

.btn-link-danger {
    color: #b94b4b;
}

.btn-link-danger:hover {
    color: #d9534f;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.badge-success {
    background-color: #a3c9a8;
    color: #1f3d28;
}

.badge-warning {
    background-color: #f5d09b;
    color: #5c3b12;
}

.badge-danger {
    background-color: #e7a4a4;
    color: #5b1e1e;
}

.badge-muted {
    background-color: #ddd2c7;
    color: #554840;
}

.admin-form {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 700px;
}

.admin-form .form-actions {
    flex-direction: row;
    align-items: stretch;
    flex-wrap: wrap;
}

.admin-form .form-actions .btn-primary,
.admin-form .form-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    min-height: 3rem;
}

@media (max-width: 520px) {
    .admin-form .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-order-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-order-block {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.admin-status-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-order-comments {
    margin-top: 2rem;
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.admin-order-back {
    margin-top: 2.5rem;
    padding: 1.25rem 1.5rem;
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.admin-order-back .btn-secondary {
    display: inline-block;
}

/* Страница технических работ */
.maintenance-body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #f7efe6 0%, #f1ddc9 100%);
}

.maintenance-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.maintenance-inner {
    max-width: 520px;
    background-color: var(--bg-white);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-hover);
    text-align: center;
}

.maintenance-title {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    color: var(--accent-color);
}

.maintenance-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.maintenance-text a {
    color: inherit;
    text-decoration: none;
}

.maintenance-text a:hover {
    opacity: 0.88;
}

.maintenance-sign {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: #6a5b54;
}

/* Всплывающие уведомления (корзина и т.д.) */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: min(320px, calc(100vw - 2.5rem));
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
    animation: notificationSlideIn 0.3s ease-out;
}

.notification.success {
    background-color: #A8D5BA;
    color: #1f3d28;
}

.notification.remove {
    background-color: #c94a4a;
    color: #fff;
}

.notification.error {
    background-color: #D4A5A5;
    color: #3b2f2a;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Footer */
footer {
    background-color: var(--bg-white);
    padding: 2rem 0;
    margin-top: 4rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 3rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .products-layout {
        grid-template-columns: 1fr;
    }
    
    .categories-sidebar {
        position: static;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }
    
    .cart-item-quantity,
    .cart-item-total,
    .btn-remove {
        grid-column: 2;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Details Page */
.product-details-page {
    padding: 2rem 0;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    align-items: start;
}

.product-details-image {
    grid-column: 1;
    order: 1;
}

.product-details-info {
    grid-column: 2;
    order: 2;
}

.product-details-image {
    background-color: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.product-main-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 600px;
    border-radius: 15px;
}

.product-main-image-placeholder {
    width: 100%;
    min-height: 400px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
}

.product-details-info {
    background-color: var(--bg-white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-details-name {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-decoration: none !important;
    border-bottom: none !important;
}

.product-details-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    flex-grow: 1;
}

.product-details-description p {
    margin: 0;
}

.product-details-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 10px;
    margin: 0;
}

.price-label {
    font-size: 1.2rem;
    color: var(--text-color);
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.product-details-actions {
    margin: 0;
}

.btn-add-to-cart-large {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.other-products-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.other-products-section .section-title {
    text-align: left;
    margin-bottom: 2rem;
    font-size: 2rem;
}

@media (max-width: 768px) {
    .product-details {
        grid-template-columns: 1fr;
    }
    
    .product-details-image {
        position: static;
        grid-column: 1;
        order: 1;
    }
    
    .product-details-info {
        grid-column: 1;
        order: 2;
        padding: 1.5rem;
    }
    
    .product-details-name {
        font-size: 2rem;
    }
}

/* ========== Тёмная тема (ночной «сад»: графит + пыльная роза) ========== */
:root[data-theme="dark"] {
    --primary-color: #c97d94;
    --secondary-color: #2c2a32;
    --accent-color: #e8b4c4;
    --text-color: #e6e2ea;
    --text-dark: #faf7fc;
    --bg-light: #131218;
    --bg-white: #1e1c24;
    --border-color: #3d3a46;
    --success-color: #7daf88;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.55);
    --admin-table-header-bg: #302c38;
    --admin-table-row-hover: rgba(232, 180, 196, 0.09);
}

:root[data-theme="dark"] header {
    background: linear-gradient(95deg, #17151d 0%, #252030 55%, #2a2434 100%);
}

:root[data-theme="dark"] .validation-summary {
    background-color: rgba(180, 70, 90, 0.22);
    color: #ffc8d4;
}

:root[data-theme="dark"] .cart-notice {
    background: rgba(232, 180, 196, 0.12);
    color: var(--text-color);
}

:root[data-theme="dark"] .welcome-section {
    background: linear-gradient(145deg, #14121a 0%, #1f1b28 45%, #252030 100%);
}

:root[data-theme="dark"] .product-card {
    border-color: var(--border-color);
}

:root[data-theme="dark"] .product-card:hover {
    border-color: rgba(232, 180, 196, 0.45);
    box-shadow: var(--shadow-hover), 0 0 0 1px rgba(232, 180, 196, 0.12);
}

:root[data-theme="dark"] .admin-orders-hint {
    color: var(--text-color);
    opacity: 0.88;
}

:root[data-theme="dark"] .btn-link-danger {
    color: #f0a0a8;
}

:root[data-theme="dark"] .btn-link-danger:hover {
    color: #ffc4c9;
}

:root[data-theme="dark"] .admin-flash-message {
    background-color: rgba(232, 180, 196, 0.12);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.15rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: rgba(178, 106, 90, 0.15);
}

:root[data-theme="dark"] .theme-toggle-btn:hover {
    background-color: rgba(232, 180, 196, 0.14);
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.theme-toggle-icon[hidden] {
    display: none !important;
}

.theme-toggle-moon:not([hidden]) .theme-toggle-icon,
.theme-toggle-flower:not([hidden]) .theme-toggle-icon {
    animation: themeIconSwap 0.28s ease;
}

@keyframes themeIconSwap {
    0% { opacity: 0; transform: scale(0.85) rotate(-8deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Товар «закончился» */
.product-card.product-card-out-of-stock .product-image,
.product-details-page.product-out-of-stock .product-main-image {
    filter: grayscale(1);
    opacity: 0.72;
}

.stock-badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
    border-radius: 6px;
    background: var(--secondary-color);
    color: var(--text-dark);
}

.btn-add-to-cart:disabled,
.btn-add-to-cart-large:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Checkout: кнопки по центру как на подтверждении */
.checkout-page .form-actions {
    align-items: center;
}

.checkout-page .form-actions .btn-checkout,
.checkout-page .form-actions .btn-secondary {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

/* Модалка «Связаться» */
.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.contact-modal[hidden] {
    display: none !important;
}

.contact-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    animation: contactBackdropIn 0.25s ease forwards;
}

.contact-modal-dialog {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
    background: var(--bg-white);
    color: var(--text-color);
    padding: 2rem 1.75rem;
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    transform: translateY(12px);
    opacity: 0;
    animation: contactDialogIn 0.28s ease forwards;
}

.contact-modal h2 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.contact-modal-intro {
    margin-bottom: 1rem;
}

.contact-modal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    line-height: 1.8;
}

.contact-modal-list a {
    color: inherit;
    text-decoration: none;
}

.contact-modal-list a:hover {
    opacity: 0.88;
}

.contact-modal-note {
    font-size: 0.82rem;
    color: var(--text-color);
    opacity: 0.85;
}

.contact-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    border: none;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color);
}

@keyframes contactBackdropIn {
    to { opacity: 1; }
}

@keyframes contactDialogIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Футер: вход админа */
.footer-admin-row {
    margin-top: 1rem;
    text-align: center;
}

.footer-admin-link {
    color: var(--accent-color);
    font-size: 0.95rem;
}

.footer-logout-form {
    display: inline;
}

.footer-admin-link,
.footer-logout-form button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--accent-color);
    text-decoration: underline;
}

/* Страница входа админа */
.admin-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 55vh;
}

.admin-login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.admin-table .badge-stock {
    font-size: 0.75rem;
}

.admin-flash {
    background: var(--secondary-color);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}
