/* =====================
   CARRO DE COMPRAS - CSS EXCLUSIVO PARA WORDPRESS
===================== */

/* =====================
   RESET & BASE
===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top, #141414, #080808 70%);
    color: #eaeaea;
}

/* =====================
   HEADER
===================== */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}

.cart-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cart-header .back {
    color: #7dd3fc;
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.2s ease;
}

.cart-header .back:hover {
    opacity: 0.75;
}

/* =====================
   MAIN LAYOUT
===================== */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.cart-badge {
    background: #ff4757; /* color llamativo tipo notificación */
    color: #fff; /* texto blanco para contraste */
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 50%; /* hace que sea circular */
    min-width: 1.5rem; /* para que sea un círculo consistente */
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* sombra sutil */
    border: 2px solid #fff; /* borde blanco para resaltar sobre el carrito */
    transition: transform 0.2s ease, background 0.2s ease;
}

/* Animación cuando el número cambia */
.cart-badge.pop {
    transform: scale(1.3);
    background: #ff6b81;
}

/* =====================
   CART ITEMS
===================== */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ITEM */
.cart-item {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

/* IMG */
.cart-item-img {
    width: 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    background: #111;
}

/* INFO */
.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cart-item-title {
    font-size: 1rem;
    font-weight: 500;
    color: #f1f1f1;
    line-height: 1.3;
}

/* REMOVE */
.remove {
    background: transparent;
    border: none;
    color: #f87171;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.remove:hover {
    color: #fff;
    transform: scale(1.08) rotate(90deg);
}

/* =====================
   SUMMARY
===================== */
.cart-summary {
    position: sticky;
    top: 2rem;
    height: fit-content;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 500;
}

#cart-total {
    color: #7dd3fc;
}

/* =====================
   BUTTONS
===================== */
.btn-clear,
.btn-checkout {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-clear {
    background: transparent;
    border: 1px solid rgba(248,113,113,0.4);
    color: #f87171;
}

.btn-clear:hover {
    background: rgba(248,113,113,0.15);
}

.btn-checkout {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    border: none;
    color: #02121a;
    font-weight: 600;
}

.btn-checkout:hover {
    box-shadow: 0 10px 30px rgba(14,165,233,0.4);
    transform: translateY(-1px);
}

/* =====================
   EMPTY STATE
===================== */
.cart-items:empty::after {
    content: "Tu carrito está vacío";
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255,255,255,0.4);
    font-size: 1rem;
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 900px) {
    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 480px) {
    .cart-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .cart-item {
        grid-template-columns: 70px 1fr auto;
    }

    .cart-item-img {
        width: 70px;
        height: 50px;
    }
}
