﻿/* =============================================
   ArtMastex Calculator - Стили в стиле прайс-листа
   ============================================= */

/* Шрифты */
@font-face {
    font-family: 'NauryzRedKeds';
    src: url('font/NauryzRedKeds.ttf') format('truetype');
    font-style: normal;
    font-weight: normal;
}

/* Базовые стили */
:root {
    --preview-bg: #7231FF;
    --preview-accent: #7231FF;
    --preview-accent-hover: #5a26cc;
    --preview-accent-muted: rgba(114, 49, 255, 0.15);
}

html.calculator-page {
    --preview-bg: #622ADB;
    --preview-accent: #7231FF;
    --preview-accent-hover: #5a26cc;
    --preview-accent-muted: rgba(114, 49, 255, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Убираем подсветку при тапе на мобильных */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Разрешаем выделение для полей ввода и редактируемых элементов */
input,
textarea,
select,
[contenteditable="true"],
[contenteditable="true"] * {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Отключаем автозаполнение для всех полей в калькуляторе */
#product-form input,
#product-form textarea,
#product-form select,
#client-data-form input,
#client-data-form textarea,
#client-data-form select,
.layers-container input,
.layers-container textarea,
.layers-container select {
    autocomplete: off;
    -webkit-autocomplete: off;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Предотвращает автоматическое изменение размера текста на iOS */
    -ms-text-size-adjust: 100%;
}

html:not(.preview-chrome-page) body {
    font-family: "Unbounded", sans-serif;
    font-size: 14px;
    font-weight: 400;
    min-height: 100vh;
    padding-bottom: 40px;
    background-image: url(picture/sparkles-background.svg), url(picture/Vector.svg);
    background-repeat: no-repeat;
    background-size: contain, cover;
    background-position: 100% 0, 100% 0;
    background-color: var(--preview-accent);
    background-attachment: scroll;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Unbounded", sans-serif;
    font-size: 14px;
    font-weight: 400;
    min-height: 100vh;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Контейнер */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    overflow: visible; /* Чтобы котик не обрезался */
}

/* =============================================
   Шапка
   ============================================= */

.header {
    text-align: center;
    padding: 0 0 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    z-index: 1;
}

.logo {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    transform: translateY(-20px);
    z-index: 10;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
    position: relative;
    z-index: 11;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-5px);
}

.title-with-clouds {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    position: relative;
}

.main-title {
    font-family: "NauryzRedKeds", sans-serif;
    font-size: 72px;
    color: white;
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    letter-spacing: 2px;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.title-cloud {
    width: 144px; /* Увеличено на 20% (было 120px) */
    height: 144px; /* Увеличено на 20% (было 120px) */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: swing var(--swing-duration, 4s) ease-in-out infinite;
    animation-delay: calc(var(--delay, 0s) + 2.5s); /* Начинаем качание после падения */
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.15));
    transform-origin: top center; /* Точка вращения сверху */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.title-cloud img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.falling-cloud {
    animation: fallWithBounce 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--delay, 0s);
    opacity: 0;
    transform-origin: top center;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.1));
}

/* Анимация падения с отскоком */
@keyframes fallWithBounce {
    0% {
        opacity: 0;
        transform: translateY(-200px) rotate(0deg) scale(0.8);
    }
    
    60% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(0.95);
    }
    70% {
        transform: translateY(-8px) rotate(-0.5deg) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

/* Анимация качания на ниточке */
@keyframes swing {
    0%, 100% {
        transform: rotate(-1.5deg) translateX(-1px);
    }
    50% {
        transform: rotate(2deg) translateX(1.5px);
    }
}

.subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    font-weight: 300;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* =============================================
   Основной контент
   ============================================= */

.main-content {
    display: grid;
    grid-template-columns: 1.4fr 1fr; /* Среднее значение между 1.5fr и 1.2fr */
    gap: 30px;
    flex: 1;
    align-items: start;
    margin-bottom: 40px;
    margin-top: -10px;
    position: relative;
    z-index: 1;
}

/* =============================================
   Секции формы
   ============================================= */

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow: visible; /* Чтобы котик не обрезался */
    position: relative;
}

.form-card {
    background: white;
    border-radius: 30px;
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 30px;
    color: #333;
    overflow: visible; /* Чтобы котик не обрезался */
}

.form-cat {
    display: none; /* Скрыт на всех страницах */
    position: absolute;
    left: -175px; /* Сдвинуто левее, чтобы не перекрывать блок */
    top: 50%;
    transform: translateY(-50%);
    width: 192px;
    height: 320px;
    z-index: 1;
    pointer-events: none;
}

.form-cat img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-card {
    background: white;
    border-radius: 30px;
    padding: 30px;
    --cart-card-padding: 30px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    color: #333;
    overflow: visible;
}

/* Убеждаемся, что все элементы внутри белых карточек имеют темный цвет */
.form-card *,
.cart-card * {
    color: inherit;
}

.form-card input,
.form-card select,
.form-card textarea,
.cart-card input,
.cart-card select,
.cart-card textarea {
    color: #333;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    position: relative;
}

.section-title > .form-title-actions {
    margin-left: auto;
}

.title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #FFE343;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--preview-accent);
}

.title-icon i {
    font-size: 0.95em;
    line-height: 1;
    color: #333;
    font-weight: 900;
}

.empty-icon i {
    font-size: 1em;
    line-height: 1;
    color: inherit;
    font-weight: 900;
}

.category-icon i {
    font-size: 1em;
}

.items-count {
    margin-left: auto;
    background: var(--preview-accent);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}


/* Панель тиражей в cart-summary (оверлей поверх cart-items, без сдвига итогов) */
.solo-tiers-panel {
    position: relative;
    z-index: 2;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.solo-tiers-panel[hidden] {
    display: none !important;
}

.solo-tiers-panel:not([hidden]) + .summary-row {
    border-top: 1px dashed rgba(114, 49, 255, 0.22);
    margin-top: 4px;
    padding-top: 14px;
}

.solo-tiers-accordion {
    position: relative;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    overflow: visible;
}

.solo-tiers-accordion-summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary, #333);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    user-select: none;
    position: relative;
    z-index: 2;
}

.solo-tiers-accordion-summary::-webkit-details-marker {
    display: none;
}

