:root {
    --accent:#007bff;
    --green:#28a745;
    --danger:#ff3b30;
    --text:#222;
    --border:#e6e6e6;
    --bg:#f6f7f8;
    --shadow:0 12px 28px rgba(0,0,0,0.12);
}

/* ============================
   MINI CART PANEL
============================ */
#mini-cart {
    position: fixed;
    top: 110px;
    right: -380px;             /* oculto por defecto */
    width: 330px;
    max-height: 72vh;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
    overflow-y: auto;
    z-index: 1500;
    font-size: 14px;
    transition: right .25s ease, transform .25s ease, opacity .25s ease;
    opacity: 0;
}

/* Abierto (desktop) */
#mini-cart.open {
    right: 24px;
    opacity: 1;
}

#mini-cart h2 {
    margin: 0 0 .75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Items */
.cart-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    padding-bottom: .8rem;
    border-bottom: 1px dashed #eaeaea;
}

.cart-item img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #fafafa;
    border-radius: 6px;
}

.cart-info {
    flex: 1;
}

.cart-info .title {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.cart-info .price {
    color: var(--accent);
    font-weight: 700;
    font-size: .9rem;
}

/* Controles dentro del mini-cart */
.cart-controls {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.cart-controls button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fafafa;
    cursor: pointer;
    transition: .2s;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.cart-controls button:hover {
    background: #eee;
}

.cart-controls .qty {
    min-width: 28px;
    text-align: center;
    font-weight: 600;
}

/* Footer del mini-cart */
.cart-footer {
    margin-top: 1rem;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.05rem;
    border-top: 1px solid #eee;
}

#cart-total {
    font-weight: 800;
    font-size: 1.2rem;
    color: #1b74e4;
}

/* Botón Ir a pagar */
.btn-checkout {
    background: #1b74e4;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 10px;
    display: inline-block;
    font-weight: 600;
    text-decoration: none;
}

.btn-checkout:hover {
    background: #125ec7;
}

/* ============================
   BOTÓN FLOTANTE
============================ */
#cart-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(0,0,0,0.20);
    z-index: 1600;
    cursor: pointer;
    transition: transform .25s ease;
}

#cart-button:hover {
    transform: scale(1.06);
}

#cart-button img {
    width: 36px;
    height: 36px;
    filter: brightness(0) invert(1);
}

#cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
}

/* ============================
   OVERLAY (MÓVIL)
============================ */
#cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1400;
}

#cart-overlay.show {
    display: block;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 900px) {

    #mini-cart {
        top: 50%;
        right: auto;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: 90%;
        max-width: 320px;
        max-height: 80vh;
        opacity: 0;
        display: none;
    }

    #mini-cart.open {
        display: block;
        opacity: 1;
    }
}
