/* ============================================================
   MODOSTORE — Carrito de compras
   ============================================================ */

/* ── Botón icono de carrito ── */
.cart-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.cart-btn:hover { color: rgba(255,255,255,0.7); }

.cart-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #fff;
    color: #000;
    font-size: 8px;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    letter-spacing: 0;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.cart-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* ── Overlay ── */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.cart-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Drawer ── */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 100vw;
    background: #0a0a0a;
    border-left: 1px solid #1f1f1f;
    z-index: 401;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.cart-drawer.open {
    transform: translateX(0);
}

@media (max-width: 480px) {
    .cart-drawer { width: 100%; border-left: none; }
}

/* ── Header del drawer ── */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #1f1f1f;
    flex-shrink: 0;
}
.cart-header-title {
    font-family: ui-monospace, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #fff;
}
.cart-header-count {
    font-size: 10px;
    color: #555;
    letter-spacing: 0.1em;
    margin-left: 0.5rem;
}
.cart-close {
    background: none;
    border: 1px solid #2a2a2a;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s, border-color 0.2s;
}
.cart-close:hover { color: #fff; border-color: #555; }

/* ── Lista de items ── */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-track { background: transparent; }
.cart-items::-webkit-scrollbar-thumb { background: #2a2a2a; }

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #111;
    align-items: flex-start;
}
.cart-item-img {
    width: 64px;
    height: 72px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    border: 1px solid #1f1f1f;
    background: #111;
}
.cart-item-body {
    flex: 1;
    min-width: 0;
}
.cart-item-cat {
    font-size: 8px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 3px;
    font-family: ui-monospace, monospace;
}
.cart-item-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e5e5e5;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-price {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}
.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0;
}
.cart-qty-btn {
    background: none;
    border: 1px solid #2a2a2a;
    color: #888;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
    font-family: ui-monospace, monospace;
}
.cart-qty-btn:hover { color: #fff; border-color: #555; }
.cart-qty-btn:disabled { opacity: 0.3; cursor: default; }
.cart-qty-val {
    min-width: 28px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #e5e5e5;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, monospace;
    border-top: 1px solid #2a2a2a;
    border-bottom: 1px solid #2a2a2a;
    height: 24px;
    line-height: 24px;
}
.cart-item-remove {
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    margin-left: auto;
    transition: color 0.15s;
    display: flex;
    align-items: flex-start;
}
.cart-item-remove:hover { color: #c0392b; }

/* Stock warning */
.cart-item-stock-warn {
    font-size: 8px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #FFD700;
    margin-top: 4px;
    font-family: ui-monospace, monospace;
    display: none;
}
.cart-item-stock-warn.visible { display: block; }

/* ── Estado vacío ── */
.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    display: none;
}
.cart-empty.visible { display: flex; }
.cart-empty-icon { font-size: 40px; color: #2a2a2a; }
.cart-empty-text {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #444;
    text-align: center;
    font-family: ui-monospace, monospace;
}

/* ── Footer del drawer ── */
.cart-footer {
    border-top: 1px solid #1f1f1f;
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
    background: #0a0a0a;
}
.cart-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}
.cart-subtotal-label {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #555;
    font-family: ui-monospace, monospace;
}
.cart-subtotal-val {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}
.cart-checkout-btn {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    padding: 0.85rem 1rem;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: ui-monospace, monospace;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.cart-checkout-btn:hover { background: #d0d0d0; }
.cart-checkout-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Botón AGREGAR AL CARRITO en cards ── */
.btn-add-cart {
    font-size: 9px;
    letter-spacing: 0.15em;
    border: 1px solid #444;
    color: #9ca3af;
    padding: 0.5rem 1rem;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    white-space: nowrap;
}
.btn-add-cart:hover {
    border-color: #fff;
    color: #fff;
}
.btn-add-cart.added {
    background: #fff;
    color: #000;
    border-color: #fff;
}
.btn-add-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