.solo-tiers-accordion-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.solo-tiers-accordion-title i {
    color: var(--preview-accent, #7231FF);
    font-size: 12px;
}

.solo-tiers-accordion-summary::after {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-secondary, #666);
    border-bottom: 2px solid var(--text-secondary, #666);
    transform: rotate(-135deg);
    transition: transform 0.2s ease;
    margin-top: 2px;
}

.solo-tiers-accordion[open] .solo-tiers-accordion-summary::after {
    transform: rotate(45deg);
    margin-top: -3px;
}

.solo-tiers-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 3;
    padding: 12px;
    max-height: min(42vh, 300px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #CCB2FA transparent;
    background: linear-gradient(135deg, #F8F6FF 0%, #EDE8FF 100%);
    border: 1px solid rgba(114, 49, 255, 0.18);
    border-radius: 12px;
    box-shadow: 0 -10px 28px rgba(88, 52, 170, 0.16);
    box-sizing: border-box;
}

.solo-tiers-content::-webkit-scrollbar {
    width: 6px;
}

.solo-tiers-content::-webkit-scrollbar-thumb {
    background: #CCB2FA;
    border-radius: 3px;
}

.solo-tiers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.solo-tier-item {
    padding: 12px 14px;
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid var(--preview-accent, #7231FF);
}

.solo-tier-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.solo-tier-quantity {
    font-size: 16px;
    font-weight: 700;
    color: var(--preview-accent, #7231FF);
    margin-bottom: 8px;
}

.solo-tier-progress {
    height: 7px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px;
}

.solo-tier-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7231FF 0%, #9B59B6 100%);
    transition: width 0.4s ease;
    border-radius: 6px;
}

.solo-tier-needed {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.solo-tiers-empty {
    padding: 8px 4px 4px;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* =============================================
   Форма добавления продукта
   ============================================= */

.product-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.form-group select,
.form-group input[type="number"],
.form-group input[type="text"],
.form-group textarea,
.layer-group textarea,
.layer-group .form-control {
    padding: 14px 18px;
    border: 2px solid #E0DDEB;
    border-radius: 15px;
    font-family: inherit;
    font-size: 14px;
    background: #FAFAFA;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

/* Специфичные стили для textarea */
.form-group textarea,
.layer-group textarea,
.layer-group textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
    width: 100%;
}

.form-group textarea::placeholder,
.layer-group textarea::placeholder,
.layer-group textarea.form-control::placeholder {
    color: #999;
    opacity: 1;
}

/* Скрываем стандартные стрелки для input[type="number"] */
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Для Firefox - скрываем стандартные стрелки */
.form-group input[type="number"] {
    -moz-appearance: textfield;
}

/* Кастомные кнопки для изменения количества */
.quantity-spinner {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
}

.quantity-spinner-btn {
    width: 18px;
    height: 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 10px;
    color: var(--preview-accent);
    line-height: 1;
    pointer-events: auto;
    border-radius: 3px;
}

.quantity-spinner-btn:hover {
    background: #F8F6FF;
}

.quantity-spinner-btn:active {
    background: #E0DDEB;
    transform: scale(0.95);
}

.quantity-spinner-btn.up::before {
    content: '▲';
    font-size: 10px;
    line-height: 1;
}

.quantity-spinner-btn.down::before {
    content: '▼';
    font-size: 10px;
    line-height: 1;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus,
.layer-group textarea:focus,
.layer-group .form-control:focus {
    border-color: var(--preview-accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

.form-group select:disabled,
.form-group textarea:disabled,
.layer-group textarea:disabled,
.layer-group .form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Обертка для поля ввода количества и кнопок */
.quantity-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quantity-input-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.quantity-input-wrapper input {
    flex: 0 0 auto;
    width: 100px;
    transition: all 0.3s ease;
}

/* Подсветка поля ввода количества при выборе через кнопки */
input.quantity-input-highlighted,
#quantity.quantity-input-highlighted,
#layer-input-quantity.quantity-input-highlighted,
input[type="number"].quantity-input-highlighted {
    background-color: #F0EBFF !important;
    border-color: var(--preview-accent) !important;
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.15) !important;
    transform: scale(1.02);
}

/* Быстрые кнопки количества */
.quantity-quick-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quantity-quick-btn {
    width: 70px;
    min-width: 50px;
    padding: 14px 8px;
    border: 2px solid #E0DDEB;
    background: #FAFAFA;
    border-radius: 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    box-sizing: border-box;
}

.quantity-quick-btn:hover {
    border-color: var(--preview-accent);
    background: #F8F6FF;
    transform: translateY(-1px);
}

.quantity-quick-btn:active {
    transform: translateY(0);
}

/* Grid кнопки для выбора опций */
.option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.option-button {
    padding: 14px 18px;
    border: 2px solid #E0DDEB;
    background: #FAFAFA;
    border-radius: 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
    white-space: nowrap;
    min-width: 120px;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.option-grid.missing-field,
.form-group.missing-field,
input.missing-field {
    animation: shake 1s ease;
}

.option-grid.missing-field .option-button {
    border-color: #D32F2F;
    background: #FFEBEE;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2);
}

input.missing-field,
.custom-size-container.missing-field {
    border-color: #D32F2F !important;
    background: #FFEBEE !important;
}

/* Подсветка поля загрузки файла при ошибке */
.file-upload-group.missing-field .file-upload-area {
    border-color: #D32F2F !important;
    background: #FFEBEE !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2) !important;
}

.file-upload-area.missing-field {
    border-color: #D32F2F !important;
    background: #FFEBEE !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.option-button:hover {
    border-color: var(--preview-accent);
    background: #F8F6FF;
    transform: translateY(-2px);
}

.option-button.active {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
    border-color: #FFE343;
    font-weight: 600;
}

.option-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Сетка для типов цветного акрила с изображениями */
.option-grid.acrylic-types-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
    margin-top: 12px;
}

.option-grid.acrylic-types-grid .acrylic-category-header {
    grid-column: 1 / -1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary, #666);
    margin: 8px 0 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color, #e8e8e8);
}

.option-grid.acrylic-types-grid .acrylic-category-header:first-child {
    border-top: none;
    margin-top: 0;
}

/* Аккордеоны категорий цветного акрила (calculator) */
.acrylic-type-accordions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.acrylic-secret-unlock {
    cursor: context-menu;
    user-select: none;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

.acrylic-secret-unlock--active {
    color: #c45c12;
    text-shadow: 0 0 0.4px currentColor;
}

.acrylic-type-accordion {
    border: 1px solid var(--border-color, #e8e8e8);
    border-radius: 12px;
    background: var(--bg-secondary, #fafafa);
    overflow: hidden;
}

.acrylic-type-accordion-summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #222);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.acrylic-type-accordion-summary::-webkit-details-marker {
    display: none;
}

.acrylic-type-accordion-summary::after {
    content: '';
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-secondary, #666);
    border-bottom: 2px solid var(--text-secondary, #666);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -4px;
}

.acrylic-type-accordion:not([open]) .acrylic-type-accordion-summary::after {
    transform: rotate(-45deg);
    margin-top: 2px;
}

.acrylic-type-accordion-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
    margin-top: 0;
    padding: 0 12px 12px;
}

.acrylic-type-accordion-grid .acrylic-type-button,
.acrylic-types-grid .acrylic-type-button {
    background: var(--bg-primary, #fff);
    padding: 8px 4px;
    min-width: 0;
}

.acrylic-type-accordion-grid .acrylic-type-content,
.acrylic-types-grid .acrylic-type-content {
    gap: 5px;
    width: 100%;
}

.acrylic-type-accordion-grid .badge-shape-img-wrap,
.acrylic-types-grid .badge-shape-img-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acrylic-type-accordion-grid .badge-shape-img-wrap .acrylic-type-img,
.acrylic-types-grid .badge-shape-img-wrap .acrylic-type-img {
    display: block;
    width: 88%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.acrylic-type-accordion-grid .acrylic-type-button:hover .badge-shape-img-wrap .acrylic-type-img,
.acrylic-type-accordion-grid .acrylic-type-button.active .badge-shape-img-wrap .acrylic-type-img,
.acrylic-types-grid .acrylic-type-button:hover .badge-shape-img-wrap .acrylic-type-img,
.acrylic-types-grid .acrylic-type-button.active .badge-shape-img-wrap .acrylic-type-img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.acrylic-type-accordion-grid .badge-shape-expand-btn,
.acrylic-types-grid .badge-shape-expand-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 7px;
    background: rgba(40, 40, 45, 0.82);
    color: #fff;
    cursor: zoom-in;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease,
        background 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.acrylic-type-accordion-grid .badge-shape-img-wrap:hover .badge-shape-expand-btn,
.acrylic-type-accordion-grid .acrylic-type-button.active .badge-shape-expand-btn,
.acrylic-type-accordion-grid .badge-shape-expand-btn:focus-visible,
.acrylic-types-grid .badge-shape-img-wrap:hover .badge-shape-expand-btn,
.acrylic-types-grid .acrylic-type-button.active .badge-shape-expand-btn,
.acrylic-types-grid .badge-shape-expand-btn:focus-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.acrylic-type-accordion-grid .badge-shape-expand-btn:hover,
.acrylic-type-accordion-grid .badge-shape-expand-btn:focus-visible,
.acrylic-types-grid .badge-shape-expand-btn:hover,
.acrylic-types-grid .badge-shape-expand-btn:focus-visible {
    background: rgba(30, 30, 35, 0.95);
}

.acrylic-type-accordion-grid .badge-shape-expand-icon,
.acrylic-types-grid .badge-shape-expand-icon {
    display: block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.acrylic-type-accordion-grid .acrylic-type-label,
.acrylic-types-grid .acrylic-type-label {
    font-size: 12px;
    line-height: 1.25;
}

.acrylic-type-accordion-grid .acrylic-radio-dot,
.acrylic-types-grid .acrylic-radio-dot {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.acrylic-type-accordion-grid .acrylic-type-button.active .acrylic-radio-dot::after,
.acrylic-types-grid .acrylic-type-button.active .acrylic-radio-dot::after {
    width: 7px;
    height: 7px;
}

@media (min-width: 769px) {
    .acrylic-type-accordion-grid,
    .option-grid.acrylic-types-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px;
    }

    .acrylic-type-accordion-grid .badge-shape-img-wrap .acrylic-type-img,
    .acrylic-types-grid .badge-shape-img-wrap .acrylic-type-img {
        width: 84%;
    }
}

@media (hover: none) {
    .acrylic-type-accordion-grid .badge-shape-expand-btn,
    .acrylic-types-grid .badge-shape-expand-btn {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.96);
    }

    .acrylic-type-accordion-grid .acrylic-type-button.active .badge-shape-expand-btn,
    .acrylic-type-accordion-grid .badge-shape-expand-btn:focus-visible,
    .acrylic-types-grid .acrylic-type-button.active .badge-shape-expand-btn,
    .acrylic-types-grid .badge-shape-expand-btn:focus-visible {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
}

/* Крупные карточки radio_image (поле с grid_variant: large в categories.json) */
.option-grid.acrylic-colors-grid.radio-image-large-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 14px;
}

.radio-image-large-grid .acrylic-type-button {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 14px;
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.radio-image-large-grid .acrylic-type-content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 0;
}

.radio-image-large-grid .acrylic-type-img {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.radio-image-large-grid .acrylic-type-label {
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .option-grid.acrylic-colors-grid.radio-image-large-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Крупные карточки формы значка (Закатные значки, слой badge_shape) */
.option-grid.acrylic-colors-grid.badge-shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 20px;
    margin-top: 14px;
}

.badge-shape-grid .acrylic-type-button {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.badge-shape-grid .acrylic-type-content {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 0;
}

.badge-shape-grid .badge-shape-img-wrap {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Скачивание макета только у выбранной формы (класс .active на карточке) */
.badge-shape-grid .badge-shape-download-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 4;
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: rgba(40, 40, 45, 0.82);
    color: #fff;
    cursor: pointer;
    opacity: 1;
    transition:
        opacity 0.2s ease,
        background 0.15s ease,
        transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.badge-shape-grid .acrylic-type-button.active .badge-shape-download-btn {
    display: flex;
}

.badge-shape-grid .badge-shape-download-btn:hover,
.badge-shape-grid .badge-shape-download-btn:focus-visible {
    background: rgba(30, 30, 35, 0.95);
    outline: none;
}

.badge-shape-grid .badge-shape-download-icon {
    display: block;
    flex-shrink: 0;
}

.badge-shape-grid .badge-shape-expand-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: rgba(40, 40, 45, 0.82);
    color: #fff;
    cursor: zoom-in;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease,
        background 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-shape-grid .badge-shape-img-wrap:hover .badge-shape-expand-btn,
.badge-shape-grid .badge-shape-expand-btn:focus-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.badge-shape-grid .badge-shape-expand-btn:hover,
.badge-shape-grid .badge-shape-expand-btn:focus-visible {
    background: rgba(30, 30, 35, 0.95);
}

.badge-shape-grid .badge-shape-expand-icon {
    display: block;
    flex-shrink: 0;
}

.badge-shape-grid .acrylic-type-button.badge-shape-out-of-stock .badge-shape-expand-btn {
    cursor: zoom-in;
    opacity: 0;
    visibility: hidden;
}

.badge-shape-grid .acrylic-type-button.badge-shape-out-of-stock .badge-shape-img-wrap:hover .badge-shape-expand-btn {
    opacity: 1;
    visibility: visible;
}

@media (hover: none) {
    .badge-shape-grid .badge-shape-expand-btn {
        opacity: 0.55;
        visibility: visible;
        transform: scale(1);
    }

    .badge-shape-grid .badge-shape-img-wrap:active .badge-shape-expand-btn {
        opacity: 1;
    }
}

.badge-shape-grid .badge-shape-img-wrap .acrylic-type-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: none;
    cursor: inherit;
}

.badge-shape-grid .acrylic-type-img {
    width: 100%;
    max-width: 100%;
    object-fit: contain;
}

.badge-shape-grid .acrylic-type-label {
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.badge-shape-grid .acrylic-type-button.badge-shape-out-of-stock {
    opacity: 0.72;
    cursor: not-allowed;
}

.badge-shape-grid .acrylic-type-button.badge-shape-out-of-stock:hover {
    transform: none;
    border-color: #E0DDEB;
    background: #FAFAFA;
}

.badge-shape-stock-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    background: rgba(80, 80, 80, 0.92);
    color: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    max-width: calc(100% - 8px);
    text-align: center;
}

/* Форма закатного значка: на мобильных ровно 2 колонки */
@media (max-width: 768px) {
    #layer-grid-badge_shape.option-grid.acrylic-colors-grid.badge-shape-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    #layer-grid-badge_shape .acrylic-type-button {
        min-width: 0;
    }
}

.acrylic-type-button {
    padding: 12px;
    border: 2px solid #E0DDEB;
    background: #FAFAFA;
    border-radius: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.acrylic-type-button:hover {
    border-color: var(--preview-accent);
    background: #F8F6FF;
    transform: translateY(-2px);
}

.acrylic-type-button.active {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    border-color: #FFE343;
}

.acrylic-type-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.acrylic-type-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: zoom-in;
    transition: all 0.2s ease;
}

.acrylic-type-img:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

.acrylic-type-label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-align: center;
}

.acrylic-type-button.active .acrylic-type-label {
    font-weight: 600;
    color: #333;
}

/* Радиокнопка (точечка) под изображением */
.acrylic-radio-dot {
    width: 20px;
    height: 20px;
    border: 2px solid var(--preview-accent);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 4px;
    position: relative;
    flex-shrink: 0;
}

.acrylic-radio-dot:hover {
    border-color: #FFE343;
    background: rgba(114, 49, 255, 0.1);
    transform: scale(1.1);
}

.acrylic-type-button.active .acrylic-radio-dot {
    background: var(--preview-accent);
    border-color: var(--preview-accent);
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.2);
}

.acrylic-type-button.active .acrylic-radio-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Модальное окно для просмотра изображений материалов */
.material-image-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

.material-image-modal.is-open {
    display: flex;
}

#modal-root .material-image-modal {
    pointer-events: auto;
    z-index: 2;
}

html.material-image-modal-open {
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.material-image-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: min(90vw, 100%);
    max-height: min(90vh, 90dvh);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.material-image-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E0DDEB;
    background: #F8F6FF;
}

.material-image-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding-right: 8px;
}

.material-image-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.material-image-modal-close:hover {
    background: #E0DDEB;
    color: #333;
}

.material-image-modal-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(90vh - 80px);
    overflow: auto;
}

.material-image-modal-img {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    object-fit: contain;
    border-radius: 8px;
}

/* Кастомный размер */
.custom-size-container {
    margin-top: 15px;
    padding: 15px;
    background: #F8F6FF;
    border-radius: 15px;
    border: 2px dashed #CCB2FA;
}

.custom-size-label {
    display: block;
    font-weight: 500;
    color: #555;
    font-size: 13px;
    margin-bottom: 10px;
}

.custom-size-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.custom-size-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E0DDEB;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    background: white;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

.custom-size-input:focus {
    border-color: var(--preview-accent);
}

.btn-apply-custom {
    padding: 12px 20px;
    background: var(--preview-accent);
    color: white;
    border: none;
    border-radius: 12px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-apply-custom:hover {
    background: var(--preview-accent-hover);
    transform: translateY(-2px);
}

.custom-size-hint {
    font-size: 12px;
    color: #888;
    margin: 0;
    font-style: italic;
}

/* Карточка для ввода произвольного размера в полях типа radio */
.custom-size-card {
    margin-top: 15px;
    padding: 15px;
    background: #F8F6FF;
    border-radius: 15px;
    border: 2px dashed #CCB2FA;
    display: block !important;
    visibility: visible !important;
}

.custom-size-card .custom-size-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.custom-size-card .custom-size-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E0DDEB;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    background: white;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

.custom-size-card .custom-size-input:focus {
    border-color: var(--preview-accent);
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

.custom-size-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-apply-custom-size:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-apply-custom-size:disabled:hover {
    transform: none;
    background: #ccc;
}

.btn-apply-custom-size {
    padding: 12px 16px;
    background: var(--preview-accent);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    width: 44px;
    height: 44px;
    font-size: 16px;
    position: relative;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
}

.btn-apply-custom-size .btn-check-icon {
    display: inline-block;
    font-size: 20px;
    line-height: 1;
    font-weight: bold;
    color: white;
}

.btn-apply-custom-size:hover {
    background: var(--preview-accent-hover);
    transform: translateY(-2px);
}

.btn-apply-custom-size:active {
    transform: translateY(0);
}

.custom-size-container.custom-size-applied {
    border-style: solid;
    border-color: #22c55e;
    background: #f0fdf4;
    animation: customSizeAppliedPulse 0.65s ease;
}

.custom-size-input.custom-size-applied {
    border-color: #22c55e;
}

.btn-apply-custom-size.custom-size-applied {
    background: #22c55e;
}

.btn-apply-custom-size.custom-size-applied:hover {
    background: #16a34a;
}

@keyframes customSizeAppliedPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Placeholder стили */
.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder,
.layer-group textarea::placeholder,
.promocode-input-group input::placeholder {
    color: #999;
    opacity: 1;
}

/* Checkbox стили */
.extras-group {
    padding: 15px;
    background: #F8F6FF;
    border-radius: 15px;
}

/* Контейнер для позиции допников (рендерится в layers-container) */
.extras-position-container {
    width: 100%;
}

.extras-position-container .extras-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.extras-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: white;
    border: 2px solid #E0DDEB;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
    z-index: 1;
}

.checkbox-label:hover {
    z-index: 2;
}

.checkbox-label:hover {
    border-color: var(--preview-accent);
    background: #F8F6FF;
    transform: translateY(-2px);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label input[type="radio"] {
    display: none;
}

.checkbox-icon .extra-icon-img {
    max-width: 44px;
    max-height: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Ламинация закатных: сетка и карточки как у выбора цвета цветного акрила */
.extras-position-container .extras-grid.extras-lamination-grid.option-grid,
.extras-grid.extras-lamination-grid.option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
    margin-top: 12px;
    flex-wrap: unset;
}

.extras-lamination-grid .sunset-lamination-button {
    position: relative;
    width: 100%;
    min-width: 0;
    background: var(--bg-primary, #fff);
    padding: 8px 4px;
}

.extras-lamination-grid .acrylic-type-content {
    gap: 5px;
    width: 100%;
}

.extras-lamination-grid .badge-shape-img-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.extras-lamination-grid .badge-shape-img-wrap .acrylic-type-img {
    display: block;
    width: 88%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.extras-lamination-grid .sunset-lamination-button:hover .badge-shape-img-wrap .acrylic-type-img,
.extras-lamination-grid .sunset-lamination-button.active .badge-shape-img-wrap .acrylic-type-img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.extras-lamination-grid .badge-shape-expand-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 7px;
    background: rgba(40, 40, 45, 0.82);
    color: #fff;
    cursor: zoom-in;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease,
        background 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.extras-lamination-grid .badge-shape-img-wrap:hover .badge-shape-expand-btn,
.extras-lamination-grid .sunset-lamination-button.active .badge-shape-expand-btn,
.extras-lamination-grid .badge-shape-expand-btn:focus-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.extras-lamination-grid .badge-shape-expand-btn:hover,
.extras-lamination-grid .badge-shape-expand-btn:focus-visible {
    background: rgba(30, 30, 35, 0.95);
}

.extras-lamination-grid .acrylic-type-label {
    font-size: 12px;
    line-height: 1.25;
}

.extras-lamination-grid .acrylic-radio-dot {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.extras-lamination-grid .sunset-lamination-button.active .acrylic-radio-dot::after {
    width: 7px;
    height: 7px;
}

.extras-lamination-grid .sunset-lamination-button .lamination-option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

@media (min-width: 769px) {
    .extras-position-container .extras-grid.extras-lamination-grid.option-grid,
    .extras-grid.extras-lamination-grid.option-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px;
    }

    .extras-lamination-grid .badge-shape-img-wrap .acrylic-type-img {
        width: 84%;
    }
}

@media (hover: none) {
    .extras-lamination-grid .badge-shape-expand-btn {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.96);
    }

    .extras-lamination-grid .sunset-lamination-button.active .badge-shape-expand-btn,
    .extras-lamination-grid .badge-shape-expand-btn:focus-visible {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
}

label.option-button.lamination-option-button {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    margin: 0;
    white-space: normal;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

label.option-button.lamination-option-button:hover {
    z-index: 2;
}

label.option-button.lamination-option-button:has(input:checked) {
    background: linear-gradient(135deg, #ffe343 0%, #ffd600 100%);
    border-color: #ffe343;
    font-weight: 600;
}

.lamination-option-button-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    pointer-events: none;
}

.lamination-option-button-text .lamination-option-hint {
    pointer-events: auto;
}

label.lamination-option-button .lamination-option-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.25;
}

label.lamination-option-button .lamination-option-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--preview-accent);
}

label.lamination-option-button:has(input:checked) .lamination-option-price {
    color: #333;
}

label.lamination-option-button.lamination-option-button--with-preview {
    align-items: stretch;
    padding: 10px;
}

.lamination-option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.lamination-option-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

.lamination-option-img-wrap {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    max-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    overflow: visible;
}

.lamination-option-img-toolbar {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    pointer-events: none;
}

.lamination-option-img-toolbar > * {
    pointer-events: auto;
}

.lamination-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    background: rgba(40, 40, 45, 0.82);
    color: #fff;
    cursor: zoom-in;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease,
        background 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lamination-option-img-wrap:hover .lamination-expand-btn,
.lamination-expand-btn:focus-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.lamination-expand-btn:hover,
.lamination-expand-btn:focus-visible {
    background: rgba(30, 30, 35, 0.95);
}

.lamination-expand-icon {
    display: block;
    flex-shrink: 0;
}

.extras-lamination-grid .lamination-option-hint {
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.extras-lamination-grid .lamination-option-hint .extra-hint-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--preview-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    transform-origin: center center;
    text-align: center;
    vertical-align: middle;
}

/* Выравнивание глифа Font Awesome (метрики иконки в шрифте) */
.extras-lamination-grid .lamination-option-hint .extra-hint-icon::before {
    line-height: 1;
    vertical-align: 0;
}

.extras-lamination-grid .lamination-option-hint:hover .extra-hint-icon {
    transform: scale(1.06);
    color: var(--preview-accent-hover);
}

.extras-lamination-grid .lamination-option-hint .extra-tooltip {
    bottom: auto;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    transform: translateY(-6px);
    min-width: 220px;
    max-width: min(320px, 70vw);
}

.extras-lamination-grid .lamination-option-hint:hover .extra-tooltip {
    transform: translateY(0);
}

.extras-lamination-grid .lamination-option-hint .extra-tooltip::after {
    top: -8px;
    bottom: auto;
    right: 10px;
    left: auto;
    border: 8px solid transparent;
    border-top-color: transparent;
    border-bottom-color: var(--preview-accent);
    filter: drop-shadow(0 -1px 2px rgba(0, 0, 0, 0.08));
}

@media (hover: none) {
    .lamination-expand-btn {
        opacity: 0.5;
        visibility: visible;
        transform: scale(1);
    }

    .lamination-option-img-wrap:active .lamination-expand-btn {
        opacity: 1;
    }
}

.lamination-option-icon-slot {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 12px;
}

.lamination-option-icon-slot .extra-icon-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.lamination-option-icon-slot .icon-svg,
.lamination-option-icon-slot svg {
    max-width: 90%;
    max-height: 90%;
}

.lamination-option-placeholder {
    font-size: 42px;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lamination-option-text-block {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.lamination-option-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.lamination-option-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.25;
    flex: 1 1 auto;
    min-width: 0;
}

.lamination-option-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--preview-accent);
    flex-shrink: 0;
    white-space: nowrap;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #E0DDEB;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    pointer-events: none;
}

.checkbox-label input:checked + .checkmark {
    background: var(--preview-accent);
    border-color: var(--preview-accent);
}

.checkbox-label input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 12px;
}

.checkbox-label input:checked ~ .checkbox-content {
    color: var(--preview-accent);
}

.checkbox-label:has(input:checked) {
    border-color: var(--preview-accent);
    background: #F8F6FF;
}

.checkbox-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    pointer-events: none;
    color: #555;
    transition: color 0.2s ease;
    position: relative;
    width: 100%;
}

.checkbox-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    pointer-events: none;
}

.checkbox-icon .icon-svg {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    pointer-events: none;
}

.checkbox-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}

/* Обёртка для иконки подсказки */
.extra-hint-wrapper {
    margin-left: auto;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    isolation: isolate;
}

.extra-hint-icon {
    font-size: 20px;
    color: #999;
    cursor: help;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

.extra-hint-wrapper:hover .extra-hint-icon {
    color: var(--preview-accent);
    transform: scale(1.15);
}

/* Кастомный tooltip */
.extra-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    background: linear-gradient(135deg, var(--preview-accent) 0%, var(--preview-accent-hover) 100%);
    color: white;
    padding: 14px 18px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(114, 49, 255, 0.4);
    z-index: 100000 !important;
    min-width: 280px;
    max-width: 350px;
    text-align: left;
    word-wrap: break-word;
}

.extra-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 24px;
    border: 8px solid transparent;
    border-top-color: var(--preview-accent);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.extra-hint-wrapper:hover .extra-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.extra-hint-wrapper:hover .extra-hint-icon {
    z-index: 0;
}

.checkbox-price {
    font-size: 12px;
    color: var(--preview-accent);
    font-weight: 600;
}

/* Предварительный расчет */
.preview-price {
    background: linear-gradient(135deg, #F8F6FF 0%, #EDE8FF 100%);
    border-radius: 15px;
    padding: 20px;
    border: none;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
}

.preview-row.furniture-price {
    /* Теперь такой же стиль как у "Изделие" */
    font-size: 14px;
    color: #666;
    padding: 8px 0;
}

.preview-row.unit-price-row {
    font-size: 13px;
    color: #666;
    padding: 6px 0;
    border-top: 1px dashed #E0DDEB;
    margin-top: 4px;
}

.preview-row.total {
    border-top: 2px solid #CCB2FA;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--preview-accent);
}

/* Контейнер кнопок формы */
.form-buttons-container {
    display: flex;
    gap: 15px;
    width: 100%;
    margin-top: 20px;
}

/* По умолчанию одна кнопка - она занимает всю ширину */
.form-buttons-container .btn-add {
    width: 100%;
}

/* Когда одна кнопка (явно указано) - она занимает всю ширину */
.form-buttons-container.single-button .btn-add {
    width: 100%;
}

/* Когда две кнопки - они рядом (отмена слева, сохранить справа) и одинаковой ширины */
.form-buttons-container.has-cancel-button {
    justify-content: space-between;
}

.form-buttons-container.has-cancel-button .btn-cancel-changes,
.form-buttons-container.has-cancel-button .btn-add {
    flex: 1 1 0;
    min-width: 0;
}

/* Кнопка добавления */
.btn-add {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
    border: none;
    padding: 18px 30px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-add:hover {
    transform: translateY(-3px);
}

.btn-add:active {
    transform: translateY(1px);
}

/* Режим редактирования товара - фиолетовый как у промокода */
.btn-add.editing-mode {
    background: var(--preview-accent);
    color: white;
}

.btn-add.editing-mode:hover {
    background: var(--preview-accent-hover);
    transform: translateY(-2px);
}

.btn-add.editing-mode:active {
    transform: translateY(1px);
}

/* Режим редактирования заказа */
.editing-order-mode {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%) !important;
}

.btn-cancel-edit {
    margin-left: 10px;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-edit:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

/* Кнопка отмены изменений при редактировании товара - красный как у кнопки очистить */
.btn-cancel-changes {
    background: #FFE0E0;
    color: #D32F2F;
    border: none;
    padding: 18px 30px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-cancel-changes:hover {
    background: #D32F2F;
    color: white;
    transform: translateY(-2px);
}

.btn-cancel-changes:active {
    transform: translateY(1px);
}

/* =============================================
   Блок промокодов
   ============================================= */

/* Стили для модального окна промокода */
#promocode-modal .modal-body {
    padding: 25px 30px;
}

#promocode-modal .active-promocodes {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.promocode-input-group {
    display: flex;
    gap: 10px;
}

.promocode-input-group input {
    flex: 1;
    text-transform: uppercase;
    color: #333;
}

.btn-apply {
    padding: 14px 24px;
    background: var(--preview-accent);
    color: white;
    border: none;
    border-radius: 15px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-apply:hover {
    background: var(--preview-accent-hover);
    transform: translateY(-2px);
}

.active-promocodes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.promocode-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 12px;
    border: 2px solid #E0DDEB;
    font-size: 13px;
    color: #333;
}

.promocode-tag .type {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.promocode-tag .type.tier-up {
    background: #4CAF50;
}

.promocode-tag .type.fixed {
    background: #2196F3;
}

.promocode-tag .type.lowest {
    background: #FF9800;
}

.promocode-tag .type.percent {
    background: #E91E63;
}

.promocode-tag .type.fixed-discount {
    background: #9C27B0;
}

.promocode-tag .name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.promocode-tag .category {
    color: #888;
    font-size: 12px;
}

.promocode-tag .remove {
    width: 24px;
    height: 24px;
    border: none;
    background: #FFE0E0;
    color: #D32F2F;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
}

.promocode-tag .remove:hover {
    background: #D32F2F;
    color: white;
}

.promocode-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E0DDEB;
}

.info-title {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-bottom: 10px;
}

.info-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.promo-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 700;
    color: white;
}

.promo-type.tier-up {
    background: #4CAF50;
}

.promo-type.fixed {
    background: #2196F3;
}

.promo-type.lowest {
    background: #FF9800;
}

.promo-type.percent {
    background: #E91E63;
}

.promo-type.fixed-discount {
    background: #9C27B0;
}

/* =============================================
   Корзина
   ============================================= */

.cart-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0; /* Позволяет секции сжиматься в grid */
    width: 100%; /* Фиксированная ширина для стабильности */
    overflow: visible;
}

.cart-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    width: 100%; /* Фиксированная ширина для стабильности */
    box-sizing: border-box; /* Учитываем padding в ширине */
}

.cart-items {
    flex: 1;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-top: 4px; /* Место для поднятия карточек при hover */
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #CCB2FA transparent;
}

/* Скроллбар в правом padding cart-card — карточки на всю ширину контента */
.cart-items:not(.is-empty) {
    margin-right: calc(-1 * var(--cart-card-padding, 30px));
    width: calc(100% + var(--cart-card-padding, 30px));
    padding-right: var(--cart-card-padding, 30px);
}

.cart-items.is-empty {
    overflow: hidden;
}

.cart-items::-webkit-scrollbar {
    width: 10px;
}

.cart-items::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #CCB2FA;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: var(--preview-accent);
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
    padding: 40px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
    line-height: 1;
}

.empty-cart p {
    font-size: 14px;
}

/* Элемент корзины */
.cart-item {
    background: #F8F6FF;
    border-radius: 15px;
    padding: 18px;
    margin-bottom: 12px;
    border: 2px solid #E0DDEB;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
    width: 100%; /* Фиксированная ширина для стабильности */
    min-width: 0; /* Позволяет контенту сжиматься */
    box-sizing: border-box; /* Учитываем padding и border в ширине */
}

.cart-item-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    max-height: 120px;
    overflow: hidden;
    border-radius: 10px;
    background: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background: #FAFAFA;
}

.cart-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* Позволяет контенту сжиматься */
    width: 100%; /* Фиксированная ширина для стабильности */
    overflow: visible;
}

