/* =============================================
   ArtMastex Retail Price Calculator - Стили
   ============================================= */

/* =============================================
   Снегопад
   ============================================= */
#snowfall-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    background: white;
    border-radius: 50%;
    will-change: transform;
    animation: snowfall linear infinite;
    animation-duration: var(--snowfall-duration, 5s);
    animation-delay: var(--snowfall-delay, 0s);
    /* Принудительное GPU ускорение */
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Примечание: Отключение анимации для prefers-reduced-motion обрабатывается в JavaScript,
   чтобы дать пользователю больше контроля */

/* Типизация CSS переменных для лучшей оптимизации браузером */
/* @property позволяет браузеру оптимизировать анимацию переменных */
@property --snowfall-x-0 {
    syntax: '<length>';
    initial-value: 0px;
    inherits: false;
}
@property --snowfall-x-25 {
    syntax: '<length>';
    initial-value: 0px;
    inherits: false;
}
@property --snowfall-x-50 {
    syntax: '<length>';
    initial-value: 0px;
    inherits: false;
}
@property --snowfall-x-75 {
    syntax: '<length>';
    initial-value: 0px;
    inherits: false;
}
@property --snowfall-x-100 {
    syntax: '<length>';
    initial-value: 0px;
    inherits: false;
}

/* Упрощенная анимация с меньшим количеством keyframes для лучшей производительности */
@keyframes snowfall {
    0% {
        transform: translate3d(var(--snowfall-x-0, 0px), 0, 0);
        opacity: 1;
    }
    25% {
        transform: translate3d(var(--snowfall-x-25, 0px), 25vh, 0);
    }
    50% {
        transform: translate3d(var(--snowfall-x-50, 0px), 50vh, 0);
    }
    75% {
        transform: translate3d(var(--snowfall-x-75, 0px), 75vh, 0);
    }
    100% {
        transform: translate3d(var(--snowfall-x-100, 0px), 100vh, 0);
        opacity: 0.3;
    }
}

/* Класс для паузы анимации при скрытии вкладки */
.snowflake.paused {
    animation-play-state: paused !important;
}

/* Шрифты */
@font-face {
    font-family: 'NauryzRedKeds';
    src: url('font/NauryzRedKeds.ttf') format('truetype');
    font-style: normal;
    font-weight: normal;
}

/* Базовые стили */
* {
    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;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

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: #7231FF;
    background-attachment: scroll;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Оптимизация фоновых изображений для мобильных */
@media (max-width: 768px) {
    body {
        background-size: 200% auto, cover;
        background-position: 50% 0, center top;
    }
}

@media (max-width: 480px) {
    body {
        background-image: url(picture/Vector.svg); /* Упрощаем фон на маленьких экранах */
        background-size: cover;
        background-position: center top;
    }
}

/* Контейнер */
.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;
}

/* =============================================
   Навигация
   ============================================= */

.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;
    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;
}

.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;
    min-width: 44px;
    min-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;
    flex-shrink: 0;
}

.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;
}

/* =============================================
   Шапка
   ============================================= */

.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);
}

.main-title {
    font-family: "NauryzRedKeds", sans-serif;
    font-size: clamp(28px, 5vw, 72px);
    color: white;
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    letter-spacing: clamp(1px, 0.2vw, 2px);
    flex-shrink: 0;
    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;
    gap: 40px;
    flex: 1;
    align-items: start;
    margin-bottom: 40px;
    margin-top: -10px;
    position: relative;
    z-index: 1;
}

/* =============================================
   Секции формы
   ============================================= */

.form-section,
.results-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow: visible;
    position: relative;
}

.form-card {
    background: #FFFFFF;
    border: 2px solid #E8E5F0;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 30px;
    color: #333;
    overflow: visible;
}

.results-card {
    background: linear-gradient(135deg, #F8F6FF 0%, #FFFFFF 100%);
    border: 2px solid #7231FF;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(114, 49, 255, 0.15);
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    color: #333;
    overflow: visible;
}

.form-card *,
.results-card * {
    color: inherit;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    position: relative;
}

.title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #FFE343;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #7231FF;
}

/* =============================================
   Форма
   ============================================= */

.retail-price-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 input[type="number"],
.form-group select {
    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;
    width: 100%;
}

