/* =========================================================
   ARCHNES — Špeciálna ponuka (skladový výpredaj ARCH 2.0)
   Popup po odsúhlasení cookies + re-open tab + konfigurátor badge
   Všetko je prefixované .so- aby to nekolidovalo so zvyškom webu.
   ========================================================= */

/* ---------- Overlay ---------- */
.so-overlay {
    position: fixed;
    inset: 0;
    z-index: 380;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: rgba(16, 12, 10, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    overflow-y: auto;
}

.so-overlay.is-open {
    display: flex;
}

/* ---------- Modal ---------- */
/* grid-template-rows: minmax(0, 1fr) je nutné — bez neho riadok nezmenší
   pod svoju prirodzenú výšku, .so-content sa nikdy nezroluje a CTA sa oreže. */
.so-modal {
    position: relative;
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    width: 100%;
    max-width: 960px;
    max-height: calc(100dvh - 48px);
    background: linear-gradient(180deg, var(--Dark-Brown) 0%, #231714 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

/* Dialóg je fokusovateľný kvôli čítačkám, ale nikdy nemá kresliť prstenec */
.so-modal:focus,
.so-modal:focus-visible { outline: none; }

/* Modrý UA prstenec preč. Klávesnica dostane namiesto neho oranžový,
   myš a programový fokus nedostanú nič (:focus-visible sa neuplatní). */
.so-overlay button:focus,
.so-overlay input:focus,
.so-overlay a:focus,
.so-tab:focus { outline: none; }

.so-overlay button:focus-visible,
.so-overlay a:focus-visible,
.so-tab:focus-visible {
    outline: 2px solid var(--Orange);
    outline-offset: 3px;
}

.so-overlay input:focus-visible {
    outline: none;
    border-color: var(--Orange);
}

/* ---------- Close ---------- */
/* padding: 0 je nutné — globálne pravidlo webu dáva tlačidlám padding 18px 38px,
   ktorý by pretlačil šírku na 76px a spravil z krížika ovál. */
.so-overlay .so-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 40px;
    height: 40px;
    min-width: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(16, 12, 10, 0.75);
    color: var(--Beige);
    font-size: 18px;
    line-height: 1;
    cursor: none;
    transition: all 0.25s ease;
}

.so-overlay .so-close:hover {
    background: var(--Orange);
    color: var(--White);
    transform: rotate(90deg);
}

/* ---------- Ľavý vizuál ---------- */
.so-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    background:
        radial-gradient(120% 90% at 50% 15%, rgba(249, 86, 27, 0.16) 0%, rgba(0, 0, 0, 0) 62%),
        linear-gradient(180deg, #191110 0%, #0F0B09 100%);
    border-right: 1px solid rgba(249, 86, 27, 0.14);
}

.so-visual-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center 42%;
    padding: 34px 24px 96px;
    pointer-events: none;
}

.so-swatches {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    background: rgba(16, 12, 10, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(238, 229, 218, 0.1);
    border-radius: 12px;
}

.so-swatch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--Beige);
}

.so-swatch i {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid rgba(238, 229, 218, 0.25);
}

