/* ==========================================================================
   STYLING PRO STRÁNKU KOŠÍKU (styleKosik.css)
   ========================================================================== */

* {
    font-family: 'Caladea', serif !important;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
}

hr {
    border: none; 
    height: 1px; 
    background-color: #a0a0a0; 
    margin: 20px 0; 
}

/* Základní obal košíku */
.cart-wrapper { 
    max-width: 1000px; 
    margin: 40px auto; 
    padding: 0 20px; 
    font-family: var(--font-main);
}

.cart-title { 
    text-align: center; 
    font-size: 32px; 
    font-family: var(--font-main);
}

/* Položka v košíku */
.cart-item { 
    position: relative;
    display: flex; 
    align-items: center; 
    padding: 20px 0; 
    border-bottom: 1px solid #a0a0a0; 
    justify-content: flex-start; 
    gap: 30px; 
    font-family: var(--font-main);
}

.cart-item img { 
    width: 60px; 
    height: auto; 
    object-fit: contain; 
    border-radius: 8px; 
}

.cart-duo-images {
    display: flex;
    gap: 5px;
    align-items: center;
}

.cart-img-small {
    width: 60px; 
    height: auto;
    border-radius: 5px;
}

.item-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1; 
}

.item-phone {
    font-size: 22px; 
    font-weight: bold;
    margin-bottom: 5px;
}

.item-accessories {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Seznam doplňků */
.item-accessories-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accessory-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px; 
    color: #444;
    cursor: pointer;
}

.accessory-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #7E0089; 
    cursor: pointer;
}

/* Tlačítka u položky */
.view-preview-btn {
    background: none;
    border: none;
    color: #7E0089; 
    text-decoration: underline;
    font-family: var(--font-main);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-top: 8px;
    width: fit-content;
    transition: color 0.2s;
}

.view-preview-btn:hover {
    color: #C86400; 
}

.item-price {
    font-size: 24px; 
    margin-left: auto; 
    font-weight: bold;
    white-space: nowrap;
}

.delete-item-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s, transform 0.2s;
    margin-left: 20px; 
    font-weight: bold;
    min-width: 40px; 
}

.delete-kolekce-btn{
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s, transform 0.2s;
    margin-left: 20px; 
    font-weight: bold;
    min-width: 40px; 
}

.delete-item-btn:hover {
    color: #C86400; 
    transform: scale(1.2);
}

.delete-kolekce-btn:hover {
    color: #C86400; 
    transform: scale(1.2);
}

.promo-code-container {
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.promo-input-group input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    font-size: 16px;
    font-family: var(--font-main);
    border: 1px solid #a0a0a0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.promo-input-group input[type="text"]:focus {
    border-color: #7E0089;
}

.promo-input-group button {
    padding: 10px 20px;
    background: #7E0089;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-family: var(--font-main);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.promo-input-group button:hover {
    background: #600069;
}

/*.promo-input-group button:disabled {
    background: #ccc;
    cursor: not-allowed;
}*/

.promo-message {
    font-size: 14px;
    font-weight: bold;
}

.promo-message.success {
    color: #2e7d32;
}

.promo-message.error {
    color: #d32f2f;
}

.discount-info-text {
    margin-top: 5px;
}

/* Finální shrnutí a Doprava */
.total-summary { 
    text-align: right; 
    font-size: 24px; 
    font-weight: bold; 
    margin: 20px 0; 
    font-family: var(--font-main);
}

.shipping-info { 
    width: 100%; 
    text-align: left; 
    margin: 20px 0 30px 0;
}

#shipping-text {
    font-family: var(--font-main);
    margin-bottom: 10px;
    display: block; 
}

.shipping-bar-container {
    width: 100%; 
    height: 12px; 
    background: #eee; 
    border-radius: 6px; 
    overflow: hidden; 
    margin-top: 10px; 
}

.shipping-bar-fill { 
    height: 100%; 
    width: 0%; 
    background: linear-gradient(90deg, #7E0089, #C86400); 
    transition: width 0.6s ease-out; 
    border-radius: 7px;
}

/* Spodní řada tlačítek */
.cart-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
    margin-top: 30px;
}

.cart-buttons-row {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 100%; 
    margin-top: 20px; 
    margin-bottom: 40px;
    gap: 20px;
}

.gradient-btn-checkout {
    display: block; 
    width: fit-content; 
    padding: 15px 50px;
    background: linear-gradient(90deg, #7E0089, #C86400);
    color: white; 
    text-decoration: none; 
    border-radius: 15px; 
    font-size: 24px;
    font-family: var(--font-main);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.gradient-btn-checkout:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(126, 0, 137, 0.2);
}

.btn-continue-shopping {
    display: block;
    width: fit-content;
    padding: 10px 0; 
    color: #555; 
    text-decoration: none;
    font-size: 22px;
    font-family: var(--font-main);
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent; 
    white-space: nowrap;
}

.btn-continue-shopping:hover {
    color: #7E0089; 
    border-bottom: 1px solid #7E0089; 
    transform: translateX(-5px); 
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(1); 
    pointer-events: none; 
}

/* Upsell sekce */
.upsell-section {
    margin-top: 40px;
}

.upsell-section h2 {
    font-family: var(--font-main);
    font-size: 24px;
    margin-bottom: 15px;
}

.upsell-grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 15px; 
    margin-top: 20px; 
}