.cart-item:hover {
    border-color: var(--preview-accent);
    background: #F0EBFF;
    transform: translateY(-2px);
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
    width: 100%; /* Фиксированная ширина для стабильности */
    min-width: 0; /* Позволяет контенту сжиматься */
    box-sizing: border-box; /* Учитываем padding в ширине */
}

.cart-item-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    flex: 1; /* Занимает доступное пространство */
    min-width: 0; /* Позволяет тексту обрезаться при необходимости */
    overflow: hidden; /* Скрываем переполнение */
    text-overflow: ellipsis; /* Добавляем многоточие при переполнении */
    white-space: nowrap; /* Запрещаем перенос строк */
}

.cart-item-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0; /* Не позволяет сжиматься */
    margin-left: auto; /* Прижимаем к правому краю */
}

.cart-item-edit {
    width: 28px;
    height: 28px;
    border: none;
    background: #FFF4E6;
    color: #F57C00;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.cart-item-edit:hover {
    background: #F57C00;
    color: white;
    transform: scale(1.05);
}

.cart-item-duplicate {
    width: 28px;
    height: 28px;
    border: none;
    background: #E8F0FF;
    color: #1976D2;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.cart-item-duplicate:hover {
    background: #1976D2;
    color: white;
    transform: scale(1.05);
}

.cart-item-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: #FFE0E0;
    color: #D32F2F;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.cart-item-remove:hover {
    background: #D32F2F;
    color: white;
}

/* Анимация загрузки при изменении количества товара */
.cart-item.updating-quantity {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cart-item.updating-quantity::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    border-radius: 15px;
}

.cart-item.updating-quantity::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 11;
}

/* Анимация загрузки при удалении товара */
.cart-item.removing-item {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.95);
}

.cart-item.removing-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 53, 69, 0.1);
    z-index: 10;
    border-radius: 15px;
}

.cart-item.removing-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc3545;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cart-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    width: 100%; /* Фиксированная ширина для стабильности */
    min-width: 0; /* Позволяет контенту сжиматься */
    box-sizing: border-box; /* Учитываем padding в ширине */
}

.cart-item-tag {
    display: inline-flex;
    padding: 4px 10px;
    background: #E8E4F0;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
}

.cart-item-tag.promo {
    background: #E8F5E9;
    color: #2E7D32;
}

.cart-item-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.cart-item-extra {
    display: inline-flex;
    padding: 3px 8px;
    background: #FFF8E1;
    border-radius: 6px;
    font-size: 11px;
    color: #F57C00;
}

