/* --- ZÁKLADNÍ PROMĚNNÉ --- */
:root {
    --primary-color: #2e7d32;
    --secondary-color: #4caf50;
    --dark-gray: #333;
    --border-radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Zabrání vodorovnému posunu celé stránky */
}

/* --- KONTEJNER PRODUKTU --- */
.main-wrapper {
    max-width: 1000px !important;
    margin: 20px auto;
    padding: 0 15px;
}

.product-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
}

.product-image-side {
    flex: 1 1 400px;
    background: #fff;
    max-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-side img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 20px;
}

.product-info-side {
    flex: 1 1 400px;
    padding: 30px;
}

/* --- POPOVER KOŠÍK (OPRAVA ODSOUVÁNÍ) --- */
#myPopover {
    position: fixed !important;
    top: 20px;
    right: 20px;
    width: 350px;
    background: white;
    z-index: 10000;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    border: 1px solid #ddd;
    display: none; /* Zapíná JS */
    flex-direction: column;
}

/* MINIATURA OBRÁZKU V KOŠÍKU */
.popover-item-image {
    width: 45px !important;
    height: 45px !important;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    flex-shrink: 0;
}

.popover-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 15px;
}

.popover-item-container {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* TLAČÍTKA V KOŠÍKU */
.popover-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    border-top: 1px solid #eee;
}

.popover-actions button, .popover-actions a {
    width: 100% !important;
    padding: 12px;
    font-weight: bold;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    border: none;
}

.btn-back-to-menu {
    background-color: var(--primary-color);
    color: white !important;
}

.btn-close-cart {
    background-color: #e0e0e0;
    color: #333 !important;
}

/* --- MOBILNÍ VERZE (FIX ODSOUVÁNÍ) --- */
@media (max-width: 600px) {
    #myPopover {
        top: 0 !important;
        right: 0 !important;
        left: 0 !important; /* Fixuje košík na střed a brání odsouvání */
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0;
        margin: 0 !important;
    }
    
    .main-wrapper { margin: 0; padding: 0; }
    .product-card { border-radius: 0; box-shadow: none; }
    .product-image-side { max-height: 250px; }
}