/* =========================================
   SEKCE SNOMAT (AUTOMAT NA SNY)
   ========================================= */

body {
    background-color: #222222 !important;
}

.sekce-snomat-komplet {
    padding: 0 2vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

.snomat-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1100px;
    width: 100%;
}

/* --- ČÁST 1: AUTOMAT --- */
.snomat-pristroj-obal {
    /* ÚPLNÁ FIXACE: Žádný flex, natvrdo definovaná maximální a základní šířka */
    flex: 0 0 550px;
    width: 550px;
    max-width: 100%;
    display: flex;
    justify-content: center;
    min-height: 200px;
}

.snomat-svg-kontejner {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.snomat-svg-kontejner svg {
    width: 100%;
    height: auto;
    display: block;
}

#snomat-displej {
    position: absolute;
    top: 31%;
    left: 17%;
    width: 58%;
    height: 44%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Barlow', sans-serif;
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-weight: 700;
    color: #ffffff;
    box-sizing: border-box;
    padding: 0 10px;
}

/* --- ANIMACE ŽÁROVEK --- */
.zarovka {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.zarovka.toceni {
    animation: toceniZarovek 1s infinite;
}

#bulb-1.toceni { animation-delay: 0s; }
#bulb-2.toceni { animation-delay: 0.25s; }
#bulb-3.toceni { animation-delay: 0.5s; }
#bulb-4.toceni { animation-delay: 0.75s; }

@keyframes toceniZarovek {
    0% { opacity: 1; }
    25% { opacity: 0; }
    100% { opacity: 0; }
}

.zarovka.blikani {
    animation: blikZarovek 0.2s 5;
}

@keyframes blikZarovek {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- ČÁST 2: OVLÁDÁNÍ A TEXTY --- */
.snomat-ovladani {
    /* Zbytek prostoru dostane pravá strana, ale nesmí tlačit do Snomatu */
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    box-sizing: border-box;
    overflow: hidden; /* Zamezí tomu, aby dlouhý text měnil šířku sloupce */
}

.snomat-tlacitko-obal {
    cursor: pointer;
    width: 125px;
    position: relative;
}

.snomat-btn-img {
    width: 100%;
    height: auto;
    transition: opacity 0.1s ease, transform 0.1s ease;
}

#btn-img-off {
    display: block;
    opacity: 0;
}

#btn-img-off.aktivni {
    opacity: 1;
}

#btn-img-on {
    position: absolute;
    bottom: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
}

#btn-img-on.aktivni {
    opacity: 1;
}

.snomat-tlacitko-obal:active #btn-img-off {
    transform: scale(0.95);
}

.snomat-tlacitko-obal.zamceno {
    cursor: not-allowed;
    pointer-events: none;
}

#snomat-doprovod-text {
    font-family: 'Barlow', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--kefir-bila, #ffffff);
    margin: 0;
    line-height: 1.4;
    width: 100%;

    /* Pojistka: Text se musí přizpůsobit šířce, ne šířka textu */
    word-break: break-word;
    overflow-wrap: break-word;
}

/* --- RESPONSIVITA PRO MOBILY --- */
@media (max-width: 800px) {
    .snomat-layout {
        flex-direction: column;
        gap: 30px;
    }

    .snomat-pristroj-obal {
        flex: 0 1 auto;
        width: 100%;
    }

    .snomat-ovladani {
        width: 100%;
        align-items: center;
        text-align: center;
    }

    #snomat-displej {
        font-size: clamp(1rem, 4vw, 1.5rem);
    }
}