.so-swatch i.so-dark-oak  { background: linear-gradient(135deg, #5A3C25 0%, #3A2415 100%); }
.so-swatch i.so-nat-oak   { background: linear-gradient(135deg, #C29A6B 0%, #9A7448 100%); }
.so-swatch i.so-black     { background: linear-gradient(135deg, #2A2422 0%, #100C0A 100%); }

/* ---------- Pravý obsah ---------- */
.so-content {
    padding: 40px 40px 36px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(249, 86, 27, 0.5) transparent;
}

.so-content::-webkit-scrollbar { width: 6px; }
.so-content::-webkit-scrollbar-thumb {
    background: rgba(249, 86, 27, 0.5);
    border-radius: 3px;
}

.so-dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--Orange);
}

.so-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--Orange);
    animation: so-pulse 2s ease-out infinite;
}

@keyframes so-pulse {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Nadpis. padding-right drží text mimo krížika v pravom hornom rohu. */
.so-title {
    margin: 0 0 16px;
    padding-right: 44px;
    color: var(--White);
    font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.015em;
}

/* „Výpredaj skladu." — nesie celú akciu, preto oranžová a na samostatnom riadku */
.so-title-accent {
    display: block;
    color: var(--Orange);
}

.so-title-main {
    display: block;
    color: var(--White);
}

.so-lead {
    margin: 0 0 22px;
    color: var(--Beige);
    font-size: 15px;
    line-height: 1.7;
    opacity: 0.85;
}

.so-lead b { color: var(--White); font-weight: 600; }

/* Zoznam benefitov */
.so-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
}

.so-list li {
    position: relative;
    padding-left: 24px;
    color: var(--Beige);
    font-size: 14px;
    line-height: 1.5;
}

/* Holá fajka bez krúžku */
.so-list li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 5px;
    width: 6px;
    height: 11px;
    border: solid var(--Orange);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ---------- Cena ---------- */
.so-price {
    margin-bottom: 24px;
    padding: 20px 22px;
    border: 1px solid rgba(249, 86, 27, 0.22);
    border-radius: 14px;
    background: rgba(16, 12, 10, 0.45);
}

.so-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.so-price-row + .so-price-row { margin-top: 8px; }

.so-price-label {
    color: var(--Dark-Grey);
    font-size: 13px;
    font-weight: 500;
}

.so-price-old {
    color: var(--Dark-Grey);
    font-size: 15px;
    font-weight: 500;
    text-decoration: line-through;
    text-decoration-color: var(--Orange);
    text-decoration-thickness: 1.5px;
}

.so-price-row.main .so-price-label {
    color: var(--Beige);
    font-size: 14px;
    font-weight: 600;
}

.so-price-new {
    color: var(--White);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.so-price-sub {
    color: var(--Dark-Grey);
    font-size: 13px;
    font-weight: 500;
}

.so-save {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 14px;
    border-radius: 8px;
    background: var(--Orange);
    color: var(--White);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ---------- Akcie ---------- */
.so-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.so-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 20px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: none;
    transition: all 0.25s ease;
}

.so-btn.primary {
    background: var(--Orange);
    border-color: var(--Orange);
    color: var(--White);
}

.so-btn.primary:hover {
    background: var(--Beige);
    border-color: var(--Beige);
    color: var(--Orange);
}

.so-btn.secondary {
    background: transparent;
    border-color: rgba(238, 229, 218, 0.3);
    color: var(--Beige);
}

.so-btn.secondary:hover {
    border-color: var(--Orange);
    color: var(--Orange);
}

.so-btn[disabled] {
    opacity: 0.55;
    pointer-events: none;
}

.so-microcopy {
    margin: 14px 0 0;
    color: var(--Dark-Grey);
    font-size: 12.5px;
    line-height: 1.6;
    text-align: center;
}

.so-microcopy a { color: var(--Orange); text-decoration: none; }
.so-microcopy a:hover { text-decoration: underline; }

.so-dismiss {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 6px;
    background: none;
    border: none;
    color: var(--Dark-Grey);
    font-family: inherit;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: none;
    transition: color 0.25s ease;
}

.so-dismiss:hover { color: var(--Beige); }

/* ---------- Formulár ---------- */
.so-form { display: none; }
.so-form.is-active { display: block; }

.so-form-title {
    margin: 0 0 4px;
    padding-right: 44px;
    color: var(--White);
    font-size: 17px;
    font-weight: 700;
}

.so-form-note {
    margin: 0 0 18px;
    padding-right: 44px;
    color: var(--Dark-Grey);
    font-size: 13px;
    line-height: 1.6;
}

.so-field { margin-bottom: 12px; }

.so-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--Beige);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.so-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(238, 229, 218, 0.2);
    border-radius: 10px;
    background: rgba(16, 12, 10, 0.5);
    color: var(--White);
    font-family: inherit;
    font-size: 15px;
    cursor: none;
    transition: all 0.25s ease;
}

.so-field input::placeholder { color: rgba(168, 158, 146, 0.6); }

.so-field input:focus {
    outline: none;
    border-color: var(--Orange);
    background: rgba(16, 12, 10, 0.75);
}

.so-field input.has-error {
    border-color: #E23D2E;
    background: rgba(226, 61, 46, 0.08);
}

.so-field-error {
    display: none;
    margin-top: 5px;
    color: #FF8A7A;
    font-size: 12px;
}

.so-field input.has-error ~ .so-field-error { display: block; }

.so-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* GDPR checkbox */
.so-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 18px;
}

.so-consent input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.so-consent label {
    position: relative;
    padding-left: 28px;
    color: var(--Beige);
    font-size: 12.5px;
    line-height: 1.6;
    cursor: none;
    user-select: none;
}

.so-consent label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1px;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(238, 229, 218, 0.35);
    border-radius: 5px;
    background: rgba(16, 12, 10, 0.5);
    transition: all 0.25s ease;
}

.so-consent label::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 5px;
    width: 5px;
    height: 9px;
    border: solid var(--White);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.so-consent input:checked + label::before {
    background: var(--Orange);
    border-color: var(--Orange);
}

.so-consent input:checked + label::after { opacity: 1; }

