/* ============================================================
   NOZE-DETAIL.CSS v1 (10.06.2026)
   Cesta: /css/noze-detail.css
   ============================================================
   Vlastní galerie + nákupní box pro luxusni-noze.cz.
   Adaptace z luxusne-pera.sk (lp-detail.css v8):
   - Hnědá #5d4a37 → tmavá navy #1e3a5f
   - Responzivní layout (mobile <= 768px)
   - Tlačítko "Do košíku" (čeština)
   Aplikuje se jen na detailu produktu (kde existuje #mygallery).
   ============================================================ */

/* === SKRYJ PŮVODNÍ ROZBITÉ PRVKY === */
#mygallery,
.stepcarousel,
#dhtmlgoodies_slideshow,
.jqZoomWindow {
    display: none !important;
}

/* Skrýt "akce" overlay divy z detail.php (ř. 590-595).
   Existující screen.css je špatně pozicuje (přes thumbs).
   Zákazník vidí cenu a štítky "skladem/akce" jinde, není potřeba duplikovat. */
.akce_darek_detail,
.akce_detail,
.akce_doprava_detail {
    display: none !important;
}

.noze-original-form-hidden {
    display: none !important;
}

.noze-price-row-hidden {
    display: none !important;
}

/* Wrapper pro qty + button (desktop i mobile potřebují flex+gap) */
.noze-qty-and-buy-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ============================================================
   GALERIE - DESKTOP
   Thumbs vlevo, hlavní fotka vpravo, max 480x480
   ============================================================ */
.noze-gallery {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 20px 0 30px 0;
    align-items: flex-start;
    /* Sjednoceno s buy boxem: thumbs 78 + gap 10 + main 480 = 568px (+ borders = ~570px) */
    width: 570px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.noze-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 2px;
    order: -1;
    flex-shrink: 0;
    width: 78px;
}

.noze-gallery-thumb {
    width: 74px;
    height: 74px;
    border: 2px solid #d4dde8;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
    /* Defenzivně: skrýt jakýkoliv cizí ::before/::after overlay (např. ze screen.css) */
    position: relative;
}

.noze-gallery-thumb::before,
.noze-gallery-thumb::after {
    content: none !important;
    background-image: none !important;
    background: none !important;
}

.noze-gallery-thumb:hover {
    border-color: #0b7bd3;
}

.noze-gallery-thumb.active {
    border-color: #1e3a5f;
    border-width: 3px;
    box-shadow: 0 0 0 1px #1e3a5f inset;
}

.noze-gallery-thumb img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.noze-gallery-thumbs:empty {
    display: none;
}

.noze-gallery-main {
    width: 480px !important;
    height: 480px !important;
    max-width: 480px !important;
    min-width: 480px !important;
    flex: 0 0 480px !important;
    border: 1px solid #d4dde8;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    overflow: hidden;
    box-sizing: border-box !important;
}

.noze-gallery-main img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.15s ease;
}

.noze-gallery-main:hover img {
    transform: scale(1.03);
}

/* === Anchor pro existující overlay divy (.akce_doprava_detail aj.)
   JS je přesune do .noze-gallery-main, kde se umístí přes position: absolute. */
.noze-gallery-main {
    position: relative;
}

/* ============================================================
   NÁKUPNÍ BOX - DESKTOP
   ============================================================ */
.noze-buybox {
    background: #1e3a5f;
    color: #ffffff;
    padding: 22px 30px;
    border-radius: 10px;
    margin: 0 0 22px 0;
    box-shadow: 0 3px 14px rgba(30, 58, 95, 0.22);
    /* Sjednoceno s galerií: 570px */
    width: 570px !important;
    max-width: 570px !important;
    box-sizing: border-box !important;
}

/* --- BEZ VARIANT - cena vlevo, akce vpravo (desktop) --- */
.noze-buybox.noze-no-variant {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0 0 22px 0;
    flex-wrap: wrap;
}