/* Фурнитура в карточке товара */
.cart-item-furniture {
    margin: 8px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-item-furniture:hover {
    border-color: var(--primary-color, #4A90A4);
    box-shadow: 0 2px 8px rgba(74, 144, 164, 0.15);
}

.cart-furniture-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-size: 12px;
    font-weight: 500;
    color: #495057;
}

.cart-furniture-toggle i:first-child {
    color: var(--primary-color, #4A90A4);
    font-size: 12px;
}

.cart-furniture-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.cart-furniture-arrow.expanded {
    transform: rotate(180deg);
}

.cart-furniture-details {
    padding: 10px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.cart-furniture-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 6px;
}

.cart-furniture-item:last-child {
    margin-bottom: 0;
}

.cart-furniture-img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.cart-furniture-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    color: #6c757d;
    font-size: 16px;
}

.cart-furniture-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.cart-furniture-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-furniture-price {
    font-size: 11px;
    color: var(--primary-color, #4A90A4);
    font-weight: 600;
}

.cart-furniture-no-ring {
    opacity: 0.7;
}

.cart-furniture-no-ring .cart-furniture-name {
    color: #6c757d;
    font-style: italic;
}

.cart-item-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-top: 8px;
    margin-top: auto;
    border-top: 1px dashed #E0DDEB;
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-wrap: nowrap;
}

/* Левая часть футера может сжиматься, итоговая цена остаётся у правого края */
.cart-item-footer > .cart-item-quantity-controls,
.cart-item-footer > .cart-item-qty {
    flex: 0 1 auto;
    min-width: 0;
}

.cart-item-footer > .cart-item-qty {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Итоговая цена прижата к правому краю и растёт влево */
.cart-item-footer > .cart-item-price {
    flex: 0 0 auto;
    margin-left: auto;
    text-align: right;
}

.cart-item-qty {
    font-size: 13px;
    color: #888;
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    text-align: left;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--preview-accent);
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    text-align: right;
}

.cart-item-unit-price {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}

/* Компактная карточка корзины (mobile, вариант A) */
.cart-item-mobile-summary {
    display: none;
}

.cart-item-desktop-only {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.cart-item-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    padding-right: 34px;
    min-height: 28px;
}

.cart-item-remove--mobile {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.cart-item-mobile-subtitle {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    line-height: 1.35;
}

.cart-item-price--mobile {
    margin-top: 10px;
    padding-right: 0;
    margin-right: 0;
    margin-left: auto;
    width: fit-content;
    max-width: 100%;
    font-size: 16px;
    font-weight: 600;
    color: var(--preview-accent);
    text-align: right;
    line-height: 1.2;
    white-space: nowrap;
    box-sizing: border-box;
}

.cart-item-mobile-meta {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #888;
}

.cart-item-mobile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.cart-item-mobile-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 6px;
    background: #EDE9F5;
    color: #665;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.cart-item-mobile-badge--promo {
    background: #E8F5E9;
    color: #2E7D32;
}

.cart-item-mobile-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: nowrap;
    min-height: 30px;
}

.cart-item-expand-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    box-sizing: border-box;
    border: 1px solid #E0DDEB;
    background: #fff;
    color: #666;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-item-expand-btn .cart-item-expand-icon {
    font-size: 11px;
    line-height: 1;
}

.cart-item-expand-btn:hover {
    border-color: var(--preview-accent);
    color: var(--preview-accent);
}

.cart-item-actions--mobile {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 0;
}

.cart-item-mobile-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #E0DDEB;
}

.cart-item.is-details-expanded .cart-item-mobile-details {
    display: block;
}

.cart-item-mobile-unit {
    margin: 8px 0 0;
    font-size: 12px;
    color: #888;
}

.cart-item-image--placeholder {
    display: none;
    align-items: center;
    justify-content: center;
    background: #F3F0FA;
    color: #B8B0CC;
    font-size: 22px;
}

/* Группированные элементы */
.cart-item.grouped {
    border-left: 4px solid var(--preview-accent);
}

.cart-item-group-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 10px;
    font-size: 12px;
    color: #2E7D32;
}

.cart-item-group-info .group-icon {
    font-size: 14px;
}

.cart-item-group-info .group-text {
    font-weight: 500;
}

.cart-item-promo-tier-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border-radius: 10px;
    font-size: 12px;
    color: #E65100;
}

.cart-item-promo-tier-info .promo-tier-icon {
    font-size: 14px;
}

.cart-item-promo-tier-info .promo-tier-text {
    font-weight: 500;
}

/* Итоги */
.cart-summary {
    background: linear-gradient(135deg, #F8F6FF 0%, #EDE8FF 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    position: sticky;
    width: 100%; /* Фиксированная ширина для стабильности */
    box-sizing: border-box; /* Учитываем padding в ширине */
    top: 20px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
    width: 100%; /* Фиксированная ширина для стабильности */
    box-sizing: border-box; /* Учитываем padding в ширине */
}

.summary-row > span:first-child {
    flex: 1; /* Занимает доступное пространство */
    min-width: 0; /* Позволяет тексту обрезаться при необходимости */
    text-align: left; /* Выравнивание текста слева */
}

.summary-row > span:last-child {
    flex-shrink: 0; /* Не позволяет сжиматься */
    min-width: 100px; /* Фиксированная минимальная ширина для цен */
    text-align: right; /* Выравнивание цен справа */
    white-space: nowrap; /* Запрещаем перенос строк */
}

.summary-row.discount {
    color: #4CAF50;
}

.summary-row.total {
    border-top: 2px solid #CCB2FA;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 22px;
    font-weight: 700;
    color: var(--preview-accent);
}

/* Кнопки действий */
.cart-actions {
    display: flex;
    gap: 12px;
}

.btn-clear,
.btn-export,
.btn-promocode,
.btn-create-order {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-promocode {
    background: var(--preview-accent);
    color: white;
}

.btn-promocode:hover {
    transform: translateY(-2px);
}

.btn-promocode.active {
    background: #FFB74D;
    color: #E65100;
    transform: translateY(1px);
    font-weight: 700;
}

.btn-clear {
    background: #FFE0E0;
    color: #D32F2F;
}

.btn-clear:hover {
    background: #D32F2F;
    color: white;
}

/* Кнопка очистки формы в заголовке */
.btn-clear-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #FFE0E0;
    color: #D32F2F;
    border: none;
    border-radius: 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-clear-form:hover {
    background: #D32F2F;
    color: white;
    transform: translateY(-2px);
}

.btn-clear-form:active {
    transform: translateY(1px);
}

.btn-clear-form i {
    font-size: 14px;
}

.btn-clear-form span {
    font-size: 14px;
}

.btn-export {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
}

.btn-export:hover {
    transform: translateY(-2px);
}

.btn-create-order {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
    border: 2px solid #FFE343;
    font-weight: 600;
}

.btn-create-order:hover {
    background: linear-gradient(135deg, #FFD600 0%, #FFC700 100%);
    border-color: #FFD600;
    transform: translateY(-2px);
}

/* =============================================
   Модальное окно
   ============================================= */

/* Корень для модалок — в конце body, фиксированный слой поверх всего */
#modal-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483647;
    pointer-events: none;
    isolation: isolate;
}

#modal-root .modal {
    pointer-events: auto;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2147483647;
    align-items: flex-start;
    justify-content: center;
    backdrop-filter: blur(5px);
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 25px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
    color: #333;
    margin: 2rem auto 2rem;
    flex-shrink: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #E0DDEB;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #F0F0F0;
    color: #666;
    border-radius: 10px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.modal-close:hover {
    background: var(--preview-accent);
    color: white;
}

.modal-body {
    padding: 25px 30px;
    flex: 1;
    overflow-y: auto;
}

.modal-body textarea {
    width: 100%;
    height: 300px;
    border: 2px solid #E0DDEB;
    border-radius: 15px;
    padding: 15px;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    resize: none;
    background: #FAFAFA;
    color: #333;
    line-height: 1.6;
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--preview-accent);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #E0DDEB;
    display: flex;
    justify-content: flex-end;
}

.modal-footer .btn-add,
.modal-footer .btn-clear {
    padding: 12px 24px;
    min-width: 120px;
    flex: 1;
    max-width: 200px;
}

#clear-cart-confirm-modal .modal-content {
    max-width: 400px;
}

#clear-form-confirm-modal .modal-content {
    max-width: 500px;
}

.clear-form-modal-footer,
.clear-cart-modal-footer {
    gap: 10px;
    padding: 20px 0 !important;
    margin: 0 30px;
}

