/* ===== ZÁKLADNÍ STYLY ===== */
body {
    font-family: Arial, sans-serif;
}
.container {
    max-width: 900px;
    margin: 30px auto;
    background: #fff;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
h2 {
    margin-bottom: 24px;
    color: #1976d2;
    font-size: 2rem;
    font-weight: 700;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
    background: #fafafa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
th, td {
    padding: 18px 12px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    font-size: 1em;
}
th {
    background: #f0f0f0;
    font-weight: 600;
    color: #222;
}
tfoot td {
    background: #f9f9f9;
    font-size: 1.1em;
    font-weight: bold;
}
img {
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    max-width: 70px;
    max-height: 70px;
    display: block;
    margin: 0 auto;
}
a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}
a:hover {
    text-decoration: underline;
}
.cart-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 20px;
}
.cart-delete-btn {
    background: #e53935;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.15s;
}
.cart-delete-btn:hover {
    background: #b71c1c;
}
.cart-qty-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}
.qty-minus, .qty-plus {
    background: #eee;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2em;
    cursor: pointer;
    color: #1976d2;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
}
.qty-minus:hover, .qty-plus:hover {
    background: #d0d0d0;
}
.cart-qty-input {
    width: 44px;
    min-width: 38px;
    max-width: 50px;
    font-size: 1em;
    padding: 4px 4px;
    margin: 0 4px;
    text-align: center;
    display: inline-block;
}
.cart-item-subtotal, .cart-total-value {
    font-weight: 600;
    color: #1976d2;
}

/* ===== NOTIFIKACE ===== */
#notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}
.notification {
    background-color: #4caf50;
    color: white;
    padding: 12px 18px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    font-size: 15px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .container {
        padding: 12px 2vw;
        border-radius: 10px;
    }
    table {
        font-size: 0.98em;
    }
    th, td {
        padding: 10px 4px;
    }
    img {
        max-width: 60px;
        max-height: 60px;
    }
}

/* ===== MOBILNÍ DESIGN ===== */
@media (max-width: 700px) {
    .container {
        padding: 8px 0;
        border-radius: 0;
        box-shadow: none;
    }
    table, thead, tbody, tfoot, tr, th, td {
        display: block;
        width: 100%;
    }
    thead { display: none; }

    tr {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        justify-content: flex-start;
        padding: 18px 0 24px 0;
        margin-bottom: 32px;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.10);
        border: 1px solid #e0e0e0;
        position: relative;
        min-height: 160px;
    }
    td {
        flex: 1 1 0;
        min-width: 0;
        padding: 16px 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        background: none;
        border: none;
        gap: 20px;
        position: relative;
    }
    td:first-child {
        flex: 0 0 100px;
        align-items: center;
        justify-content: center;
        padding-right: 0;
    }
    td img {
        margin: 0;
        max-width: 90px;
        max-height: 90px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    }
    td:before {
        content: attr(data-label);
        font-weight: 500;
        color: #888;
        font-size: 1em;
        margin-bottom: 4px;
        display: block;
        text-align: center;
    }
    td:not(:first-child) {
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 16px;
    }
    td > *:not(:last-child) {
        margin-bottom: 20px;
    }
    /* Název produktu */
    td:nth-child(2) {
        font-size: 1.15em;
        font-weight: 700;
        color: #222;
        margin-bottom: 6px;
    }
    /* Cena za kus */
    td:nth-child(3) {
        font-size: 1.18em;
        font-weight: bold;
        color: #1976d2;
        margin-bottom: 6px;
        align-items: flex-end;
        text-align: right;
        width: 100%;
        display: flex;
        justify-content: flex-end;
        position: absolute;
        top: 50px;
        right: 18px;
        background: transparent;
        z-index: 2;
    }
    /* Skladem */
    .in-stock {
        color: #43a047;
        font-weight: 600;
        font-size: 1em;
        margin-bottom: 4px;
    }
    /* Celková cena košíku */
    .cart-total-value {
        font-size: 1.2em;
        font-weight: bold;
        margin-top: 8px;
        text-align: center;
    }
    .cart-hide-mobile { display: none !important; }

    /* Tlačítko pro smazání vpravo nahoře */
    .cart-delete-btn {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
        font-size: 1.3em;
        padding: 0;
        border-radius: 50%;
        background: #f5f5f5;
        color: #444;
        border: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.07);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
        transition: background 0.15s, color 0.15s;
    }
    .cart-delete-btn:hover {
        background: #e0e0e0;
        color: #222;
    }

    /* Množství vpravo dole na samostatném řádku */
    .cart-qty-row {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        position: absolute;
        right: 18px;
        bottom: 18px;
        background: #fafafa;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
        padding: 6px 10px;
    }
    td:nth-child(4) {
        position: relative;
        min-height: 70px;
        padding-bottom: 48px;
        align-items: flex-end;
        justify-content: flex-end;
    }
    .cart-qty-input {
        width: 54px;
        max-width: 70px;
        font-size: 1.15em;
        padding: 8px 10px;
        margin: 0 8px;
        border-radius: 8px;
        border: 1px solid #bbb;
        background: #fff;
    }
    .qty-minus, .qty-plus {
        width: 38px;
        height: 38px;
        font-size: 1.4em;
        box-shadow: 0 1px 4px rgba(0,0,0,0.07);
        margin: 0;
        background: #eee;
        color: #1976d2;
        border: none;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s;
    }
    .qty-minus:hover, .qty-plus:hover {
        background: #d0d0d0;
    }
}

/* ===== EXTRA MALÉ MOBILY ===== */
@media (max-width: 480px) {
    .container { padding: 2px 0; }
    tr { margin-bottom: 24px; padding: 8px 0; } /* zvětšeno */
    td { padding: 12px 8px; }                   /* zvětšeno */
    img { max-width: 54px; max-height: 54px; }
    .cart-actions { gap: 6px; }
    .cart-item-subtotal, .cart-total-value { font-size: 1em; }
    .cart-qty-row {
        right: 8px;
        bottom: 8px;
        padding: 4px 6px;
    }
    .cart-qty-input {
        width: 38px;
        font-size: 1em;
        padding: 4px 6px;
    }
    .qty-minus, .qty-plus {
        width: 28px;
        height: 28px;
        font-size: 1.1em;
    }
}