.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;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group select:focus,
.form-group input:focus {
    border-color: #7231FF;
    background: white;
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

.text-danger {
    color: #dc3545;
}

/* Переключатели типа ввода (% или ₽) */
.expense-group {
    position: relative;
}

.expense-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expense-type-toggle {
    display: flex;
    gap: 4px;
    background: #F5F5F5;
    border-radius: 12px;
    padding: 4px;
    align-items: stretch; /* Выравнивание по высоте */
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: 36px; /* Базовый минимум для десктопа */
    min-width: 48px; /* Touch-friendly ширина */
}

.toggle-btn:hover {
    background: rgba(114, 49, 255, 0.1);
    color: #7231FF;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.expense-input {
    flex: 1;
}

/* =============================================
   Кнопки выбора (option-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;
    min-height: 40px; /* Базовый минимум для десктопа */
    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-button:hover {
    border-color: #7231FF;
    background: #F8F6FF;
    transform: translateY(-2px);
}

.option-button.active {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
    border-color: #FFE343;
    font-weight: 600;
}

/* =============================================
   Список результатов с прогресс-барами
   ============================================= */

.results-list-container {
    width: 100%;
    margin-bottom: 12px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: grid;
    grid-template-columns: 1fr auto 120px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #FAFAFA;
    border-radius: 10px;
    border: 1px solid #E0DDEB;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: #F5F5F5;
    border-color: #D0CCDB;
}

.result-item.profit {
    background: #E8F5E9;
    border-color: #A5D6A7;
    font-weight: 600;
}

.result-label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.result-item.profit .result-label {
    color: #2e7d32;
    font-weight: 600;
}

.result-value-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 100px;
}

.result-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.result-item.expense .result-value {
    color: #666;
}

.result-item.profit .result-value {
    color: #2e7d32;
}