.clear-form-modal-footer .btn-cancel,
.clear-form-modal-footer .btn-danger,
.clear-cart-modal-footer .btn-cancel,
.clear-cart-modal-footer .btn-danger {
    flex: 1;
    min-width: 0;
    margin: 0;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Unbounded", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.clear-form-modal-footer .btn-cancel,
.clear-cart-modal-footer .btn-cancel {
    background: transparent;
    border: 2px solid #888;
    color: #888;
}

.clear-form-modal-footer .btn-cancel:hover,
.clear-cart-modal-footer .btn-cancel:hover {
    background: #f8f9fa;
    border-color: #666;
    color: #666;
    transform: translateY(-2px);
}

.clear-form-modal-footer .btn-cancel:active,
.clear-cart-modal-footer .btn-cancel:active {
    transform: translateY(0);
}

.clear-form-modal-footer .btn-danger,
.clear-cart-modal-footer .btn-danger {
    background: #d32f2f;
    color: white;
    border: none;
}

.clear-form-modal-footer .btn-danger:hover,
.clear-cart-modal-footer .btn-danger:hover {
    background: #b71c1c;
    transform: translateY(-2px);
}

.clear-form-modal-footer .btn-danger:active,
.clear-cart-modal-footer .btn-danger:active {
    transform: translateY(0);
}

.btn-copy {
    padding: 14px 30px;
    background: var(--preview-accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: var(--preview-accent-hover);
}

.btn-copy.copied {
    background: #4CAF50;
}

/* =============================================
   Футер
   ============================================= */

/* =============================================
   Навигация
   ============================================= */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    margin-top: 20px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    /* Glassmorphism Effect */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 2px solid rgba(255, 255, 255, 1);
    border-radius: 50px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 30px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-link i {
    font-size: 16px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Иконка аккаунта - круглая */
.nav-actions .nav-link {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

html:not(.preview-chrome-page) .nav-actions .nav-link span {
    display: none;
}

.nav-actions .nav-link i {
    margin: 0;
    font-size: 18px;
}

/* Аватар в навигации */
.nav-actions .nav-link img {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

.nav-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 18px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-cart:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #FF4444;
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-sizing: border-box;
    line-height: 18px;
    text-align: center;
}

/* Footer */
.footer {
    margin-top: 40px;
    position: relative;
    z-index: 1;
    /* Glass Effect - светлое стекло с blur */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 2px solid rgba(255, 255, 255, 1);
    border-radius: 30px;
    padding: 28px 32px;
    color: white;
    box-shadow: 
        0 -4px 30px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    gap: 8px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-copyright {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    /* Навигация для мобильных */
    /* Навигация - используем единые стили из common.css */
    
    /* Footer для мобильных */
    .footer {
        padding: 20px 16px;
        margin-top: 32px;
        border-radius: 20px;
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .footer-content {
        gap: 20px;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }
    
    .footer-links {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-links a {
        padding: 8px 12px;
        font-size: 14px;
        white-space: nowrap;
        word-wrap: normal;
        overflow-wrap: normal;
    }
    
    .footer-social {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
        font-size: 18px;
        flex-shrink: 0;
    }
    
    .footer-copyright {
        font-size: 11px;
        padding-top: 16px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    /* Навигация - используем единые стили из common.css */
    
    .footer {
        padding: 16px 12px;
        border-radius: 16px;
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-links a {
        padding: 6px 10px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .footer-social {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .social-link {
        width: 36px;
        height: 36px;
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .footer-copyright {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
}

/* =============================================
   Уведомления
   ============================================= */

/* =============================================
   Единая система уведомлений
   ============================================= */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 2147483647;
    pointer-events: none; /* не блокирует клики, для работы внутри #modal-root */
    animation: slideInNotification 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: fit-content;
    max-width: 400px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

/* Успешные операции */
.notification.success {
    background: #4CAF50;
}

/* Ошибки */
.notification.error {
    background: #F44336;
}

/* Предупреждения */
.notification.warning {
    background: #FFC107;
    color: #333;
}

@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Уведомления на мобильных — по правому краю, крупный читаемый текст */
@media (max-width: 768px) {
    .notification {
        top: max(12px, env(safe-area-inset-top, 0px));
        left: auto;
        right: max(12px, env(safe-area-inset-right, 0px));
        transform: none;
        width: auto;
        max-width: calc(100vw - 24px);
        min-width: 0;
        padding: 16px 18px;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.45;
        text-align: left;
        box-sizing: border-box;
        border-radius: 14px;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
        pointer-events: auto;
        -webkit-user-select: text;
        user-select: text;
        cursor: default;
    }

    @keyframes slideInNotification {
        from {
            opacity: 0;
            transform: translateX(100px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

@media (max-width: 480px) {
    .notification {
        padding: 15px 16px;
        font-size: 15px;
    }
}

/* =============================================
   Выбор типа заказа (индивидуальный/коллект)
   ============================================= */

.order-type-selector {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.order-type-selector .form-group {
    margin-bottom: 1rem;
}

.order-type-selector .form-group:last-child {
    margin-bottom: 0;
}

.order-type-selector label {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
}

.order-type-selector .radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.order-type-selector .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-type-selector .form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--preview-accent);
}

.order-type-selector .form-check-label {
    color: #333;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.order-type-selector .form-check-input:checked + .form-check-label {
    color: var(--preview-accent);
    font-weight: 600;
}

.order-type-selector select.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-type-selector select.form-control:focus {
    outline: none;
    border-color: var(--preview-accent);
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

.order-type-selector select.form-control:invalid {
    border-color: #dc3545;
}

/* =============================================
   Адаптивность
   ============================================= */

/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cart-items {
        max-height: 400px;
    }
    
    .option-button {
        min-width: 110px;
        padding: 13px 17px;
        font-size: 12px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    .form-card,
    .cart-card {
        padding: 25px;
        --cart-card-padding: 25px;
        border-radius: 25px;
    }
    
    .form-cat {
        display: none; /* Скрываем котика, когда он выезжает за границы экрана */
    }
    
    .title-cloud {
        display: none; /* Скрываем облака на планшетах */
    }
}

/* Планшеты в портретной ориентации (до 1200px) */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .cart-items {
        max-height: 350px;
    }
    
    .option-button {
        min-width: 100px;
        padding: 12px 16px;
        font-size: 11px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    .form-cat {
        display: none; /* Скрываем котика на планшетах */
    }
    
    .title-cloud {
        display: none; /* Скрываем облака на планшетах */
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 12px !important;
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-content {
        min-width: 0;
        overflow-x: visible;
    }

    .form-section,
    .cart-section {
        min-width: 0;
        overflow-x: visible;
    }

    .form-card {
        min-width: 0;
        overflow-x: hidden;
    }

    #furniture-group {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .product-form {
        min-width: 0;
    }

    #layers-container {
        min-width: 0;
        overflow-x: visible;
    }

    .option-grid {
        min-width: 0;
    }

    .form-buttons-container {
        scroll-margin-bottom: 2rem;
    }

    main.main-content {
        padding-bottom: 2rem;
    }
    
    .header {
        padding: 15px 0 25px;
    }
    
    .logo {
        position: static;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .title-with-clouds {
        gap: 20px;
    }
    
    .title-cloud {
        display: none; /* Скрываем облака на мобильных устройствах */
    }
    
    .main-title {
        font-size: 42px;
        letter-spacing: 1px;
    }
    
    .back-link {
        font-size: 0; /* Скрываем текст */
        padding: 12px; /* Уменьшаем padding для круглой кнопки */
        width: 44px; /* Фиксированная ширина для круглой кнопки */
        height: 44px; /* Фиксированная высота для круглой кнопки */
        border-radius: 50%; /* Делаем кнопку круглой */
        justify-content: center;
        align-items: center;
    }
    
    .back-link::before {
        content: '←';
        font-size: 24px; /* Размер стрелки */
        color: white;
        line-height: 1;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .form-card,
    .cart-card {
        padding: 18px;
        --cart-card-padding: 18px;
        border-radius: 20px;
    }
    
    .form-cat {
        display: none; /* Скрываем котика на мобильных устройствах */
    }
    
    /* Модальное окно на мобильных */
    .modal {
        padding: 15px;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 20px;
        margin: 1rem auto 1rem;
    }
    
    .modal-header {
        padding: 18px 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .modal-body {
        padding: 18px 20px;
    }
    
    .modal-body textarea {
        height: 300px;
        font-size: 14px;
    }
    
    .modal-footer {
        padding: 18px 20px;
    }
    
    .modal-footer button {
        width: 100%;
        padding: 14px;
        min-height: 44px;
    }
    
    .section-title {
        font-size: 18px;
    }

    .form-title-actions {
        gap: 6px;
    }

    .btn-my-products span,
    .btn-clear-form span {
        display: none;
    }

    .btn-my-products,
    .btn-clear-form {
        padding: 10px 12px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .title-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .promocode-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .promocode-input-group input {
        width: 100%;
    }
    
    .promocode-input-group button {
        width: 100%;
        padding: 14px;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .cart-actions button {
        width: 100%;
        padding: 14px;
    }
    
    .option-grid {
        gap: 10px;
    }
    
    .option-button {
        padding: 12px 14px;
        font-size: 11px;
        min-width: 90px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.3;
        min-height: 44px; /* Минимальный размер для тач-интерфейса */
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea,
    .layer-group textarea {
        padding: 14px 16px;
        font-size: 16px; /* Предотвращает зум на iOS */
        min-height: 44px;
    }
    
    .form-group textarea,
    .layer-group textarea {
        min-height: 80px;
    }
    
    .quantity-input-wrapper {
        gap: 10px;
    }
    
    .quantity-input-container {
        width: 100%;
    }
    
    .quantity-input-wrapper input {
        width: 100%;
        min-width: 100%;
        padding: 14px 40px 14px 16px; /* Место для стрелок справа */
        font-size: 16px;
        min-height: 44px;
    }
    
    .quantity-spinner {
        right: 6px;
    }
    
    .quantity-spinner-btn {
        width: 20px;
        height: 16px;
    }
    
    .quantity-quick-buttons {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    
    .quantity-quick-btn {
        flex: 1;
        min-height: 44px;
        padding: 12px;
        font-size: 14px;
    }
    
    .extras-position-container {
        min-width: 0;
        max-width: 100%;
    }

    .extras-position-container .extras-grid,
    .extras-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .extras-position-container .extras-grid.extras-lamination-grid.option-grid,
    .extras-grid.extras-lamination-grid.option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 6px;
    }
    
    .checkbox-label {
        padding: 12px;
        min-height: 44px;
    }
    
    .form-buttons-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-buttons-container.single-button .btn-add {
        width: 100%;
    }
    
    .form-buttons-container.has-cancel-button {
        flex-direction: column;
    }
    
    .form-buttons-container.has-cancel-button .btn-cancel-changes,
    .form-buttons-container.has-cancel-button .btn-add {
        width: 100%;
    }
    
    .btn-add {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        min-height: 50px;
    }
    
    .btn-cancel-changes {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        min-height: 50px;
    }
    
    .cart-summary {
        position: relative; /* Убираем sticky на мобильных */
        top: 0;
        margin-bottom: 15px;
    }
    
    .cart-item {
        padding: 12px;
        margin-bottom: 10px;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        align-items: flex-start;
        gap: 10px;
    }

    .cart-item-mobile-summary {
        display: block;
        width: 100%;
    }

    .cart-item-desktop-only {
        display: none !important;
    }

    .cart-item-mobile-details {
        display: none !important;
    }

    .cart-item.is-details-expanded .cart-item-mobile-details {
        display: block !important;
    }

    .cart-item-image {
        width: 88px;
        height: 88px;
        max-height: 88px;
        flex-shrink: 0;
    }

    .cart-item-image--placeholder {
        display: flex;
    }

    .cart-item-content {
        overflow: visible;
        flex: 1;
        min-width: 0;
        gap: 0;
    }

    .cart-item-mobile-head .cart-item-title {
        font-size: 14px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        padding-right: 0;
    }

    .cart-item-mobile-toolbar .cart-item-quantity-controls {
        flex-shrink: 0;
        height: 30px;
    }

    .cart-item-mobile-toolbar .cart-item-quantity-controls .qty-btn {
        width: 24px;
        height: 30px;
        min-height: 30px;
        font-size: 14px;
        border-width: 1px;
        box-sizing: border-box;
    }

    .cart-item-mobile-toolbar .cart-item-quantity-controls .qty-input {
        width: 32px;
        height: 30px;
        min-height: 30px;
        font-size: 13px;
        padding: 0 2px;
        border-width: 1px;
        box-sizing: border-box;
    }

    .cart-item-mobile-toolbar .cart-item-quantity-controls .qty-btn.qty-up {
        border-right-width: 1px;
    }

    .cart-item-mobile-toolbar .cart-item-expand-btn,
    .cart-item-mobile-toolbar .cart-item-edit,
    .cart-item-mobile-toolbar .cart-item-duplicate {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        box-sizing: border-box;
        font-size: 13px;
        padding: 0;
    }

    .cart-item-mobile-toolbar .cart-item-edit i,
    .cart-item-mobile-toolbar .cart-item-duplicate i {
        font-size: 13px;
    }

    .cart-item-price--mobile {
        margin-top: 10px;
        padding-right: 0;
        margin-right: 0;
        margin-left: auto;
    }
    
    .cart-item-group-info {
        font-size: 11px;
        padding: 8px 10px;
        margin-top: 8px;
    }
    
    .cart-item-promo-tier-info {
        font-size: 11px;
        padding: 8px 10px;
        margin-top: 8px;
    }
}

/* Маленькие мобильные устройства (до 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px !important;
    }

    .extras-position-container {
        min-width: 0;
        max-width: 100%;
    }

    .extras-position-container .extras-grid,
    .extras-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .header {
        padding: 12px 0 20px;
    }
    
    .title-with-clouds {
        gap: 15px;
    }
    
    .title-cloud {
        display: none; /* Скрываем облака на маленьких экранах */
    }
    
    .main-title {
        font-size: 32px;
        letter-spacing: 0.5px;
    }
    
    .subtitle {
        font-size: 13px;
    }
    
    .back-link {
        font-size: 0; /* Скрываем текст */
        padding: 10px; /* Уменьшаем padding для круглой кнопки */
        width: 40px; /* Фиксированная ширина для круглой кнопки */
        height: 40px; /* Фиксированная высота для круглой кнопки */
        border-radius: 50%; /* Делаем кнопку круглой */
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }
    
    .back-link::before {
        content: '←';
        font-size: 20px; /* Размер стрелки */
        color: white;
        line-height: 1;
    }
    
    .form-card,
    .cart-card {
        padding: 15px;
        --cart-card-padding: 15px;
        border-radius: 15px;
    }
    
    .form-cat {
        display: none; /* Скрываем котика на маленьких экранах */
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .title-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .form-group select,
    .form-group input,
    .form-group textarea,
    .layer-group textarea {
        padding: 12px 14px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .form-group textarea,
    .layer-group textarea {
        min-height: 80px;
    }
    
    .option-grid {
        gap: 8px;
    }
    
    .option-button {
        padding: 12px 14px;
        font-size: 13px;
        min-width: 90px;
        min-height: 44px;
        flex: 1 1 calc(50% - 4px); /* Две кнопки в ряд */
    }
    
    .quantity-input-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .quantity-input-container {
        width: 100%;
    }
    
    .quantity-input-wrapper input {
        width: 100%;
        padding: 14px 40px 14px 14px; /* Место для стрелок справа */
        font-size: 16px;
        min-height: 44px;
    }
    
    .quantity-spinner {
        right: 6px;
    }
    
    .quantity-spinner-btn {
        width: 20px;
        height: 16px;
    }
    
    .quantity-quick-buttons {
        width: 100%;
        gap: 6px;
    }
    
    .quantity-quick-btn {
        flex: 1;
        min-height: 44px;
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .extras-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .checkbox-label {
        padding: 10px;
        min-height: 44px;
    }
    
    .checkbox-title {
        font-size: 13px;
    }
    
    .checkbox-price {
        font-size: 12px;
    }
    
    .btn-add {
        padding: 15px 20px;
        font-size: 15px;
        min-height: 50px;
    }
    
    .cart-item {
        padding: 10px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
        max-height: 80px;
    }
    
    .cart-item-tags {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .cart-item-tag {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .cart-item-group-info {
        font-size: 10px;
        padding: 6px 8px;
        margin-top: 6px;
    }
    
    .cart-item-promo-tier-info {
        font-size: 10px;
        padding: 6px 8px;
        margin-top: 6px;
    }
    
    .cart-summary {
        padding: 15px;
    }
    
    .option-grid {
        gap: 8px;
    }
    
    .option-button {
        padding: 12px 14px;
        font-size: 13px;
        min-width: 90px;
        min-height: 44px;
        flex: 1 1 calc(50% - 4px); /* Две кнопки в ряд */
    }
    
    .quantity-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quantity-input-container {
        width: 100%;
    }
    
    .quantity-input-wrapper input {
        width: 100%;
        padding: 14px 40px 14px 14px; /* Место для стрелок справа */
        font-size: 16px;
        min-height: 44px;
    }
    
    .quantity-spinner {
        right: 6px;
    }
    
    .quantity-spinner-btn {
        width: 20px;
        height: 16px;
    }
    
    .quantity-quick-buttons {
        gap: 6px;
        width: 100%;
        justify-content: space-between;
    }
    
    .quantity-quick-btn {
        padding: 12px 8px;
        font-size: 13px;
        min-height: 44px;
        flex: 1;
    }
    
    .extras-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .checkbox-label {
        padding: 10px;
        min-height: 44px;
    }
    
    .checkbox-icon {
        font-size: 20px;
    }
    
    .checkbox-title {
        font-size: 13px;
    }
    
    .checkbox-price {
        font-size: 12px;
    }
    
    .promocode-tag {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .custom-size-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .custom-size-input-wrapper input {
        width: 100%;
    }
    
    .custom-size-input-wrapper button {
        width: 100%;
    }
    
    /* Модальное окно на маленьких экранах */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        min-width: 44px; /* Для тач-интерфейса */
        min-height: 44px;
    }
    
    .modal-body {
        padding: 15px 20px;
    }
    
    .modal-body textarea {
        height: 250px;
        padding: 12px;
        font-size: 14px;
    }
    
    .modal-footer {
        padding: 15px 20px;
    }
    
    .modal-footer button {
        width: 100%;
        padding: 14px;
        min-height: 44px;
    }
}

/* Дополнительные улучшения для тач-интерфейса */
@media (hover: none) and (pointer: coarse) {
    /* Стили только для устройств с тач-интерфейсом */
    .option-button:hover,
    .quantity-quick-btn:hover,
    .quantity-spinner-btn:hover,
    .btn-add:hover {
        transform: none; /* Убираем hover-эффекты на тач-устройствах */
    }
    
    .option-button:active,
    .quantity-quick-btn:active,
    .quantity-spinner-btn:active,
    .btn-add:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .cart-item:hover {
        transform: none;
    }
    
    .cart-item:active {
        transform: scale(0.99);
    }
}

/* Улучшения для ландшафтной ориентации на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 10px 0 15px;
    }
    
    .title-with-clouds {
        gap: 10px;
    }
    
    .title-cloud {
        width: 60px; /* Увеличено на 20% (было 50px) */
        height: 60px; /* Увеличено на 20% (было 50px) */
    }
    
    .main-title {
        font-size: 36px;
    }
    
    .cart-items {
        max-height: 200px;
    }
    
    .form-card,
    .cart-card {
        padding: 15px;
        --cart-card-padding: 15px;
    }
}

/* Улучшения для очень маленьких экранов */
@media (max-width: 360px) {
    .title-with-clouds {
        gap: 8px;
    }
    
    .title-cloud {
        width: 48px; /* Увеличено на 20% (было 40px) */
        height: 48px; /* Увеличено на 20% (было 40px) */
    }
    
    .main-title {
        font-size: 28px;
    }
    
    .option-button {
        min-width: 80px;
        padding: 10px 12px;
        font-size: 12px;
        flex: 1 1 calc(50% - 4px);
    }
    
    .form-card,
    .cart-card {
        padding: 12px;
        --cart-card-padding: 12px;
    }
    
    .section-title {
        font-size: 15px;
    }
}

/* =============================================
   Анимации
   ============================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: slideUp 0.3s ease;
}

/* =============================================
   Состояния
   ============================================= */

.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--preview-accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================
   Загрузка файлов
   ============================================= */

.file-upload-group {
    margin-top: 20px;
}

.file-upload-hint-text {
    font-size: 12px;
    font-weight: normal;
    margin-left: 8px;
}

.sunset-template-download-link {
    display: inline-block;
    margin: 0 4px 4px 0;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(114, 49, 255, 0.28);
    background: rgba(114, 49, 255, 0.08);
    color: #5521c4;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    line-height: 1.25;
    max-width: 100%;
    white-space: normal;
    hyphens: none;
}

.sunset-template-download-link:hover,
.sunset-template-download-link:focus-visible {
    background: rgba(114, 49, 255, 0.16);
    border-color: rgba(114, 49, 255, 0.45);
    color: #3c1690;
}

/* Обёртка для загрузки с превью (как в генераторе чеклистов) */
.image-upload-wrapper {
    display: flex;
    gap: 15px;
    align-items: stretch;
    transition: all 0.3s ease;
    max-height: 400px;
}

.image-upload-wrapper.has-preview .file-upload-area {
    flex: 0 0 50%;
    min-height: auto;
    padding: 20px;
}

.image-upload-wrapper.no-preview .file-upload-area {
    flex: 1;
}

.image-preview-container {
    flex: 0 0 48%;
    display: none;
    position: relative;
    min-height: 250px;
    align-items: center;
    justify-content: center;
}

.image-upload-wrapper.has-preview .image-preview-container {
    display: flex;
}

.preview-img {
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    border: none;
    z-index: 10;
}

.remove-image:hover {
    background: #c82333;
    transform: scale(1.1);
}

.file-upload-area {
    border: 2px dashed #E0DDEB;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FAFAFA;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.file-upload-area:hover {
    border-color: var(--preview-accent);
    background: #F8F6FF;
    transform: translateY(-2px);
}

.file-upload-area.dragover {
    border-color: #FFE343;
    background: #FFFEF0;
}

.file-upload-area.has-file {
    border-color: #28a745;
    background: #F0FFF4;
}

.file-upload-area.loading {
    pointer-events: none;
    opacity: 0.7;
}

.file-upload-area.uploading {
    pointer-events: none;
}

.file-upload-area.uploading .file-upload-content {
    opacity: 0.5;
}

/* Прогресс-бар загрузки */
.upload-progress {
    width: 100%;
    margin-top: 15px;
    padding: 0 10px;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: #E0DDEB;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--preview-accent) 0%, #FFE343 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.upload-progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--preview-accent);
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.file-upload-content i {
    font-size: 48px;
    color: var(--preview-accent);
    margin-bottom: 10px;
}

.file-upload-text {
    font-size: 14px;
    color: #333;
    margin: 0;
}

.file-upload-link {
    color: var(--preview-accent);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.file-upload-hint {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.file-info {
    display: none !important;
}

.file-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-info-content i {
    color: #28a745;
    font-size: 20px;
}

.file-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

.file-remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove-btn:hover {
    background: #FFEBEE;
    transform: scale(1.1);
}

.duplicate-check-result {
    /* Скрыт по умолчанию - не показываем результаты проверки дубликатов под формой */
    display: none !important;
}

.duplicate-check-result p {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.duplicate-check-result .btn {
    margin-top: 10px;
    margin-right: 10px;
}

/* =============================================
   Модальное окно данных клиента
   ============================================= */

.modal-large {
    max-width: 1400px;
    width: 95%;
}

.modal-large .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-large .form-group {
    margin-bottom: 20px;
}

.modal-large .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.modal-large .form-group .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0DDEB;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: "Unbounded", sans-serif;
}

.modal-large .form-group .form-control:focus {
    outline: none;
    border-color: var(--preview-accent);
}

.modal-large .form-group textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.modal-large .radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.modal-large .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-large .form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--preview-accent);
}

.modal-large .form-check-label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

.modal-large .text-danger {
    color: #dc3545;
}

.modal-large .text-muted {
    color: #888;
    font-size: 12px;
}

.modal-large .social-accounts-field {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #E0DDEB;
}

.modal-large .modal-footer {
    display: flex;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #E0DDEB;
    justify-content: flex-end;
}

.modal-large .modal-footer .btn-add,
.modal-large .modal-footer .btn-clear {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.modal-large .modal-footer .btn-add {
    background: var(--preview-accent);
    color: white;
}

.modal-large .modal-footer .btn-add:hover {
    background: var(--preview-accent-hover);
    transform: translateY(-2px);
}

.modal-large .modal-footer .btn-clear {
    background: #F0F0F0;
    color: #666;
}

.modal-large .modal-footer .btn-clear:hover {
    background: #E0E0E0;
    transform: translateY(-2px);
}

/* =============================================
   Кнопки редактирования количества в корзине
   ============================================= */

.cart-item-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
}

.cart-item-quantity-controls .qty-btn {
    width: 32px;
    height: 36px;
    border: 2px solid #E0DDEB;
    background: white;
    border-radius: 0;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: var(--preview-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: "Unbounded", sans-serif;
    padding: 0;
    margin: 0;
    line-height: 1;
    border-right: none;
}

.cart-item-quantity-controls .qty-btn.qty-down {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.cart-item-quantity-controls .qty-btn.qty-up {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-left: none;
    border-right: 2px solid #E0DDEB;
}

.cart-item-quantity-controls .qty-btn:hover {
    background: var(--preview-accent);
    color: white;
    border-color: var(--preview-accent);
    z-index: 1;
    position: relative;
}

.cart-item-quantity-controls .qty-input {
    width: 50px;
    height: 36px;
    text-align: center;
    padding: 8px 4px;
    border: 2px solid #E0DDEB;
    border-radius: 0;
    border-left: none;
    border-right: none;
    font-size: 14px;
    font-weight: 700;
    background: white;
    -moz-appearance: textfield;
}

.cart-item-quantity-controls .qty-input::-webkit-outer-spin-button,
.cart-item-quantity-controls .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item-quantity-controls .qty-input:focus {
    outline: none;
    border-color: var(--preview-accent);
    z-index: 1;
    position: relative;
}

.cart-item-quantity-controls .qty-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

/* =============================================
   Модальное окно выбора фурнитуры
   ============================================= */

#furniture-modal .modal-content {
    max-width: 1300px;
    width: 95%;
    border-radius: 25px;
    min-height: 80vh;
    min-height: 80dvh;
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}

#furniture-modal .modal-body {
    padding: 0;
    overflow: hidden;
    border-radius: 0 0 25px 25px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.furniture-modal-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    max-height: 100%;
}

/* Сайдбар фурнитуры */
.furniture-sidebar {
    width: 280px;
    background: #F8F9FA;
    border-right: 2px solid #E0DDEB;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-radius: 0 0 0 25px;
    overflow-y: auto;
    min-height: 0;
}

.furniture-sidebar-header {
    padding: 20px;
    background: white;
    border-bottom: 2px solid #E0DDEB;
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

.furniture-sidebar-header h6 i,
#furniture-modal .modal-header h3 i {
    margin-right: 8px;
}

.furniture-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    min-height: 0;
}

.furniture-sidebar-section {
    margin-bottom: 5px;
}

.furniture-category-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    font-size: 14px;
    color: #333;
    border-left: 3px solid transparent;
    font-family: inherit;
}

.furniture-category-btn:hover {
    background: #F0F0F0;
}

.furniture-category-btn.active {
    background: #F0F0F0;
    border-left-color: var(--preview-accent);
    color: var(--preview-accent);
    font-weight: 600;
}

.furniture-category-btn .category-icon {
    margin-right: 10px;
    font-size: 18px;
}

.furniture-category-btn .category-name {
    flex: 1;
    font-weight: 500;
}

.furniture-category-btn .category-count {
    background: #E0DDEB;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.furniture-category-btn.active .category-count {
    background: var(--preview-accent);
    color: white;
}

/* Основной контент фурнитуры */
.furniture-main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
    min-height: 0;
    border-radius: 0 0 25px 0;
}

/* Стилизация scrollbar для модального окна фурнитуры */
.furniture-main-content {
    scrollbar-width: thin;
    scrollbar-color: #CCB2FA #F0EBFF;
}

.furniture-main-content::-webkit-scrollbar {
    width: 10px;
}

.furniture-main-content::-webkit-scrollbar-track {
    background: #F0EBFF;
    border-radius: 5px;
}

.furniture-main-content::-webkit-scrollbar-thumb {
    background: #CCB2FA;
    border-radius: 5px;
    border: 2px solid #F0EBFF;
}

.furniture-main-content::-webkit-scrollbar-thumb:hover {
    background: var(--preview-accent);
}

.furniture-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #CCB2FA #E0DDEB;
}

.furniture-sidebar::-webkit-scrollbar {
    width: 6px;
}

.furniture-sidebar::-webkit-scrollbar-track {
    background: #E0DDEB;
    border-radius: 3px;
}

.furniture-sidebar::-webkit-scrollbar-thumb {
    background: #CCB2FA;
    border-radius: 3px;
}

.furniture-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--preview-accent);
}

/* Поиск фурнитуры */
.furniture-search {
    margin-bottom: 20px;
}

.furniture-search .input-group {
    display: flex;
    align-items: stretch;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #E0DDEB;
    background: white;
    transition: all 0.3s ease;
}

.furniture-search .input-group:focus-within {
    border-color: var(--preview-accent);
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

.furniture-search .input-group-text {
    background: #F8F9FA;
    border: none;
    padding: 14px 18px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.furniture-search .input-group-text i {
    font-size: 16px;
}

.furniture-search .form-control {
    border: none;
    padding: 14px 18px;
    font-size: 14px;
    background: white;
    color: #333;
    font-family: inherit;
    flex: 1;
    min-width: 0;
}

.furniture-search .form-control:focus {
    outline: none;
    box-shadow: none;
    background: white;
}

.furniture-search .form-control::placeholder {
    color: #999;
    opacity: 1;
}

.furniture-search .btn-outline-secondary {
    border: none;
    background: #F8F9FA;
    color: #666;
    padding: 14px 18px;
    border-left: 1px solid #E0DDEB;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 16px;
}

.furniture-search .btn-outline-secondary:hover {
    background: #F0F0F0;
    color: #333;
}

.furniture-search .btn-outline-secondary:active {
    background: #E0DDEB;
}

/* Сетка фурнитуры - 5 колонок */
#furniture-items.furniture-items-grid,
.furniture-items-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-content: start;
    align-items: stretch;
}

@media (max-width: 1400px) {
    .furniture-items-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 1100px) {
    .furniture-items-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 800px) {
    .furniture-items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Карточки фурнитуры - увеличенные */
.furniture-item-card {
    border: 1px solid #E0DDEB;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: white;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    height: 100%;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.furniture-item-card:hover {
    border-color: var(--preview-accent);
    box-shadow: 0 4px 16px rgba(114, 49, 255, 0.18);
    transform: translateY(-3px);
}

.furniture-item-card:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 8px rgba(114, 49, 255, 0.2);
}

/* Карточка без остатков */
.furniture-item-card.out-of-stock-card {
    position: relative;
    opacity: 0.7;
    cursor: not-allowed;
}

.furniture-item-card.out-of-stock-card:hover {
    transform: none;
    border-color: #E0DDEB;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Overlay "Нет в наличии" */
.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 14px;
    pointer-events: none;
}

.out-of-stock-overlay span {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    font-weight: 700;
    font-size: 11px;
    padding: 8px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(204, 0, 0, 0.3);
    transform: rotate(-15deg);
}

/* Выбранная карточка */
.furniture-item-card.selected {
    border: 3px solid var(--preview-accent);
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.2), 0 4px 20px rgba(114, 49, 255, 0.3);
}

.furniture-item-card.selected:hover {
    border-color: var(--preview-accent);
}

/* Бейдж "Выбрано" */
.selected-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--preview-accent), #9B6DFF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(114, 49, 255, 0.4);
}

/* Верхняя часть - изображение */
.furniture-item-card .card-img-wrapper {
    width: 100%;
    height: 130px;
    background: #F8F9FA;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    position: relative;
    flex-shrink: 0;
}

.furniture-item-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
}

/* Placeholder для изображений */
.furniture-item-card .image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #F8F9FA 25%, #E0DDEB 50%, #F8F9FA 75%);
    background-size: 200% 100%;
    animation: image-loading 1.5s infinite;
    z-index: 1;
    transition: opacity 0.3s ease-in-out;
}

@keyframes image-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ленивая загрузка изображений */
.furniture-item-card .lazy-image {
    opacity: 0;
    position: relative;
    z-index: 2;
}

.furniture-item-card .lazy-image.loaded {
    opacity: 1;
}

/* Нижняя часть - информация */
.furniture-item-card .card-body {
    padding: 8px 12px 10px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.furniture-item-card .card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    margin-bottom: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.furniture-item-card .card-sku {
    font-size: 11px;
    color: #888;
    margin: 0;
    font-family: monospace;
}

/* Блок цены и остатков */
.furniture-item-card .card-footer-info {
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.furniture-item-card .card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--preview-accent);
}

.furniture-item-card .card-stock {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.furniture-item-card .card-stock.in-stock {
    background: #E8F5E9;
    color: #2E7D32;
}

.furniture-item-card .card-stock.out-of-stock {
    background: #F5F5F5;
    color: #757575;
}

/* Дерево категорий */
.category-tree-item {
    margin-bottom: 2px;
}

.category-tree-item.expanded > .furniture-category-btn {
    background: #F0EBFF;
}

.furniture-category-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    min-height: 42px;
}

.furniture-category-btn:hover {
    background: #F0EBFF;
}

.furniture-category-btn.active {
    background: var(--preview-accent);
    color: white;
}

.furniture-category-btn.active .category-icon,
.furniture-category-btn.active .category-count {
    color: white;
}

.furniture-category-btn .category-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 9px;
    color: #888;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.furniture-category-btn .category-toggle:hover {
    color: var(--preview-accent);
}

.furniture-category-btn .category-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.furniture-category-btn .category-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.furniture-category-btn .category-count {
    font-size: 11px;
    color: #888;
    background: #F0F0F0;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.furniture-category-btn.active .category-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

.category-children {
    margin-left: 22px;
    margin-top: 2px;
    border-left: 2px solid #E8E4F0;
}

.category-children .furniture-category-btn {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
    min-height: 38px;
}

.category-children .furniture-category-btn:hover {
    background: #F5F0FF;
    border-left: 2px solid var(--preview-accent);
    margin-left: -2px;
    padding-left: 12px;
}

.category-children .furniture-category-btn.active {
    background: var(--preview-accent);
    color: white;
    border-left: 2px solid var(--preview-accent);
    margin-left: -2px;
    padding-left: 12px;
}

/* Статус загрузки */
.furniture-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.furniture-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    border-color: var(--preview-accent);
    border-right-color: transparent;
}

/* Пустое состояние */
.furniture-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.furniture-empty i {
    font-size: 64px;
    color: #E0DDEB;
    margin-bottom: 20px;
    display: block;
}

.furniture-empty h6 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.furniture-empty p {
    font-size: 14px;
    color: #666;
}

/* Выбранная фурнитура в форме */
.selected-furniture-list {
    margin-top: 15px;
}

.selected-furniture-item {
    background: white;
    border: 2px solid #E0DDEB;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-furniture-item strong {
    color: #333;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.selected-furniture-item small {
    color: #666;
    font-size: 12px;
    display: block;
}

.selected-furniture-item .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
    border: none;
    background: #FF4444;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selected-furniture-item .btn-sm:hover {
    background: #CC0000;
    transform: scale(1.05);
}

/* Контейнер для двух полей: фурнитура + кольцо */
.furniture-ring-container {
    display: flex;
    gap: 15px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Общие стили для полей выбора фурнитуры и кольца */
.furniture-selector-field,
.ring-selector-field {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    border: 2px dashed #D0C9E0;
    border-radius: 12px;
    padding: 20px 15px;
    background: #FAFAFF;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.furniture-selector-field:hover,
.ring-selector-field:hover {
    border-color: var(--preview-accent);
    background: #F5F0FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(114, 49, 255, 0.15);
}

.furniture-selector-field.has-selection,
.ring-selector-field.has-selection {
    border-style: solid;
    border-color: var(--preview-accent);
    background: white;
}

/* Неактивное состояние полей фурнитуры */
.furniture-selector-field.disabled,
.ring-selector-field.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.furniture-selector-field.disabled:hover,
.ring-selector-field.disabled:hover {
    border-color: #D0C9E0;
    background: #FAFAFF;
    transform: none;
    box-shadow: none;
}

.furniture-selector-field.disabled .furniture-field-hint {
    color: #999;
    font-style: italic;
}

/* Содержимое поля */
.furniture-field-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.furniture-field-content i {
    font-size: 2rem;
    color: var(--preview-accent);
    opacity: 0.7;
    font-weight: 900;
    transition: opacity 0.3s ease;
}

.furniture-selector-field:hover .furniture-field-content i,
.ring-selector-field:hover .furniture-field-content i {
    opacity: 1;
}

.furniture-field-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    max-width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.furniture-field-hint {
    font-size: 12px;
    color: #888;
}

/* Изображение выбранной фурнитуры */
.furniture-field-content img {
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
    border-radius: 8px;
}

/* Разделитель "+" */
.furniture-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: rgba(114, 49, 255, 0.45);
    min-width: 30px;
}

/* Кнопка очистки */
.furniture-clear-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    z-index: 5;
}

.furniture-clear-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

/* Старая кнопка (оставляем для совместимости) */
.btn-furniture {
    width: 100%;
    padding: 14px 20px;
    background: white;
    color: var(--preview-accent);
    border: 2px solid var(--preview-accent);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-furniture:hover {
    background: var(--preview-accent);
    color: white;
    transform: translateY(-2px);
}

.btn-furniture:active {
    transform: translateY(0);
}

#furniture-modal .modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

#furniture-modal .modal-header h3 {
    margin: 0;
}

/* Кнопка открытия drawer — скрыта на десктопе */
.furniture-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F8F9FA;
    border: 2px solid #E0DDEB;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    font-family: inherit;
}

.furniture-filter-toggle:hover {
    background: #E0DDEB;
    border-color: var(--preview-accent);
}

.furniture-filter-toggle i {
    font-size: 16px;
}

.furniture-filter-toggle-text {
    font-weight: 500;
}

.furniture-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    background: white;
    z-index: 10001;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.furniture-drawer.open {
    left: 0;
}

.furniture-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 2px solid #E0DDEB;
    background: white;
    flex-shrink: 0;
}

.furniture-drawer-header h6 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.furniture-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F0F0F0;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.furniture-drawer-close:hover {
    background: var(--preview-accent);
    color: white;
}

.furniture-drawer-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.furniture-drawer-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.furniture-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Адаптивность */
@media (max-width: 768px) {
    #furniture-modal .modal-content {
        max-height: 85vh;
        max-height: 85dvh;
        margin: 1rem auto;
    }

    .furniture-modal-layout {
        flex-direction: column;
        min-height: 0;
    }

    /* Сайдбар категорий полностью скрыт на мобильных */
    .furniture-sidebar {
        display: none !important;
    }
    
    .furniture-main-content {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        width: 100%;
    }
    
    #furniture-modal .furniture-items-grid,
    .furniture-items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .furniture-item-card .card-img-top {
        height: 120px;
    }

    .furniture-ring-container {
        gap: 10px;
    }

    .furniture-selector-field,
    .ring-selector-field {
        padding: 16px 10px;
        min-height: 120px;
    }

    .furniture-field-text {
        font-size: 13px;
        line-height: 1.35;
    }

    .furniture-connector {
        flex-shrink: 0;
    }
}

@media (max-width: 575px) {
    #furniture-modal .modal-header {
        padding: 12px 16px;
    }

    #furniture-modal .modal-header-left {
        gap: 8px;
    }

    #furniture-modal .modal-header h3 {
        font-size: 16px;
    }

    .furniture-filter-toggle {
        display: flex;
    }

    .furniture-filter-toggle-text {
        display: none;
    }

    .furniture-drawer {
        width: 280px;
        max-width: 85vw;
    }

    .furniture-drawer-header {
        padding: 12px 16px;
    }

    .furniture-drawer-header h6 {
        font-size: 14px;
    }

    .furniture-drawer-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    .furniture-drawer-content .furniture-category-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .furniture-drawer-content .furniture-category-btn .category-name {
        font-size: 13px;
    }

    .furniture-drawer-content .furniture-category-btn .category-count {
        font-size: 11px;
        padding: 3px 8px;
        min-width: 24px;
    }
}

/* =============================================
   Система слоёв (Layers System)
   ============================================= */

/* Контейнер слоёв */
#layers-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100px; /* Минимальная высота для предотвращения прыжков */
    transition: min-height 0.2s ease;
}

/* Группа слоя */
.layer-group {
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
    will-change: opacity, transform;
    min-height: 50px; /* Минимальная высота для предотвращения прыжков */
}

.layer-group.layer-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.layer-group.layer-disabled .option-button,
.layer-group.layer-disabled .acrylic-type-button {
    cursor: not-allowed;
}

/* Разрешаем ввод в поля number даже когда слой disabled (для quantity) */
.layer-group.layer-disabled input[type="number"],
.layer-group.layer-disabled input[type="number"]:focus {
    pointer-events: auto !important;
    cursor: text !important;
    opacity: 1 !important;
    background-color: white !important;
}

/* Также разрешаем ввод в контейнере quantity-input-wrapper */
.layer-group.layer-disabled .quantity-input-wrapper,
.layer-group.layer-disabled .quantity-input-container {
    pointer-events: auto !important;
}

.layer-group.layer-disabled .quantity-input-wrapper input[type="number"] {
    pointer-events: auto !important;
    cursor: text !important;
    opacity: 1 !important;
}

/* Обёртка label с inline подсказкой */
.layer-label-wrapper {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.layer-label-wrapper label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
    margin-bottom: 0;
}

.layer-label-hint {
    font-size: 12px;
    color: #9B95AA;
    font-weight: 400;
    font-style: italic;
}

/* Подсказка для слоя */
.layer-hint {
    color: #9B95AA;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

/* =============================================
   Система видимости слоёв (prerender + CSS)
   ============================================= */

/* Скрытый слой — не занимает место */
.layer-group.layer-hidden {
    display: none !important;
}

/* Видимый слой — плавное появление */
.layer-group.layer-visible {
    display: block;
    animation: layerFadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Слой который только что стал видимым — анимация slide-down */
.layer-group.layer-appearing {
    animation: layerSlideIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Каскадная задержка для первоначального появления полей */
.layer-group.layer-appearing:nth-child(1) { animation-delay: 0s; }
.layer-group.layer-appearing:nth-child(2) { animation-delay: 0.04s; }
.layer-group.layer-appearing:nth-child(3) { animation-delay: 0.08s; }
.layer-group.layer-appearing:nth-child(4) { animation-delay: 0.12s; }
.layer-group.layer-appearing:nth-child(5) { animation-delay: 0.16s; }
.layer-group.layer-appearing:nth-child(6) { animation-delay: 0.20s; }
.layer-group.layer-appearing:nth-child(7) { animation-delay: 0.24s; }
.layer-group.layer-appearing:nth-child(8) { animation-delay: 0.28s; }
.layer-group.layer-appearing:nth-child(9) { animation-delay: 0.32s; }
.layer-group.layer-appearing:nth-child(10) { animation-delay: 0.36s; }

@keyframes layerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes layerSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Placeholder загрузки */
.loading-placeholder {
    color: #9B95AA;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    border: 2px dashed #E0DDEB;
}

/* Контейнер типа изделия */
#product-type-group {
    margin-bottom: 20px;
}

#product-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

#product-type-grid .option-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
}

#product-type-grid .option-button span {
    font-size: 14px;
    text-align: center;
}

/* «Закатные значки» — занимает 2 колонки сетки (вдвое шире остальных), текст не режется */
#product-type-grid .option-button[data-category-id="sunset_badges"] {
    grid-column: span 2;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

#product-type-grid .option-button[data-category-id="sunset_badges"] span {
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
}

/* Дополнительные поля (скрыт - все поля теперь в layers-container) */
#additional-fields-container {
    display: none;
}

.field-hint {
    color: #9B95AA;
    font-size: 12px;
    margin-top: 5px;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    #product-type-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    #product-type-grid .option-button {
        padding: 10px 8px;
    }
    
    #product-type-grid .option-button span {
        font-size: 12px;
    }

    /* Заполнение последнего ряда без «дыры» (логика в applyProductTypeGridMobileLayout) */
    #product-type-grid .option-button.product-type-mobile-fill-row {
        grid-column: 1 / -1 !important;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    #product-type-grid .option-button.product-type-mobile-span-2 {
        grid-column: span 2 !important;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    #product-type-grid .option-button.product-type-mobile-fill-row span,
    #product-type-grid .option-button.product-type-mobile-span-2 span {
        min-width: 0;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.3;
    }
    
    #layers-container {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    #product-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================
   Оверлей загрузки при редактировании товара
   ============================================= */

.form-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 20px;
    backdrop-filter: blur(2px);
}