.upsell-item { 
    aspect-ratio: 1/1; 
    background: #eee; 
    border-radius: 10px; 
    transition: transform 0.2s; 
}

.upsell-item:hover { 
    transform: scale(1.05); 
}

/* Velký náhled (Modál) */
#cart-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none; 
    justify-content: center;
    align-items: center;
}

.preview-modal-content {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: transparent;
}

.cart-preview-full {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px; 
    width: 100%;
    height: 100%;
    padding: 20px;
}

.cart-preview-full img {
    height: 80vh !important; 
    width: auto !important;
    max-width: 45vw;
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    object-fit: contain;
    background: white;
}

.cart-preview-full img:only-child {
    max-width: 90vw;
}

.close-button {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 60px;
    cursor: pointer;
    z-index: 10002;
    color: #fff;
    line-height: 1;
}

.close-button:hover {
    color: #7E0089;
}


/* ==========================================================================
   RESPONZIVNÍ STYLY PRO MOBILY A TABLETY (max-width: 768px)
   ========================================================================== */
/* ==========================================================================
   RESPONZIVNÍ STYLY PRO MOBILY A TABLETY (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    
    .cart-wrapper {
        margin: 20px auto;
        padding: 0 15px;
    }

    .cart-title {
        font-size: 26px;
    }

    /* DRŽÍME ŘÁDEK: Žádný sloupec, žádné centrování na střed */
    .cart-item {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        text-align: left !important;
        gap: 12px !important;
        padding: 15px 0 !important;
    }

    /* Vizuální kontejner (obrázky) zůstává vlevo */
    .cart-item-visuals {
        width: auto !important;
        display: flex;
        justify-content: flex-start;
        flex-shrink: 0 !important;
    }
    
    /* Dynamické zmenšení obrázků na mobilu */
    .cart-item img, .cart-img-small { 
        width: clamp(45px, 10vw, 55px) !important;
    }

    /* Detaily produktu - zmenšení písma a zarovnání vlevo */
    .item-details {
        width: auto !important;
        align-items: flex-start !important;
        min-width: 0 !important;
        flex: 1 !important;
    }

    .item-phone {
        font-size: clamp(14px, 4vw, 18px) !important;
        margin-bottom: 2px;
    }

    .item-material {
        font-size: clamp(11px, 3.2vw, 14px) !important;
    }

    /* Seznam doplňků srovnaný vlevo */
    .item-accessories-list {
        align-items: flex-start !important;
        width: 100%;
        gap: 4px !important;
    }

    .accessory-checkbox-item {
        justify-content: flex-start !important;
        font-size: clamp(11px, 3.2vw, 14px) !important;
    }
    
    .accessory-checkbox-item input[type="checkbox"] {
        width: 14px !important;
        height: 14px !important;
    }
    
    .view-preview-btn {
        font-size: clamp(11px, 3vw, 13px) !important;
        margin-top: 4px !important;
    }

    /* Cena v řadě za textem, fluidní velikost */
    .item-price {
        margin-left: auto !important; /* Odstrčí cenu k pravému okraji před křížek */
        font-size: clamp(14px, 4vw, 18px) !important;
        width: auto !important;
        text-align: right !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    /* Smazat křížek zůstává na konci řádku za cenou */
    .delete-item-btn {
        position: static !important; /* Zrušíme absolutní pozici z rohu */
        margin-left: 5px !important;
        padding: 5px !important;
        font-size: clamp(18px, 4.5vw, 22px) !important;
        flex-shrink: 0 !important;
        min-width: auto !important;
    }

    .delete-kolekce-btn{
        position: static !important; /* Zrušíme absolutní pozici z rohu */
        margin-left: 5px !important;
        padding: 5px !important;
        font-size: clamp(18px, 4.5vw, 22px) !important;
        flex-shrink: 0 !important;
        min-width: auto !important;
    }

    /* Spodní shrnutí ceny a tlačítek */
    .cart-footer {
        align-items: flex-end;
    }

    .total-summary {
        text-align: right;
        font-size: 22px;
        width: 100%;
    }
    
    .shipping-info {
        text-align: right; 
    }

    .cart-buttons-row {
        flex-direction: column-reverse;
        gap: 15px;
        margin-bottom: 30px;
    }

    .gradient-btn-checkout {
        width: 100%;
        font-size: 20px;
        padding: 15px 20px;
    }

    .btn-continue-shopping {
        width: 100%;
        text-align: center;
        font-size: 18px;
        display: flex;
        justify-content: center;
    }

    /* Upsell mřížka */
    .upsell-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Modál */
    .cart-preview-full {
        flex-direction: column;
        gap: 15px;
    }

    .cart-preview-full img {
        max-width: 85vw;
        height: auto !important;
        max-height: 40vh;
    }
}