/* ==========================================================================
   STYLING PRODUKTOVÉ STRÁNKY (styleKonkretniKryt.css)
   ========================================================================== */

* {
    font-family: 'Caladea', serif !important;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --font-main: 'Caladea', serif;
    --gradient-start: #7E0089;
    --gradient-end: #C86400;
}

body {
    font-family: var(--font-main);
    background-color: #fff;
}

.product-page-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Hlavní rozvržení: Galerie vlevo, konfigurátor vpravo */
.product-main-row {
    display: flex;
    gap: 60px;
    margin-bottom: 60px;
}

.product-gallery {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-config {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- Levá strana: Obrázky --- */
.main-image-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #dbdbdb;
    border-radius: 4px;
    overflow: hidden;
}

.main-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.thumb-card {
    aspect-ratio: 1.3 / 1;
    background-color: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all ease-in-out 0.2s;
}

.thumb-card:hover{
    scale: 1.07;
}

.thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Pravá strana: Texty a nadpisy --- */
.product-main-title {
    font-size: 46px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #000;
}

.phone-selector-wrapper label {
    display: block;
    font-size: 22px; 
    font-weight: 700; 
    margin-bottom: 15px;
    color: #000;
}

/* --- 1. DROPDOWN --- */
.select-styled-container {
    position: relative;
    width: 100%;
}

.select-styled-container select {
    width: 100%; 
    padding: 15px;
    background: linear-gradient(#fff, #fff) padding-box, 
                linear-gradient(90deg, var(--gradient-start), var(--gradient-end)) border-box;
    border-radius: 20px;
    border: 3px solid transparent;
    font-size: 20px; 
    font-weight: 700;
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    color: #000;
    font-family: var(--font-main);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

/* Jemný hover efekt při najetí na dropdown */
.select-styled-container select:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(126, 0, 137, 0.1);
}

/* Stylování vlastních popisků skupin a možností uvnitř dropdownu */
.select-styled-container select optgroup {
    font-weight: 700;
    font-style: normal;
    color: var(--gradient-start);
    background: #fff;
}

.select-styled-container select option {
    font-weight: 400;
    color: #000;
    background: #fff;
    padding: 10px;
}

.select-arrow {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    /* Šipka dostane barvu konce gradientu, aby ladila */
    color: var(--gradient-end); 
    pointer-events: none; /* Kliknutí propadne skrz na select */
    transition: transform 0.2s ease;
}

/* Malý bonus: Když je kontejner aktivní/hover, šipka může jemně reagovat */
.select-styled-container:hover .select-arrow {
    color: var(--gradient-start);
}

/* --- 2. TLAČÍTKA S PŘÍSLUŠENSTVÍM --- */
.addons-container {
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px;
    margin-top: 35px;
    margin-bottom: 35px;
}

.addon-box {
    
    background: linear-gradient(#fff, #fff) padding-box, 
                linear-gradient(90deg, var(--gradient-start), var(--gradient-end)) border-box;
    border: 3px solid transparent;
    border-radius: 15px;
    padding: 20px 10px; 
    cursor: pointer;
    font-family: var(--font-main);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: space-between; 
    gap: 8px;
    transition: all 0.3s ease, color 0.2s ease;
}

.addon-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    color: #000;
}

.addon-price {
    font-size: 20px;
    font-weight: 700;
    color: #000;
}

.addon-box.active {
    background: linear-gradient(rgba(126, 0, 137, 0.1), rgba(126, 0, 137, 0.1)) padding-box, 
                linear-gradient(90deg, var(--gradient-start), var(--gradient-end)) border-box;
    color: #fff;
}

.addon-box.active .addon-title,
.addon-box.active .addon-price {
    color: #fff;
}

/* --- 3. CENA --- */
.price-display-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.price-label {
    display: block;
    font-family: var(--font-main);
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
}

#product-total-price {
    font-size: 32px; 
    font-weight: bold; 
    padding: 10px 40px;
    background: linear-gradient(#fff, #fff) padding-box, 
                linear-gradient(90deg, var(--gradient-start), var(--gradient-end)) border-box;
    border: 3px solid transparent; 
    border-radius: 20px;
    font-family: var(--font-main);
    display: inline-block;
}

/* --- 4. TLAČÍTKO KOUPIT --- */
.btn-buy-gradient {
    width: 100%; 
    padding: 20px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    color: #fff; 
    border: none; 
    border-radius: 15px;
    font-size: 24px; 
    cursor: pointer;
    font-family: var(--font-main);
    transition: transform 0.2s, box-shadow 0.2s, text-shadow 0.3s;
}

.btn-buy-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(126, 0, 137, 0.2);      
}

/* ==========================================================================
   ČISTÝ A SOUDRŽNÝ SLIDER S DESIGNEM Z KOLEKCE
   ========================================================================== */
.product-slider-section {
    margin-top: 60px;
    width: 100%;
}

/* Nový obal, díky kterému šipky drží tam, kde mají */
.slider-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* TVOJE ŠIPKY Z SOUBORU KOLEKCE */
.coll-nav-btn {
    position: absolute;
    top: 50%; /* Posune šipku do půlky výšky */
    transform: translateY(-50%); /* Přesné vertikální vycentrování */
    z-index: 5;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s ease;
}

.coll-nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #7E0089; /* Při najetí jemně zafialoví šipka */
}