.form-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--preview-accent);
    font-size: 16px;
    font-weight: 500;
}

.form-loading-spinner i {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Плавное появление формы после загрузки */
#layers-container,
.calculator-form,
#product-form {
    transition: opacity 0.3s ease;
}

/* =============================================
   Модальное окно дубликата товара
   ============================================= */

.duplicate-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto; /* для работы внутри #modal-root (pointer-events: none) */
}

.duplicate-modal-overlay.active {
    opacity: 1;
}

.duplicate-modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.duplicate-modal-overlay.active .duplicate-modal-content {
    transform: scale(1);
}

.duplicate-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E0DDEB;
}

.duplicate-modal-content .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.duplicate-modal-content .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.duplicate-modal-content .modal-close:hover {
    color: #666;
}

.duplicate-modal-content .modal-body {
    padding: 24px;
}

.duplicate-modal-content .modal-body p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.duplicate-modal-content .modal-body p:last-child {
    margin-bottom: 0;
    font-weight: 500;
    color: #333;
}

.duplicate-modal-buttons {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.duplicate-modal-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Unbounded", sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.duplicate-modal-buttons .btn-primary {
    background: linear-gradient(135deg, var(--preview-accent) 0%, #9B59B6 100%);
    color: white;
}

.duplicate-modal-buttons .btn-primary:hover {
    transform: translateY(-2px);
}

.duplicate-modal-buttons .btn-primary:active {
    transform: translateY(0);
}

.duplicate-modal-buttons .btn-secondary {
    background: transparent;
    border: 2px solid var(--preview-accent);
    color: var(--preview-accent);
}

.duplicate-modal-buttons .btn-secondary:hover {
    background: #f8f4ff;
    transform: translateY(-2px);
}

.duplicate-modal-buttons .btn-secondary:active {
    transform: translateY(0);
}

.duplicate-modal-buttons .btn i {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

.duplicate-modal-buttons .btn-primary i {
    color: white;
    opacity: 1;
}

/* Мобильная адаптация модального окна дубликата */
@media (max-width: 768px) {
    .duplicate-modal-content {
        margin: 16px;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
        width: calc(100% - 32px);
    }

    .duplicate-modal-content .modal-header {
        padding: 16px 20px;
    }

    .duplicate-modal-content .modal-header h3 {
        font-size: 16px;
    }

    .duplicate-modal-content .modal-body {
        padding: 20px;
    }

    .duplicate-modal-content .modal-body p {
        font-size: 14px;
    }

    .duplicate-modal-buttons {
        padding: 16px 20px 20px;
        gap: 10px;
    }

    .duplicate-modal-buttons .btn {
        padding: 14px 20px;
        font-size: 14px;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .duplicate-modal-content {
        margin: 12px;
        width: calc(100% - 24px);
        border-radius: 16px;
    }

    .duplicate-modal-content .modal-header {
        padding: 14px 16px;
    }

    .duplicate-modal-content .modal-header h3 {
        font-size: 15px;
    }

    .duplicate-modal-content .modal-body {
        padding: 16px;
    }

    .duplicate-modal-content .modal-body p {
        font-size: 13px;
    }

    .duplicate-modal-buttons {
        padding: 14px 16px 16px;
    }

    .duplicate-modal-buttons .btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* =============================================
   Модальное окно напоминания о дубликате
   ============================================= */
.duplicate-reminder-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.duplicate-reminder-modal.active {
    opacity: 1;
    visibility: visible;
}

.duplicate-reminder-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.duplicate-reminder-modal.active .duplicate-reminder-content {
    transform: scale(1);
}

.duplicate-reminder-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E0DDEB;
}

.duplicate-reminder-content .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.duplicate-reminder-content .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.duplicate-reminder-content .modal-close:hover {
    color: #333;
    background: #F5F3FA;
}

.duplicate-reminder-content .modal-body {
    padding: 24px;
}

.duplicate-reminder-content .modal-body p {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.duplicate-reminder-content .modal-body p:last-child {
    margin-bottom: 0;
}

.duplicate-reminder-content .modal-body .link-to-account {
    color: var(--preview-accent);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.duplicate-reminder-content .modal-body .link-to-account:hover {
    border-bottom-color: var(--preview-accent);
}

.duplicate-reminder-content .modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.duplicate-reminder-content .modal-footer .btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.duplicate-reminder-content .modal-footer .btn-secondary {
    background: #F5F3FA;
    color: #666;
}

.duplicate-reminder-content .modal-footer .btn-secondary:hover {
    background: #E8E4F0;
    color: #333;
}

.duplicate-reminder-content .modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--preview-accent) 0%, #5a1fcc 100%);
    color: white;
}

.duplicate-reminder-content .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #5a1fcc 0%, #4a1ab3 100%);
    transform: translateY(-1px);
}

/* ============================================
   Модальное окно выбора типа заказа
   ============================================ */

#order-type-modal .modal-content {
    max-width: 500px;
}

.order-type-btn {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 2px solid #E0DDEB;
    border-radius: 15px;
    background: white;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.order-type-btn:hover {
    border-color: var(--preview-accent);
    background: #F8F5FF;
    transform: translateY(-2px);
}

.order-type-btn i {
    font-size: 20px;
    color: var(--preview-accent);
    width: 24px;
    text-align: center;
}

.order-type-btn.individual i {
    color: #666;
}

.order-type-btn.collect i {
    color: var(--preview-accent);
}

.order-type-btn span {
    flex: 1;
    font-weight: 700;
}

.collects-list {
    margin-top: 8px;
}

.collect-deadline-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
    color: #856404;
}

.collect-deadline-warning i {
    margin-right: 8px;
    color: #ffc107;
}

/* Тестовая копия калькулятора */
.main-title .preview-badge {
    font-size: 0.5em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    vertical-align: middle;
    margin-left: 0.15em;
}

/* Инвентарь: калькулятор лестницы */
.staircase-calc-layer {
    margin-top: 0.5rem;
}

.staircase-calc-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.staircase-calc-row label {
    font-weight: 600;
    font-size: 0.9rem;
}

.staircase-calc-field-error {
    color: #c0392b;
    font-size: 0.8rem;
    min-height: 1.1em;
}

.staircase-calc-error {
    color: #c0392b;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.staircase-calc-results {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.staircase-calc-results .stair-res-line {
    margin: 0.35rem 0;
    font-size: 0.9rem;
}

.staircase-calc-svg-wrap {
    margin-top: 0.75rem;
}

.staircase-calc-svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Инвентарь: превью типа с кнопкой expand (как закатные значки) */
.inventory-type-grid .acrylic-type-content {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 0;
}

.inventory-type-grid .badge-shape-img-wrap {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.inventory-type-grid .badge-shape-img-wrap .acrylic-type-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    cursor: default;
}

.inventory-type-grid .badge-shape-expand-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: rgba(40, 40, 45, 0.82);
    color: #fff;
    cursor: zoom-in;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease,
        background 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.inventory-type-grid .badge-shape-img-wrap:hover .badge-shape-expand-btn,
.inventory-type-grid .badge-shape-expand-btn:focus-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.inventory-type-grid .badge-shape-expand-btn:hover,
.inventory-type-grid .badge-shape-expand-btn:focus-visible {
    background: rgba(30, 30, 35, 0.95);
}

@media (hover: none) {
    .inventory-type-grid .badge-shape-expand-btn {
        opacity: 0.55;
        visibility: visible;
        transform: scale(1);
    }

    .inventory-type-grid .badge-shape-img-wrap:active .badge-shape-expand-btn {
        opacity: 1;
    }
}

/* Инвентарь: блок ввода размеров (Лесенка / Лотки) */
.inventory-dim-calc {
    margin-top: 0.5rem;
}

.inventory-dim-calc__title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.inventory-dim-calc__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 600px) {
    .inventory-dim-calc:not(.inventory-dim-calc--stair) .inventory-dim-calc__body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
        align-items: start;
    }
}