.noze-buybox.noze-no-variant .noze-buybox-prices {
    margin-right: auto;
}

/* --- S VARIANTAMI - cena nahoře, akce dole (desktop) --- */
.noze-buybox.noze-has-variant {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 0 22px 0;
}

.noze-buybox.noze-has-variant .noze-buybox-prices {
    padding-bottom: 14px;
    border-bottom: 1px solid #2c4a6b;
}

.noze-buybox.noze-has-variant .noze-buybox-actions {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.noze-buybox.noze-has-variant .noze-variant-wrapper {
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 320px;
}

.noze-buybox.noze-has-variant .noze-variant-wrapper .noze-variant-select {
    width: 100%;
}

.noze-buybox.noze-has-variant .noze-qty-wrapper {
    margin-left: auto;
}

/* --- Společné prvky --- */
.noze-buybox-prices {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.noze-buybox-price-main {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    white-space: nowrap;
}

.noze-buybox-price-main .noze-price-label {
    font-size: 14px;
    font-weight: 400;
    color: #a8b6c7;
    margin-left: 4px;
}

.noze-buybox-price-small {
    font-size: 13px;
    color: #a8b6c7;
    white-space: nowrap;
}

.noze-buybox-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.noze-variant-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.noze-variant-label {
    font-size: 11px;
    color: #a8b6c7;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.noze-buybox .noze-variant-select {
    padding: 10px 12px;
    border: 1px solid #2c4a6b;
    background: #ffffff;
    color: #1e3a5f;
    border-radius: 4px;
    min-width: 180px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.noze-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.noze-qty-label {
    font-size: 13px;
    color: #a8b6c7;
}

.noze-buybox .noze-qty-input {
    width: 56px;
    padding: 10px 8px;
    border: 1px solid #2c4a6b;
    border-radius: 4px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    background: #ffffff;
    color: #1e3a5f;
    font-family: inherit;
    box-sizing: border-box;
}

.noze-buy-btn {
    background: #2e9637;
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s ease, transform 0.08s ease, box-shadow 0.2s ease;
    font-family: inherit;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.noze-buy-btn:hover {
    background: #258029;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.noze-buy-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.noze-buy-btn-icon {
    flex-shrink: 0;
    display: block;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.noze-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    cursor: zoom-out;
    padding: 30px;
}

.noze-lightbox.noze-open {
    display: flex;
}

.noze-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.noze-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    padding: 0;
}

/* ============================================================
   ===== MOBILE LAYOUT (<= 768px) =====
   ============================================================ */
@media only screen and (max-width: 768px) {

    /* GALERIE: hlavní fotka full-width, thumbs horizontálně pod (scroll) */
    .noze-gallery {
        flex-direction: column;
        gap: 8px;
        margin: 12px 0 20px 0;
        align-items: stretch;
        width: 100% !important;       /* override desktop 570px */
        max-width: 100% !important;
    }

    .noze-gallery-main {
        width: 100% !important;
        height: auto !important;
        min-width: 0 !important;       /* override desktop 480px */
        max-width: 100% !important;    /* override desktop 480px */
        aspect-ratio: 1 / 1;
        flex: 0 1 auto !important;     /* override desktop 0 0 480px */
        flex-shrink: 1;
    }

    /* Thumbs jako horizontální scroll pruh pod fotkou */
    .noze-gallery-thumbs {
        flex-direction: row;
        width: 100% !important;     /* override 78px desktop */
        max-height: none;
        overflow-y: hidden;
        overflow-x: auto;
        gap: 6px;
        padding: 2px 0 6px 0;
        order: 0; /* reset desktop order: -1 */
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .noze-gallery-thumb {
        width: 64px;
        height: 64px;
    }

    /* Skrýt scrollbar trochu (estetika) */
    .noze-gallery-thumbs::-webkit-scrollbar {
        height: 4px;
    }
    .noze-gallery-thumbs::-webkit-scrollbar-thumb {
        background: #c8d3e0;
        border-radius: 2px;
    }

    /* NÁKUPNÍ BOX: vše pod sebou, full-width */
    .noze-buybox {
        padding: 16px 18px;
        border-radius: 8px;
        margin: 0 0 18px 0;
        width: 100% !important;       /* override desktop 570px */
        max-width: 100% !important;   /* override desktop 570px */
    }

    /* Skrýt "více info" link u termínu dodání na mobilu.
       Spouští hs.htmlExpand (HighSlide overlay), který se nezalamuje
       a vyteče přes viewport. Na desktopu funguje OK, na mobilu schováno. */
    a.normal.smaller[onclick*="hs.htmlExpand"],
    a[onclick*="hs.htmlExpand"] {
        display: none !important;
    }

    /* I no-variant na mobile přejde do column (jako has-variant) */
    .noze-buybox.noze-no-variant,
    .noze-buybox.noze-has-variant {
        display: flex;
        flex-direction: column;
        gap: 14px;
        max-width: 100%;
        margin: 0 0 18px 0;
    }

    .noze-buybox.noze-no-variant .noze-buybox-prices,
    .noze-buybox.noze-has-variant .noze-buybox-prices {
        margin-right: 0;
        padding-bottom: 12px;
        border-bottom: 1px solid #2c4a6b;
    }

    .noze-buybox-price-main {
        font-size: 24px;
        white-space: normal;
    }

    /* Actions: column na mobile */
    .noze-buybox-actions,
    .noze-buybox.noze-has-variant .noze-buybox-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .noze-buybox.noze-has-variant .noze-variant-wrapper {
        max-width: 100%;
        min-width: 0;
    }

    .noze-buybox .noze-variant-select {
        width: 100%;
        min-width: 0;
        font-size: 16px; /* iOS nezoomuje při focusu pokud >= 16px */
        padding: 12px;
    }

    /* Množství + tlačítko v jednom řádku */
    .noze-qty-and-buy-wrap {
        display: flex;
        gap: 12px;
        align-items: stretch;
    }

    .noze-qty-wrapper {
        flex-shrink: 0;
    }

    .noze-buybox.noze-has-variant .noze-qty-wrapper,
    .noze-buybox.noze-no-variant .noze-qty-wrapper {
        margin-left: 0;
    }

    .noze-buybox .noze-qty-input {
        font-size: 16px; /* iOS nezoomuje při focusu pokud >= 16px */
        padding: 12px 8px;
        width: 60px;
    }

    /* Tlačítko full-width na mobile */
    .noze-buy-btn {
        flex: 1 1 auto;
        padding: 14px 20px;
        font-size: 16px;
        justify-content: center;
    }

    /* Lightbox menší padding */
    .noze-lightbox {
        padding: 10px;
    }

    .noze-lightbox-close {
        top: 12px;
        right: 16px;
        font-size: 40px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ===== MODAL "více info" - oprava wrapování textu =====
       incl_dostupnost_sk.php otvírá nějaký fixed-position popup.
       Defenzivně: cokoliv co je position:fixed nebo má modal-like
       třídu má povolit text wrap a omezit šířku. */
    body > div[style*="position: fixed"],
    body > div[style*="position:fixed"],
    body > div[id*="modal"],
    body > div[id*="popup"],
    body > div[id*="dostupnost"],
    body > div[class*="modal"],
    body > div[class*="popup"],
    body > div[class*="tooltip"] {
        max-width: 92vw !important;
        width: auto !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        padding: 16px !important;
        left: 4vw !important;
        right: 4vw !important;
    }

    body > div[style*="position: fixed"] *,
    body > div[style*="position:fixed"] *,
    body > div[id*="modal"] *,
    body > div[id*="popup"] *,
    body > div[id*="dostupnost"] *,
    body > div[class*="modal"] *,
    body > div[class*="popup"] *,
    body > div[class*="tooltip"] * {
        white-space: normal !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
    }
}