/* Efekt kliknutí z kolekce */
.coll-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.coll-nav-btn.prev { left: 5px; }
.coll-nav-btn.next { right: 5px; }

/* Kontejnery pro samotné karty */
.slider-track-container {
    width: 100%;
    overflow-x: auto; 
    scroll-behavior: smooth; 
    scrollbar-width: none; 
    scroll-snap-type: x mandatory;
    padding: 10px 0;
}

.slider-track-container::-webkit-scrollbar {
    display: none;
}

.slider-track {
    display: flex;
    gap: 20px;
    width: max-content; 
    /* Přidáme mírné odsazení zleva a zprava, aby první a poslední karta nezajížděly pod šipky */
    padding: 0 50px; 
}

.slider-item-card {
    min-width: 180px;
    max-width: 180px;
    aspect-ratio: 1 / 1.3;
    background-color: #dbdbdb;
    border-radius: 15px;
    flex-shrink: 0; 
    scroll-snap-align: start;
    scroll-margin-left: 50px; /* Zarovná se přesně s paddingem trati */
    overflow: hidden;
}

/* NOVÝ STYL: Zajistí, aby obrázek perfektně vyplnil celou kartu */
.slider-item-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Obrázek vyplní obdélník a nedeformuje se (případně ořízne) */
    display: block;
    transition: transform 0.3s ease; /* Volitelné: Jemný zoom efekt, když na kartu najedeš */
}

/* Volitelné: Když zákazník přejede myší nad kartou, obrázek se mírně přiblíží */
.slider-item-card:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   CSS PRO MODÁLNÍ OKNO (PŘEVZATO Z KONFIGURÁTORU)
   ========================================================================== */

/* Pozadí přes celou obrazovku */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Schované defaultně, JS přepíná na 'flex' */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px); /* Rozmaže pozadí za pop-upem */
}

/* Samotné bílé okno */
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 95%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: popIn 0.3s ease-out; /* Plynulý náběh zmenšeného okna */
}

/* Kulatá ikonka s fajfkou */
.modal-icon {
    width: 60px; height: 60px;
    background: linear-gradient(90deg, #7E0089, #C86400);
    color: white;
    font-size: 30px; 
    font-weight: bold; 
    font-family: var(--font-main, 'Caladea', serif);
    line-height: 60px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.success-icon {
    background: linear-gradient(90deg, #7E0089, #C86400) !important;
}

/* Hlavní velký text */
.modal-text {
    font-family: var(--font-main, 'Caladea', serif);
    font-size: 32px;
    margin-bottom: 20px;
    color: #000;
}

/* Menší doprovodný text */
.modal-textP {
    font-family: var(--font-main, 'Caladea', serif);
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

/* Společný kontejner pro obě tlačítka */
.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* Základní styl tlačítek v modálu */
.modal-btn {
    margin-top: 10px;
    padding: 15px 25px;
    font-size: 24px; 
    border-radius: 15px;
    border: none;
    cursor: pointer;
    font-family: var(--font-main, 'Caladea', serif);
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1; /* Zajistí naprosto stejnou šířku obou tlačítek */
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Tlačítko: Pokračovat v nákupu (šedé) */
.btn-continue { 
    background: #eee; 
    color: #000000; 
}

.btn-continue:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(77, 77, 77, 0.2);
}

/* Tlačítko: Přejít do košíku (gradientní) */
.btn-cart-style { 
    background: linear-gradient(90deg, var(--gradient-start, #7E0089), var(--gradient-end, #C86400)); 
    color: #fff; 
}

.btn-cart-style:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(126, 0, 137, 0.2);
}

/* Úprava pro lightbox modál */
#image-lightbox-modal {
    cursor: zoom-out;
}
#lightbox-target-image {
    cursor: default; /* Obrázek samotný neproklikává */
}

/* Animace vyskočení okna */
@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responzivita pro telefony */
@media (max-width: 480px) {
    .modal-buttons {
        flex-direction: column; /* Na mobilech se tlačítka dají pod sebe */
        gap: 10px;
    }
    .modal-btn {
        width: 100%;
    }
}

/* Responzivita pro mobily */
@media (max-width: 768px) {
    .product-main-row {
        flex-direction: column;
        gap: 30px;
    }

    .product-main-title {
        font-size: 36px;
        text-align: center;
        margin-bottom: 20px;
    }

    .addons-container {
        grid-template-columns: repeat(1, 1fr);
        gap: 15px;
    }

    .addon-box {
        min-height: auto;
        height: 90px;
        flex-direction: row; /* Prvky jdou na mobilu vedle sebe */
        justify-content: space-between;
        align-items: center;
        padding: 0 30px;
    }
    
    .slider-track-container .slider-item-card {
        display: block !important;
    }
}
