/* ========== CSS RESET ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============ BODY ============ */
body {
    font-family: 'Noto Serif', serif;
    margin: 0 auto;
    max-width: 1200px;
    width: 95%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: #1a1a24;
    background-repeat: repeat-y;
    background-position: top center;
    background-image: url("assets/background.webp");
    color: #333;
}

/* =========== HEADER =========== */
.header {
    margin-bottom: 2rem;
    border-bottom: 2px solid #FDE68A;
    background-color: rgba(0, 0, 0, 0.85);
    border-radius: 0 0 10px 10px;
}

.header__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
}

.header__title {
    color: #FDE68A;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header__back {
    color: #1a1a24;
    text-decoration: none;
    background: #FDE68A;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    font-weight: bold;
    font-family: system-ui, sans-serif;
    transition: background 0.3s, transform 0.2s;
}

.header__back:hover {
    background: #e5cd72;
    transform: translateX(-3px);
}

/* =========== CART LAYOUT =========== */
.cart-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex-grow: 1; /* Empuja el footer hacia abajo */
    padding-bottom: 3rem;
}

/* Diseño a dos columnas en pantallas de PC */
@media (min-width: 800px) {
    .cart-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

.cart-items {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    border: 3px solid #b58900;
}

.cart-items__title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #ccc;
    padding-bottom: 0.5rem;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =========== CART ITEMS =========== */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fcfcfc;
    transition: box-shadow 0.2s;
}

.cart-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.cart-item__img {
    width: 60px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.cart-item__info {
    flex-grow: 1;
}

.cart-item__name {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: #1a1a24;
}

.cart-item__price {
    font-weight: bold;
    color: #b58900;
}

.cart-item__actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-item__quantity {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
}

.qty-btn {
    background: #eee;
    border: none;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #ddd;
}

.qty-number {
    padding: 0 1rem;
    font-weight: bold;
    font-family: system-ui, sans-serif;
}

.cart-item__remove {
    background: none;
    border: none;
    color: #d9534f;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
}

.cart-item__remove:hover {
    text-decoration: underline;
}

/* =========== CART SUMMARY =========== */
.cart-summary {
    width: 100%;
    min-width: 300px;
    background: linear-gradient(145deg, #FFFdf2, #FDE68A);
    border: 3px solid #b58900;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3);
}

@media (min-width: 800px) {
    .cart-summary {
        width: 300px;
        position: sticky;
        top: 2rem; /* Hace que el resumen baje contigo si hay muchas cartas */
    }
}

.cart-summary__title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #b58900;
    padding-bottom: 0.5rem;
}

.cart-summary__details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.cart-summary__total {
    font-size: 1.3rem;
    font-weight: bold;
    border-top: 1px dashed #b58900;
    padding-top: 1rem;
}

.cart-summary__checkout {
    width: 100%;
    padding: 12px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    margin-bottom: 1rem;
}

.cart-summary__checkout:hover {
    background-color: #1a252f;
}

.cart-summary__clear {
    width: 100%;
    padding: 10px;
    background-color: transparent;
    color: #d9534f;
    border: 2px solid #d9534f;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.cart-summary__clear:hover {
    background-color: #d9534f;
    color: white;
}

/* =========== FOOTER =========== */
.footer {
    text-align: center;
    padding: 2rem;
    color: #FDE68A;
    background-color: rgba(0, 0, 0, 0.85);
    border-radius: 10px 10px 0 0;
    margin-top: auto;
}