.so-consent.has-error label::before { border-color: #E23D2E; }

.so-consent label a { color: var(--Orange); text-decoration: none; }
.so-consent label a:hover { text-decoration: underline; }

.so-form-buttons {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
}

/* Chybová hláška odoslania */
.so-error {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(226, 61, 46, 0.4);
    background: rgba(226, 61, 46, 0.1);
    color: #FF8A7A;
    font-size: 13px;
    line-height: 1.6;
}

.so-error.is-visible { display: block; }

/* ---------- Poďakovanie ---------- */
.so-success {
    display: none;
    text-align: center;
    padding: 20px 0 6px;
}

.so-success.is-active { display: block; }

.so-success-mark {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--Orange);
    background: rgba(249, 86, 27, 0.12);
}

.so-success-mark::after {
    content: '';
    width: 12px;
    height: 22px;
    margin-top: -5px;
    border: solid var(--Orange);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.so-success h3 {
    margin: 0 0 10px;
    color: var(--White);
    font-size: 22px;
    font-weight: 700;
}

.so-success p {
    margin: 0 0 8px;
    color: var(--Beige);
    font-size: 14.5px;
    line-height: 1.7;
    opacity: 0.85;
}

.so-success .so-btn { margin-top: 20px; }

/* ---------- Re-open pútač (po zavretí) — dole na stred ---------- */
.so-tab {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 190;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    border: none;
    border-radius: 100px;
    background: var(--Orange);
    color: var(--White);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    cursor: none;
    /* translate drží pútač na strede aj počas hover efektu */
    transform: translateX(-50%);
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.so-tab.is-visible { display: flex; }

.so-tab:hover {
    background: var(--White);
    color: var(--Orange);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

.so-tab .so-dot { background: var(--White); }
.so-tab:hover .so-dot { background: var(--Orange); }
.so-tab .so-dot::after { border-color: currentColor; }

/* ---------- Skladový banner v konfigurátore ---------- */
.section-config-3d .so-stock-banner {
    display: none;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid rgba(249, 86, 27, 0.35);
    border-left: 3px solid var(--Orange);
    border-radius: 10px;
    background: rgba(249, 86, 27, 0.08);
    text-align: left;
}

.section-config-3d .so-stock-banner.is-visible { display: block; }

.section-config-3d .so-stock-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--Orange);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-config-3d .so-stock-text {
    margin: 0 0 12px;
    color: var(--Beige);
    font-size: 13px;
    line-height: 1.55;
}

.section-config-3d .so-stock-text b {
    color: var(--White);
    font-weight: 700;
}

.section-config-3d .so-stock-text s {
    color: var(--Dark-Grey);
    text-decoration-color: var(--Orange);
}

.section-config-3d .so-stock-btn {
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 8px;
    background: var(--Orange);
    color: var(--White);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: none;
    transition: all 0.25s ease;
}

.section-config-3d .so-stock-btn:hover {
    background: var(--Beige);
    color: var(--Orange);
}

/* ---------- Responzívne ---------- */
@media only screen and (max-width: 900px) {
    .so-overlay { padding: 0; align-items: flex-end; }

    /* Vizuál má pevnú výšku, obsah dostane zvyšok a roluje sa v sebe. */
    .so-modal {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        max-width: 100%;
        max-height: 94dvh;
        border-radius: 18px 18px 0 0;
    }

    /* Na mobile je vertikálny priestor drahý: obrázok dostane pevný nízky pás
       a vzorkovník ide pod neho v normálnom toku, nie cez obrázok. */
    .so-visual {
        display: block;
        padding: 14px 16px 16px;
        border-right: none;
        border-bottom: 1px solid rgba(249, 86, 27, 0.14);
    }

    .so-visual-img {
        position: static;
        display: block;
        width: 100%;
        height: 128px;
        padding: 0;
        margin-bottom: 12px;
        object-fit: contain;
        object-position: center center;
    }

    .so-swatches {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 16px;
        padding: 10px 14px;
        margin-right: 46px; /* miesto pre krížik */
    }

    .so-swatch { font-size: 12.5px; }

    .so-content { padding: 26px 22px 30px; }

    .so-list { grid-template-columns: 1fr; gap: 8px; }

    .so-price { padding: 16px 18px; }
    .so-price-new { font-size: 26px; }

    .so-overlay .so-close {
        top: 12px;
        right: 12px;
        background: rgba(16, 12, 10, 0.85);
    }

    .so-title, .so-form-title, .so-form-note { padding-right: 0; }

    .so-tab {
        bottom: 18px;
        padding: 11px 18px;
        font-size: 12.5px;
    }
}

@media only screen and (max-width: 480px) {
    .so-field-row { grid-template-columns: 1fr; }
    .so-form-buttons { grid-template-columns: 1fr; }
    .so-visual-img { height: 108px; }
}

/* Používatelia s obmedzením pohybu */
@media (prefers-reduced-motion: reduce) {
    .so-dot::after { animation: none; }
    .so-close:hover { transform: none; }
}