/* Лесенка / лотки: поля слева, схема справа; итоги под полями */
.inventory-dim-calc--stair,
.inventory-dim-calc--tray {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.inventory-dim-calc__row-with-guide {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.5rem 2.5rem;
}

.inventory-dim-calc__inputs-col {
    flex: 0 0 auto;
}

.inventory-dim-calc__grid--narrow {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    max-width: 24rem;
}

.inventory-dim-calc__field--narrow label {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.inventory-dim-calc__input--narrow {
    width: 10.5rem;
    max-width: 100%;
    flex: 0 0 auto;
    text-align: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.layer-group .inventory-dim-calc__input.inventory-dim-calc__input--below-min,
.layer-group input.inventory-dim-calc__input--below-min.form-control {
    border-color: #c0392b !important;
    color: #c0392b !important;
    -webkit-text-fill-color: #c0392b !important;
    caret-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.25) !important;
    background-color: #fff5f5 !important;
}

.layer-group .inventory-dim-calc__input.inventory-dim-calc__input--below-min:focus,
.layer-group input.inventory-dim-calc__input--below-min.form-control:focus {
    border-color: #a93226 !important;
    color: #a93226 !important;
    -webkit-text-fill-color: #a93226 !important;
    caret-color: #a93226;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.35) !important;
    background-color: #fff5f5 !important;
}

.inventory-dim-calc__guide {
    flex: 0 1 240px;
    min-width: 11rem;
    max-width: 300px;
    margin-left: auto;
}

.inventory-dim-calc__guide-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.inventory-dim-calc--stair .inventory-dim-calc__results,
.inventory-dim-calc--tray .inventory-dim-calc__results {
    margin-top: 0.25rem;
}

@media (max-width: 479px) {
    .inventory-dim-calc__row-with-guide {
        flex-direction: column;
        gap: 0.5rem;
    }

    .inventory-dim-calc__guide {
        order: -1;
        flex: 0 0 auto;
        min-width: 0;
        margin-left: 0;
        margin-bottom: 0;
        max-width: min(100%, 220px);
        align-self: center;
    }

    .inventory-dim-calc--stair .inventory-dim-calc__inputs-col,
    .inventory-dim-calc--tray .inventory-dim-calc__inputs-col {
        width: 100%;
    }

    .inventory-dim-calc--stair .inventory-dim-calc__grid--narrow,
    .inventory-dim-calc--tray .inventory-dim-calc__grid--narrow {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        gap: 0.5rem 0.65rem;
    }

    .inventory-dim-calc--stair .inventory-dim-calc__input--narrow,
    .inventory-dim-calc--tray .inventory-dim-calc__input--narrow {
        width: 100%;
    }
}

.inventory-dim-calc__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .inventory-dim-calc__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem 1rem;
    }
}

