/* Zajištění nulových okrajů pro html a body a plné pokrytí viewportu */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: sans-serif; /* Základní font */
    background-color: #f4f4f4; /* Světle šedé pozadí */
}

/* Hlavní kontejner formuláře */
.container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 300px; /* Zmenšená maximální šířka */
    width: 90%; /* Responzivní šířka */
    margin: 10px auto 5px auto; 
    position: relative; 
    z-index: 5; 
}

/* Styly pro zarovnání tlačítek na střed */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    align-items: center; 
}
.button-container button,
.button-container a.back-button {
    width: 100%; 
    max-width: 300px; 
}

/* Styly pro univerzální dialog */
.custom-dialog {
    display: none; 
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1001; 
    text-align: center;
    max-width: 300px;
    width: 60%;
}

.custom-dialog p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #333;
}

/* Styl pro smajlíka v dialogu */
.dialog-emoji {
    font-size: 3em; 
    margin-top: 10px;
    display: block; 
}

/* Animace pro smajlíka */
.dialog-emoji.pulsing {
    animation: pulse 0.5s ease-in-out forwards;
}

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.custom-dialog-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.custom-dialog-actions button {
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto; 
}

.custom-dialog-actions button.yes { background-color: #28a745; color: white; border: none; }
.custom-dialog-actions button.yes:hover { background-color: #218838; }
.custom-dialog-actions button.no { background-color: #dc3545; color: white; border: none; }
.custom-dialog-actions button.no:hover { background-color: #c82333; }

/* Overlay */
.dialog-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
    z-index: 1000; 
}

/* 💻 Styly pro popover - POČÍTAČ 💻 */
.popover {
    position: fixed;
    top: 0; 
    left: 50%;
    transform: translateX(-50%); 
    background-color: white;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001; 
    display: none;
    min-width: 250px;
    max-width: 350px; 
    height: 100vh; 
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box; 
    border-radius: 0; 
    border: none; 
}

/* 📱 Media Query pro mobilní telefony 📱 */
@media (max-width: 767px) {
    .popover {
        top: 0;
        left: 0;
        transform: none; 
        width: 100%;
        height: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
        min-width: unset; 
    }
}

.popover-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
}
 
.popover-total {
    font-size: 1.5em;
    color: #28a745;
    font-weight: bold;
    border-top: 1px solid #ccc;
    padding-top: 10px;
    text-align: right;
    margin-top: auto;
}
 
.popover-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

.popover-title {
    font-size: 20px; 
    color: #007bff;
    font-weight: bold;
    margin: 0;
}

.close-popover-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2em;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}
.close-popover-icon:hover { color: #333; }

.popover-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}
.popover-actions button {
    width: auto;
    padding: 8px 12px;
    font-size: 0.9em;
    flex-grow: 1;
}

.popover-item-container {
    display: flex;
    align-items: center; 
    border-bottom: 1px dotted #ccc;
    padding: 8px 0;
    margin-bottom: 5px;
    text-align: left;
}

.popover-item-thumbnail {
    width: 50px; 
    height: 50px; 
    object-fit: cover; 
    border-radius: 4px;
    margin-right: 10px; 
    flex-shrink: 0; 
    border: 1px solid #ddd; 
}

/* ⭐ OPRAVENÝ KONTEJNER - Tlačí zbytek doprava ⭐ */
.popover-item-details-container {
    display: flex;
    flex-direction: column;
    flex: 1; 
    min-width: 0;
}

.popover-item-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.popover-item-details {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

.popover-item-note {
    font-size: 0.8em; 
    color: #888; 
    margin-top: 2px;
    margin-bottom: 0;
    white-space: pre-wrap; 
    word-wrap: break-word; 
}

/* ⭐ OPRAVENÝ MAZACÍ KŘÍŽEK ⭐ */
.delete-button {
    background: none;
    border: none;
    color: #dc3545; 
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;      /* Pevná šířka - už nebude pole široké */
    height: 30px;     /* Pevná výška */
    display: flex;    /* Pro vycentrování křížku */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;   /* Nesmí se smrsknout */
    line-height: 1;
    transition: all 0.2s ease;
}

.delete-button:hover {
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 50%;
    color: #c82333;
}

.print-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}

.close-button-popover {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}

/* Ostatní styly zůstávají beze změn */
.selected-item-display {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #f9f9f9;
    width: 100%; 
    box-sizing: border-box;
}
.selected-item-display img { max-width: 100%; height: auto; border-radius: 4px; margin-bottom: 10px; }
.selected-item-display h4 { margin: 5px 0; color: #333; font-size: 1.4em; font-weight: bold; }
#selected-item-price { color: black; font-size: 1.6em; margin-top: 10px; }

.temporary-sticker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 20px;
    z-index: 1002;
    font-size: 1.2em;
    font-weight: bold;
    background-color: #D3D3D3;
    color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    width: fit-content;
}

.temporary-sticker.active {
    opacity: 1;
    visibility: visible;
    animation: stickerPopOut 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

@keyframes stickerPopOut {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
    transition: background-color 0.3s ease; 
}
button:hover { background-color: #0056b3; }

.back-button {
    display: block;
    padding: 10px 15px;
    background-color: #6c757d;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #555; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

hr { border: none; border-top: 1px solid #eee; margin: 25px 0; }