/* ПРИНУДИТЕЛЬНЫЙ СБРОС (Safari Fix) */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

:root {
    --bg: #0b0f19;
    --card: #161b28;
    --accent: #b89bb2;
    --btn-primary: #aa699d;
    --border: #2d364d;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --promo-grad: linear-gradient(135deg, #aa699d 0%, #633659 100%);
}

/* Кнопка возврата */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    gap: 20px;
}

.btn-back-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-bottom: 6px;
}

.btn-back-inline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(184, 155, 178, 0.05);
}

.btn-back-inline svg {
    color: var(--accent);
}

@media (max-width: 1000px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .btn-back-inline {
        order: -1;
        margin-bottom: 0;
    }
}

body {
    font-family: -apple-system, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

body.no-scroll { 
    overflow: hidden !important; 
    position: fixed !important; 
    width: 100% !important; 
    height: 100% !important;
}

.app-shell {
    display: flex;
    max-width: 1340px;
    margin: 40px auto;
    gap: 30px;
    padding: 0 20px;
}

.content-area {
    flex: 2;
    min-width: 0;
}

.main-header {margin-bottom: 30px;}

.badge-top {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

h1 {font-size: 2.2rem;}



/* КАРТОЧКИ */
.config-card {
    background: var(--card);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--border);
}

.config-card h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Метка Дополнительно */
.section-label {
    font-size: 22px;
    color: #ffffff;
    font-weight: 700;
    margin-top: 50px;
    margin-bottom: 20px;
}

.grid-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.product-card {
    display: flex;
    flex-direction: column;
}

.product-card input {display: none;}

.card-inner {
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer; 
    transition: 0.2s;
    text-align: center;
    background: rgba(255,255,255,0.02);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.product-card input:checked + .card-inner {
    border-color: var(--accent);
    background: rgba(184, 155, 178, 0.05);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.card-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.mini-tag {
    background: rgba(255,255,255,0.03);
    color: var(--accent);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(184, 155, 178, 0.15);
}

.card-price { 
    color: var(--text-dim); 
    font-size: 1rem; 
    display: block; 
    font-weight: 700; 
    margin-top: auto; 
    padding-top: 15px;
}

.card-time { color: var(--accent); font-size: 0.75rem; font-weight: 600; margin-top: 5px; display: block; opacity: 0.8; }



/* АКЦИОННАЯ ПЛАШКА */
.promo-card {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.promo-card .card-inner { 
    background: var(--promo-grad); 
    border: 2px solid var(--accent);
    padding: 30px;
}

.promo-badge {
    background: #fff;
    color: #aa699d;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.promo-descr {
    font-size: 0.95rem;
    margin-bottom: 15px;
    opacity: 0.9;
    max-width: 600px;
    line-height: 1.4;
}

.promo-card .card-price {
    color: #fff;
    font-size: 1.4rem;
}

.promo-link {
    color: #fff;
    font-size: 12px;
    text-decoration: underline;
    margin-top: 10px;
    opacity: 0.8;
}



/* ДОПОПЦИИ */
.options-grid-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 0px 0px 30px 0px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.check-row input {display: none;}

.check-content {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    font-size: 0.9rem;
    gap: 10px;
}

.check-row input:checked + .check-content {
    border-color: var(--accent);
    background: rgba(184, 155, 178, 0.05);
}



/* ФОРМА */
.input-field { 
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 15px; 
    border-radius: 10px;
    color: white;
    margin-bottom: 10px;
    box-sizing: border-box;
    -webkit-appearance: none;
    font-size: 16px;
}



/* ЗАМЕТКА О КАСТОМИЗАЦИИ */
.info-note {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    border-left: 2px solid var(--accent);
    padding-left: 15px;
}

.info-note strong {color: var(--text);}

#form-status {
    margin-top: 15px;
    text-align: left;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
}



/* САЙДБАР ДЕКСТОП (ЦЕНА ВСЕГДА ВИДНА) */
.sidebar {
    flex: 1;
    min-width: 340px;
}

.sidebar-sticky { 
    position: sticky; 
    top: 20px; 
    background: var(--card); 
    padding: 30px; 
    border-radius: 24px; 
    border: 1px solid var(--border);
    max-height: calc(100vh - 40px); /* Чтобы не уходило за экран */
    display: flex;
    flex-direction: column;
}

.sidebar-head {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-main-title {
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
    margin-bottom: 15px;
}

#sidebar-summary {
    overflow-y: auto; /* Прокрутка только для списка */
    flex-grow: 1; 
    margin-bottom: 15px;
    padding-right: 5px;
}

/* Стили скроллбара в сайдбаре */
#sidebar-summary::-webkit-scrollbar {width: 4px;}
#sidebar-summary::-webkit-scrollbar-track {background: transparent;}
#sidebar-summary::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.sum-subheader {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}

.sum-details-list {
    list-style: none;
    margin-bottom: 20px;
}

.sum-details-list li {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 5px;
    padding-left: 12px;
    position: relative;
}

.sum-details-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.addon-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.total-block {
    border-top: 1px solid var(--border); 
    padding-top: 20px; 
    flex-shrink: 0; /* Не сжимается, всегда внизу */
}

.total-amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
}

.btn-submit {
    width: 100%;
    background: var(--btn-primary);
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    -webkit-appearance: none;
}

.mobile-toggle-btn {display: none;}



/* ПОДСКАЗКИ */
.help-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 18px;
    background: var(--border);
    color: var(--accent);
    border-radius: 20%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
    transition: 0.2s;
}

.help-trigger:hover {
    background: var(--accent);
    color: var(--bg);
}



/* МОДАЛЬНОЕ ОКНО */
.help-modal {
    position: fixed;
    z-index: 10000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    padding: 20px;
}

.help-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.help-modal-content {
    background: var(--card);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    position: relative;
    color: var(--text);
    line-height: 1.5;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.help-modal-close {
    position: absolute;
    top: 15px; right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dim);
}

.vajno {margin-bottom:30px}


/* ПЛАВАЮЩАЯ КНОПКА */
.floating-addon-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 9998; /* Чуть ниже модалок, но выше всего остального */
    background: var(--btn-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(170, 105, 157, 0.2);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Класс видимости (управляется JS) */
.floating-addon-btn.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    animation: floating-bounce 2s infinite;
}

@keyframes floating-bounce {
    0%, 100% {transform: translateX(-50%) translateY(0);}
    50% {transform: translateX(-50%) translateY(-5px);}
}

.floating-addon-btn:hover {
    background: var(--accent);
    transform: translateX(-50%) scale(1.05);
}

@media (max-width: 1000px) {
    .floating-addon-btn {
        bottom: 90px; /* Чтобы не перекрывала кнопки внизу на мобилках */
        padding: 8px 16px;
        font-size: 11px;
    }
}



/* АУДИО */
.audio-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
    border: 1px solid transparent;
}