.result-percent {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.result-bar {
    width: 120px;
    height: 8px;
    background: #E0DDEB;
    border: 1px solid #D0CCDB;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.result-bar-fill {
    height: 100%;
    border-radius: 0;
    transition: width 0.3s ease, left 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.result-bar-fill:first-child {
    border-radius: 4px 0 0 4px;
}

.result-bar-fill:last-child {
    border-radius: 0 4px 4px 0;
}

.result-bar-fill:only-child {
    border-radius: 4px;
}

.result-bar-fill.expense {
    background: #4A90E2;
}

.result-bar-fill.profit {
    background: #4CAF50;
}

.result-bar-fill:not(.expense):not(.profit) {
    background: #9E9E9E;
}

.empty-message {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
    font-size: 13px;
}

/* =============================================
   Итоговая информация
   ============================================= */

.summary-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #E0DDEB;
}

/* =============================================
   Обратный расчёт от прибыли
   ============================================= */

.profit-calculator-section {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #F0F8FF 0%, #E8F5E9 100%);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.profit-calculator-header {
    margin-bottom: 12px;
}

.profit-calculator-title {
    font-size: 14px;
    font-weight: 600;
    color: #2e7d32;
}

.profit-calculator-body {
    display: flex;
    gap: 12px;
    align-items: center;
}

.profit-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.profit-input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 2px solid #A5D6A7;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

.profit-input-wrapper input::-webkit-inner-spin-button,
.profit-input-wrapper input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.profit-input-wrapper input {
    -moz-appearance: textfield;
}

.profit-input-wrapper input:focus {
    border-color: #4CAF50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.profit-input-wrapper input::placeholder {
    color: #81C784;
}

.profit-input-suffix {
    position: absolute;
    right: 14px;
    color: #4CAF50;
    font-weight: 600;
    font-size: 14px;
    pointer-events: none;
}

.btn-calculate-from-profit {
    padding: 12px 20px;
    border: none;
    background: linear-gradient(135deg, #4CAF50 0%, #45A049 100%);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.btn-calculate-from-profit:hover {
    background: linear-gradient(135deg, #45A049 0%, #388E3C 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-calculate-from-profit:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

/* Анимация подсветки для поля розничной цены */
@keyframes highlightGreen {
    0% {
        background: #E8F5E9;
        border-color: #4CAF50;
        transform: scale(1);
    }
    50% {
        background: #C8E6C9;
        border-color: #66BB6A;
        transform: scale(1.02);
    }
    100% {
        background: #FAFAFA;
        border-color: #E0DDEB;
        transform: scale(1);
    }
}

.retail-price-highlight {
    animation: highlightGreen 2s ease-out;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 15px;
}

.summary-row.profit {
    font-size: 17px;
    font-weight: 600;
    color: #2e7d32;
}

.summary-label {
    color: #555;
}

.summary-value {
    font-weight: 600;
    color: #333;
}

.summary-row.profit .summary-value {
    color: #2e7d32;
}

/* =============================================
   Footer
   ============================================= */

.footer {
    margin-top: 40px;
    position: relative;
    z-index: 1;
    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: 1200px) {
    .main-title {
        font-size: clamp(42px, 5vw, 60px);
    }
    
    .form-card,
    .results-card {
        padding: 24px;
    }
    
    .main-content {
        gap: 32px;
    }
    
    .container {
        padding: 0 12px !important;
    }
    
    /* Навигация - используем единые стили из common.css */
    
    .option-button {
        min-width: 100px;
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Планшеты в портретной ориентации */
@media (max-width: 992px) {
    .main-title {
        font-size: clamp(36px, 5vw, 54px);
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .form-card,
    .results-card {
        padding: 22px;
    }
    
    .toggle-btn {
        min-height: 44px;
        padding: 10px 18px;
    }
    
    .option-button {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .expense-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .expense-input-wrapper {
        width: 100%;
        align-items: stretch;
    }
    
    .expense-type-toggle {
        height: 44px; /* Фиксированная высота для выравнивания */
        align-items: center;
        padding: 3px;
    }
    
    .toggle-btn {
        flex: 1;
        height: calc(100% - 6px); /* Учитываем padding родителя */
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0 14px;
    }
    
    .toggle-btn.active {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }
    
    .expense-input {
        height: 44px; /* Такая же высота как у переключателей */
    }
    
    .btn-create-variant {
        width: 100%;
        order: 2; /* Перемещаем кнопку вниз */
        margin-top: 0;
        min-height: 44px;
        padding: 12px 18px;
    }
    
    .expense-input-wrapper {
        order: 1; /* Поля ввода сверху */
    }
    
    .form-group input[type="number"],
    .form-group select {
        min-height: 44px;
        padding: 12px 16px;
    }
}

/* Мобильные телефоны */
@media (max-width: 768px) {
    /* Навигация - используем единые стили из common.css */
    
    .main-title {
        font-size: clamp(32px, 8vw, 42px);
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 0;
    }
    
    .form-card,
    .results-card {
        padding: 20px;
        border-radius: 24px;
    }
    
    .container {
        padding: 0 10px !important;
    }
    
    /* Навигация - используем единые стили из common.css */
    
    .section-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .title-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .retail-price-form {
        gap: 12px;
    }
    
    .form-group {
        gap: 6px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .form-group input[type="number"],
    .form-group select {
        padding: 14px 16px;
        font-size: 16px; /* Предотвращает зум на iOS */
        min-height: 48px;
    }
    
    .toggle-btn {
        min-height: 48px;
        padding: 12px 18px;
        font-size: 15px;
    }
    
    .expense-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .expense-input-wrapper {
        width: 100%;
        align-items: stretch;
    }
    
    .expense-type-toggle {
        padding: 4px;
        gap: 4px;
        height: 48px; /* Фиксированная высота для выравнивания */
        align-items: center;
    }
    
    .toggle-btn {
        flex: 1;
        height: calc(100% - 8px); /* Учитываем padding родителя */
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0 16px;
    }
    
    .toggle-btn.active {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }
    
    .expense-input {
        height: 48px; /* Такая же высота как у переключателей */
    }
    
    .btn-create-variant {
        width: 100%;
        order: 2; /* Перемещаем кнопку вниз */
        margin-top: 0;
    }
    
    .expense-input-wrapper {
        order: 1; /* Поля ввода сверху */
    }
    
    .option-grid {
        gap: 10px;
    }
    
    .option-button {
        min-height: 48px;
        padding: 14px 16px;
        font-size: 14px;
        min-width: auto;
        flex: 1 1 auto;
    }
    
    .btn-create-variant {
        min-height: 48px;
        padding: 12px 18px;
        font-size: 15px;
    }
    
    .expense-input {
        min-height: 48px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .result-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }
    
    .result-label {
        font-size: 14px;
    }
    
    .result-value {
        font-size: 16px;
    }
    
    .result-percent {
        font-size: 16px;
    }
    
    .result-value-wrapper {
        align-items: center;
        justify-content: space-between;
        min-width: auto;
        flex-direction: row;
        gap: 8px;
        width: 100%;
    }
    
    .result-bar {
        width: 100%;
        height: 10px;
    }
    
    .summary-row {
        font-size: 14px;
        padding: 10px 0;
    }
    
    .summary-row.profit {
        font-size: 16px;
    }
    
    .profit-calculator-section {
        padding: 14px;
        margin-top: 14px;
    }
    
    .profit-calculator-title {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .profit-calculator-body {
        flex-direction: column;
        gap: 10px;
    }
    
    .profit-input-wrapper input {
        min-height: 48px;
        font-size: 16px; /* Предотвращает зум на iOS */
        padding: 14px 40px 14px 16px;
    }
    
    .btn-calculate-from-profit {
        width: 100%;
        min-height: 48px;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .footer {
        padding: 20px 16px;
        margin-top: 30px;
        border-radius: 24px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .footer-links a {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .social-link {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .back-link {
        font-size: 14px;
        padding: 12px 20px;
        min-height: 44px;
    }
    
    .header {
        padding: 0 0 16px;
    }
    
    body {
        background-size: 200% auto, cover;
        background-position: 50% 0, center top;
        padding-bottom: 30px;
    }
}

/* Маленькие мобильные телефоны */
@media (max-width: 480px) {
    .main-title {
        font-size: clamp(28px, 10vw, 36px);
    }
    
    .form-card,
    .results-card {
        padding: 16px;
        border-radius: 20px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    /* Навигация - используем единые стили из common.css */
    
    .section-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .title-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .retail-price-form {
        gap: 10px;
    }
    
    .form-group {
        gap: 6px;
    }
    
    .form-group input[type="number"],
    .form-group select {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .expense-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .prices-row {
        gap: 10px;
    }
    
    .expenses-row {
        gap: 10px;
    }
    
    .expense-input-wrapper {
        width: 100%;
        align-items: stretch;
    }
    
    .expense-type-toggle {
        height: 48px; /* Фиксированная высота для выравнивания */
        align-items: center;
        padding: 4px;
    }
    
    .toggle-btn {
        flex: 1;
        height: calc(100% - 8px); /* Учитываем padding родителя */
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0 14px;
    }
    
    .toggle-btn.active {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }
    
    .expense-input {
        height: 48px; /* Такая же высота как у переключателей */
    }
    
    .btn-create-variant {
        width: 100%;
        order: 2; /* Перемещаем кнопку вниз */
        margin-top: 0;
    }
    
    .expense-input-wrapper {
        order: 1; /* Поля ввода сверху */
    }
    
    .option-button {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .result-item {
        padding: 12px;
    }
    
    .result-label {
        font-size: 13px;
    }
    
    .result-value {
        font-size: 15px;
    }
    
    .result-percent {
        font-size: 15px;
    }
    
    .summary-row {
        font-size: 13px;
    }
    
    .summary-row.profit {
        font-size: 15px;
    }
    
    .profit-calculator-section {
        padding: 12px;
    }
    
    .profit-calculator-title {
        font-size: 12px;
    }
    
    .footer {
        padding: 16px 12px;
        border-radius: 20px;
    }
    
    .footer-links a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .back-link {
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .main-title {
        font-size: clamp(24px, 12vw, 28px);
    }
    
    .form-card,
    .results-card {
        padding: 14px;
    }
    
    .container {
        padding: 0 8px;
    }
    
    /* Навигация - используем единые стили из common.css */
    
    .section-title {
        font-size: 15px;
    }
    
    .title-icon {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    
    .form-group input[type="number"],
    .form-group select {
        padding: 10px 12px;
    }
    
    .retail-price-form {
        gap: 8px;
    }
    
    .form-group {
        gap: 5px;
    }
    
    .expense-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .expense-input-wrapper {
        width: 100%;
        align-items: stretch;
    }
    
    .expense-type-toggle {
        height: 44px; /* Фиксированная высота для выравнивания */
        align-items: center;
        padding: 3px;
    }
    
    .prices-row {
        gap: 8px;
    }
    
    .expenses-row {
        gap: 8px;
    }
    
    .toggle-btn {
        flex: 1;
        height: calc(100% - 6px); /* Учитываем padding родителя */
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0 12px;
    }
    
    .toggle-btn.active {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }
    
    .expense-input {
        height: 44px; /* Такая же высота как у переключателей */
    }
    
    .btn-create-variant {
        width: 100%;
        order: 2; /* Перемещаем кнопку вниз */
        margin-top: 0;
    }
    
    .expense-input-wrapper {
        order: 1; /* Поля ввода сверху */
    }
    
    .option-button {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .result-item {
        padding: 10px;
    }
    
    .result-label {
        font-size: 12px;
    }
    
    .result-value {
        font-size: 14px;
    }
    
    .result-percent {
        font-size: 14px;
    }
    
    .summary-row {
        font-size: 12px;
        padding: 8px 0;
    }
    
    .summary-row.profit {
        font-size: 14px;
    }
    
    .profit-calculator-section {
        padding: 10px;
    }
    
    .footer {
        padding: 14px 10px;
    }
    
    .footer-links a {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* =============================================
   Управление вариантами
   ============================================= */

.expense-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.expense-group {
    position: relative;
}

.btn-create-variant {
    padding: 10px 16px;
    border: 2px solid #7231FF;
    background: white;
    color: #7231FF;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
    min-height: 40px; /* Базовый минимум для десктопа */
    min-width: 48px; /* Touch-friendly ширина */
}

.btn-create-variant:hover {
    background: #7231FF;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(114, 49, 255, 0.3);
}

.variants-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 2px solid #E0DDEB;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling для iOS */
    scrollbar-width: thin;
}

.variants-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F5F5F5;
    transition: background 0.2s ease;
    font-size: 14px;
    color: #333;
    min-height: 44px; /* Touch-friendly высота */
    display: flex;
    align-items: center;
}

.variants-dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.variants-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.variants-dropdown-item:hover {
    background: #F8F6FF;
}

.variants-dropdown-item.create-new {
    font-weight: 600;
    color: #7231FF;
    border-bottom: 2px solid #E0DDEB;
}

.variants-dropdown-item.active {
    background: #E8F5E9;
    color: #2E7D32;
    font-weight: 500;
}

/* =============================================
   Форма создания варианта в модальном окне
   ============================================= */

.variant-create-form {
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.variant-create-form .form-group {
    margin-bottom: 0;
}

/* Стили для формы создания варианта в модальном окне */
.variant-create-form .expense-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.variant-create-form .expense-input-wrapper .expense-type-toggle {
    display: flex;
    gap: 4px;
    background: #F5F5F5;
    border-radius: 12px;
    padding: 4px;
    flex-shrink: 0;
    align-items: center;
    height: 40px;
}

.variant-create-form .expense-input-wrapper .toggle-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    font-family: inherit;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.variant-create-form .expense-input-wrapper .toggle-btn:hover {
    background: rgba(114, 49, 255, 0.1);
    color: #7231FF;
}

.variant-create-form .expense-input-wrapper .toggle-btn.active {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
    font-weight: 600;
}

.variant-create-form .expense-input-wrapper .expense-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #E0DDEB;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
}

.variant-create-form .expense-input-wrapper .expense-input:focus {
    outline: none;
    border-color: #7231FF;
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

/* Старые стили для обратной совместимости (если где-то еще используются) */
.variant-type-toggle-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.variant-type-btn-form {
    padding: 8px 16px;
    border: 1px solid #E0DDEB;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    font-family: inherit;
}

.variant-type-btn-form:hover {
    background: #F8F6FF;
    border-color: #7231FF;
    color: #7231FF;
}

.variant-type-btn-form.active {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    border-color: #FFE343;
    color: #333;
    font-weight: 600;
}

.variants-dropdown-item.manage {
    font-weight: 500;
    color: #666;
    border-top: 2px solid #E0DDEB;
}

/* =============================================
   Модальные окна
   ============================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E0DDEB;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #F5F5F5;
    color: #333;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    gap: 20px;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling для iOS */
    scrollbar-width: thin;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 0;
    padding-top: 20px;
    border-top: 1px solid #E0DDEB;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #7231FF 0%, #5A1FD9 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(114, 49, 255, 0.3);
}

.btn-secondary {
    background: #F5F5F5;
    color: #666;
}

.btn-secondary:hover {
    background: #E0DDEB;
}

.variant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #E0DDEB;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #FAFAFA;
}

.variant-item-info {
    flex: 1;
}

.variant-item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.variant-item-value {
    font-size: 12px;
    color: #666;
}

.variant-item-actions {
    display: flex;
    gap: 8px;
}

.btn-edit-variant,
.btn-delete-variant {
    padding: 6px 12px;
    border: 1px solid #E0DDEB;
    border-radius: 6px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-edit-variant:hover {
    background: #F8F6FF;
    border-color: #7231FF;
    color: #7231FF;
}

.btn-delete-variant:hover {
    background: #FFF5F5;
    border-color: #F44336;
    color: #F44336;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E0DDEB;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: #7231FF;
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

/* =============================================
   Двухколоночное размещение расходов
   ============================================= */

.expenses-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* =============================================
   Размещение цены и себестоимости в одной строке
   ============================================= */

.prices-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .prices-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .expenses-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .expense-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .expense-variants-controls {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .variants-select {
        flex: 1;
        min-width: 0;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .variant-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
.variant-item-actions {
    width: 100%;
    justify-content: flex-end;
    }
}

/* =============================================
   Упрощенный список вариантов
   ============================================= */

.modal-content-large {
    max-width: 600px;
    width: 95%;
}

#variants-list-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.variants-list-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling для iOS */
    scrollbar-width: thin;
}

.variants-list-simple::-webkit-scrollbar {
    width: 6px;
}

.variants-list-simple::-webkit-scrollbar-track {
    background: #F5F5F5;
    border-radius: 3px;
}

.variants-list-simple::-webkit-scrollbar-thumb {
    background: #E0DDEB;
    border-radius: 3px;
}

.variants-list-simple::-webkit-scrollbar-thumb:hover {
    background: #D0CCDB;
}

.variant-item-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #FAFAFA;
    border: 2px solid #E0DDEB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

.variant-item-simple:hover {
    background: #F8F6FF;
    border-color: #7231FF;
}

.variant-item-simple.active {
    background: #E8F5E9;
    border-color: #4CAF50;
}

.variant-item-simple .variant-item-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.variant-item-simple .variant-item-value {
    font-weight: 600;
    color: #7231FF;
    font-size: 14px;
}

.variant-item-simple.active .variant-item-value {
    color: #2e7d32;
}

.variant-item-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.variant-item-delete:hover {
    background: #FFF5F5;
    color: #F44336;
}

.variants-empty-message {
    text-align: center;
    color: #999;
    padding: 30px 20px;
    font-style: italic;
    font-size: 14px;
}

.variants-section {
    margin-bottom: 24px;
}

.variants-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.variants-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling для iOS */
    scrollbar-width: thin;
}

.variants-list::-webkit-scrollbar {
    width: 6px;
}

.variants-list::-webkit-scrollbar-track {
    background: #F5F5F5;
    border-radius: 3px;
}

.variants-list::-webkit-scrollbar-thumb {
    background: #E0DDEB;
    border-radius: 3px;
}

.variants-list::-webkit-scrollbar-thumb:hover {
    background: #D0CCDB;
}

.variant-card {
    background: #FAFAFA;
    border: 2px solid #E0DDEB;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.variant-card:hover {
    border-color: #7231FF;
    background: #F8F6FF;
    box-shadow: 0 4px 12px rgba(114, 49, 255, 0.1);
    transform: translateY(-2px);
}

.variant-card.editing {
    border-color: #FFE343;
    background: #FFFEF5;
    box-shadow: 0 4px 16px rgba(255, 227, 67, 0.2);
}

.variant-card.newly-created {
    animation: highlightCard 2s ease-out;
}

@keyframes highlightCard {
    0% {
        background: #E8F5E9;
        border-color: #4CAF50;
        transform: scale(1.02);
    }
    50% {
        background: #E8F5E9;
        border-color: #4CAF50;
    }
    100% {
        background: #FAFAFA;
        border-color: #E0DDEB;
        transform: scale(1);
    }
}

.variant-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.variant-card-name {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    min-width: 0;
}

.variant-card-name-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #E0DDEB;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #333;
    background: white;
    transition: border-color 0.2s ease;
}

.variant-card-name-input:focus {
    outline: none;
    border-color: #7231FF;
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

.variant-card-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.variant-card-delete:hover {
    background: #FFF5F5;
    color: #F44336;
}

.variant-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.variant-card-value {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.variant-card-value-display {
    font-size: 18px;
    font-weight: 600;
    color: #7231FF;
}

.variant-card-type-badge {
    padding: 4px 10px;
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.variant-card-value-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #E0DDEB;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: #7231FF;
    background: white;
    transition: border-color 0.2s ease;
    max-width: 150px;
}

.variant-card-value-input:focus {
    outline: none;
    border-color: #7231FF;
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.1);
}

.variant-card-type-toggle {
    display: flex;
    gap: 4px;
    background: #F5F5F5;
    border-radius: 8px;
    padding: 2px;
}

.variant-card-type-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.variant-card-type-btn:hover {
    background: rgba(114, 49, 255, 0.1);
    color: #7231FF;
}

.variant-card-type-btn.active {
    background: linear-gradient(135deg, #FFE343 0%, #FFD600 100%);
    color: #333;
    font-weight: 600;
}

.variant-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.variant-card-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.variant-card-btn-apply {
    background: linear-gradient(135deg, #7231FF 0%, #5A1FD9 100%);
    color: white;
}

.variant-card-btn-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(114, 49, 255, 0.3);
}

.variant-card-btn-edit {
    background: white;
    color: #666;
    border: 1px solid #E0DDEB;
}

.variant-card-btn-edit:hover {
    background: #F8F6FF;
    border-color: #7231FF;
    color: #7231FF;
}

.variant-card-btn-save {
    background: linear-gradient(135deg, #4CAF50 0%, #45A049 100%);
    color: white;
}

.variant-card-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.variant-card-btn-cancel {
    background: #F5F5F5;
    color: #666;
    border: 1px solid #E0DDEB;
}

.variant-card-btn-cancel:hover {
    background: #E0DDEB;
}

.variants-empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
    font-size: 14px;
}

.variants-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #E0DDEB, transparent);
    margin: 24px 0;
}

.variant-create-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

/* =============================================
   Анимации для уведомлений
   ============================================= */

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

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

.variant-notification {
    animation: slideInRight 0.3s ease-out;
}

.variant-notification-success {
    background: #4CAF50;
    color: white;
}

.variant-notification-error {
    background: #F44336;
    color: white;
}

.variant-notification-info {
    background: #2196F3;
    color: white;
}

@media (max-width: 768px) {
    .modal-content-large {
        width: 98%;
        max-width: none;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 20px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
        max-height: calc(100vh - 160px);
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 24px;
    }
    
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .variants-list {
        max-height: 300px;
    }
    
    .variants-list-simple {
        max-height: 250px;
    }
    
    .variant-card {
        padding: 12px;
    }
    
    .variant-card-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .variant-card-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .variant-card-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .variant-card-btn {
        width: 100%;
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .variant-card-value-input {
        max-width: 100%;
    }
    
    .variant-item-simple {
        min-height: 48px;
        padding: 14px 16px;
    }
    
    .variant-item-delete {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }
    
    .variants-dropdown {
        min-width: 100%;
        max-width: 100%;
    }
    
    .variants-dropdown-item {
        min-height: 48px;
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 14px 16px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 20px;
    }
    
    .variants-list {
        max-height: 250px;
    }
    
    .variants-list-simple {
        max-height: 200px;
    }
    
    .variant-card {
        padding: 10px;
    }
    
    .variant-card-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .modal-content {
        width: 100%;
        border-radius: 12px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 12px 14px;
    }
    
    .modal-header h2 {
        font-size: 15px;
    }
    
    .modal-body {
        padding: 14px;
    }
}