.inventory-dim-calc__field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.inventory-dim-calc__input-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.inventory-dim-calc__input-wrap .form-control {
    flex: 1;
    min-width: 0;
}

.inventory-dim-calc__suffix {
    flex-shrink: 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.inventory-dim-calc__field-error {
    color: #c0392b;
    font-size: 0.78rem;
    min-height: 1.05em;
    margin-top: 0.2rem;
}

.inventory-dim-calc__error,
.inventory-dim-calc .staircase-calc-error {
    color: #c0392b;
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
}

.inventory-dim-calc__hint {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
}

.inventory-dim-calc__results,
.inventory-dim-calc .staircase-calc-results {
    margin-top: 0;
    padding: 0.85rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.inventory-dim-calc__results .stair-res-line {
    margin: 0.35rem 0;
    font-size: 0.9rem;
}

.inventory-dim-calc__svg,
.inventory-dim-calc .staircase-calc-svg-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.75rem;
    min-height: 64px;
}

/* =============================================
   Кнопка «Из моих товаров» и модалки
   ============================================= */

.form-title-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-my-products {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #F0E8FF;
    color: #5B21B6;
    border: none;
    border-radius: 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.btn-my-products:hover {
    background: #7231FF;
    color: white;
    transform: translateY(-2px);
}

.btn-my-products:active {
    transform: translateY(1px);
}

.btn-my-products i,
.btn-my-products span {
    font-size: 14px;
}

.modal.my-products-stack {
    z-index: 2147483645;
}

#furniture-modal.active {
    z-index: 2147483647;
}

.my-products-modal-content {
    max-width: 980px;
}

.my-products-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.my-products-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #333;
    transition: all 0.2s ease;
}

.my-products-filter-btn:hover {
    background: #e9ecef;
}

.my-products-filter-btn.active {
    background: linear-gradient(135deg, #7231FF 0%, #9B59B6 100%);
    border-color: #7231FF;
    color: white;
}

.my-products-filter-count {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.08);
    color: #666;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 600;
}

.my-products-filter-btn.active .my-products-filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.my-products-status {
    text-align: center;
    color: #666;
    padding: 24px 12px;
}

.my-products-status[hidden],
.my-products-filters[hidden] {
    display: none;
}

.my-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.my-product-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.my-product-card:hover {
    box-shadow: 0 6px 20px rgba(114, 49, 255, 0.15);
    transform: translateY(-3px);
}

.my-product-card-image {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.my-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-product-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.my-product-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 34px;
}

.my-product-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.my-product-card-badge {
    font-size: 11px;
    color: #555;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.my-product-card-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: none;
    border-radius: 0 0 14px 14px;
    font-size: 14px;
    font-weight: 600;
}

.my-product-card-add:hover {
    transform: none;
    filter: brightness(1.03);
}

.my-products-modal-footer {
    display: flex;
    width: 100%;
    gap: 10px;
    padding: 20px 30px !important;
    margin: 0;
    border-top: 1px solid #E0DDEB;
    box-sizing: border-box;
}

.my-products-modal-footer .btn-cancel,
.my-products-modal-footer .btn-add {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    width: 0;
    max-width: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Unbounded", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.my-products-modal-footer .btn-cancel {
    background: transparent;
    border: 2px solid #888;
    color: #888;
}

.my-products-modal-footer .btn-cancel:hover {
    background: #f8f9fa;
    border-color: #666;
    color: #666;
    transform: none;
}

.my-products-modal-footer .btn-add {
    border: none;
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
}

.my-products-modal-footer .btn-add:hover {
    transform: translateY(-2px);
}

.my-products-modal-footer .btn-add:active {
    transform: translateY(1px);
}

.my-product-qty-quick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 36px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-product-qty-quick:hover {
    background: #FFE343;
    border-color: #FFD600;
    color: #333;
}

.my-product-qty-quick:active {
    transform: translateY(1px);
}

.my-product-preview-content {
    max-width: 920px;
}

.my-product-preview-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.my-product-preview-image-col {
    flex: 0 0 320px;
    min-width: 0;
}

.my-product-preview-info-col {
    flex: 1;
    min-width: 0;
}

.my-product-preview-image-wrap {
    width: 100%;
    aspect-ratio: 1;
    max-height: min(42vh, 320px);
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-product-preview-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.my-product-preview-section {
    margin-bottom: 16px;
}

.my-product-preview-section h4 {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
}

.my-product-param-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-product-param-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.my-product-param-label {
    color: #666;
    font-weight: 500;
}

.my-product-param-value {
    color: #333;
    font-weight: 600;
    text-align: right;
}

.my-product-furniture-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.my-product-furniture-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.my-product-furniture-thumb {
    width: 110px;
    height: 110px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-product-furniture-thumb.is-warning {
    border-color: #D32F2F;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.18);
}

.my-product-furniture-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.my-product-furniture-sku {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.my-product-furniture-change {
    padding: 8px 14px;
    border: 2px solid #888;
    border-radius: 16px;
    background: transparent;
    color: #666;
    font-family: "Unbounded", sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-product-furniture-change:hover {
    background: #f8f9fa;
    border-color: #666;
    color: #333;
}

.my-product-furniture-change.is-warning {
    background: #FFE0E0;
    border-color: #D32F2F;
    color: #D32F2F;
}

.my-product-stock-warning {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #FFF3E0;
    border: 1px solid #FFB74D;
    border-radius: 12px;
    color: #E65100;
    font-size: 13px;
    font-weight: 500;
}

.my-product-add-name {
    font-weight: 600;
    margin: 0 0 16px;
    color: #333;
}

.my-product-checkbox-label,
.my-product-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.my-product-radio-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .my-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .my-product-preview-layout {
        flex-direction: column;
    }

    .my-product-preview-image-col {
        flex: none;
        width: 100%;
    }

    .my-products-modal-footer {
        flex-direction: column-reverse;
        padding: 16px 20px !important;
    }

    .my-products-modal-footer .btn-cancel,
    .my-products-modal-footer .btn-add {
        width: 100%;
    }
}