.audio-trigger:hover {
    background: rgba(184, 155, 178, 0.2);
    border-color: var(--accent);
    transform: scale(1.1);
}

.audio-trigger.playing {
    background: var(--accent);
    color: var(--bg);
    animation: pulse-audio 1.5s infinite;
}

@keyframes pulse-audio {
    0% {box-shadow: 0 0 0 0 rgba(184, 155, 178, 0.4);}
    70% {box-shadow: 0 0 0 8px rgba(184, 155, 178, 0);}
    100% {box-shadow: 0 0 0 0 rgba(184, 155, 178, 0);}
}

/* Фикс для родителя, чтобы иконка позиционировалась верно */
.card-inner {position: relative;}



/* СТИЛИ ДЛЯ ЦЕН В САЙДБАРЕ */
.total-amount-main {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.total-amount-secondary {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dim);
    opacity: 0.8;
}

/* Вторая кнопка */
.btn-outline {
    background: transparent !important;
    border: 2px solid var(--btn-primary) !important;
    color: var(--btn-primary) !important;
    padding: 16px !important;
}

.btn-outline:hover {background: rgba(170, 105, 157, 0.1) !important;}

@media (max-width: 1000px) {
    .total-amount-main {font-size: 1.5rem !important;}
    .total-amount-secondary {font-size: 1rem !important;}
    .btn-submit {
        padding: 12px 15px !important;
        font-size: 14px !important;
    }
}



/* МОБИЛКА */
@media (max-width: 1000px) {
    .app-shell {
        flex-direction: column;
        padding-bottom: 140px;
        margin-top: 20px;
    }
    .grid-options, .options-grid-main {grid-template-columns: 1fr;}
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        min-width: 100%;
    }
    .sidebar-sticky {
        border-radius: 25px 25px 0 0;
        border: none;
        border-top: 1px solid var(--border);
        padding: 12px 20px !important;
        background: var(--card);
        max-height: 80vh;
    }
    .mobile-toggle-btn {
        display: flex;
        position: absolute;
        top: -45px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--card);
        border: 1px solid var(--accent);
        color: var(--accent);
        padding: 10px 24px;
        border-radius: 40px;
        font-size: 14px;
        font-weight: 700;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }
    .sidebar-head, #sidebar-summary {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: all 0.4s ease;
        visibility: hidden;
        margin: 0 !important;
        padding: 0 !important;
        border: none;
    }
    .sidebar.is-open .sidebar-head {
        margin: 10px 0 !important;
        opacity: 1;
        visibility: visible;
        max-height: 30px;
        border-bottom: 1px solid var(--border);
    }
    .sidebar.is-open #sidebar-summary {
        padding-bottom: 15px !important;
        opacity: 1;
        visibility: visible;
        max-height: 60vh;
        overflow-y: auto;
    }
    .total-block {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 0;
        margin: 0;
        gap: 10px;
    }
    .total-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .total-amount {
        font-size: 1.4rem !important;
        line-height: 1;
    }
    .btn-submit {
        width: auto;
        margin: 0 !important;
        padding: 12px 20px;
        font-size: 15px;
    }
}