/* ═════════════════════════════════════════════════════════════════
   CEFIRO_SOFT - Shopping Cart Styles
   ════════════════════════════════════════════════════════════════= */

/* ── Grupo de FABs flotantes ───────────────────────────────────── */
.fabs-group {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 500; /* por debajo de los modales (z-index 1000) para no tapar sus botones */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.fab-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.fab-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    background: rgba(18,16,10,0.95);
    border: 1px solid rgba(200,208,218,0.25);
    color: #C8D0DA;
    font-family: 'Raleway', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 2px;
    opacity: 0;
    transform: translateX(6px);
    transition: all 0.25s ease;
    pointer-events: none;
}

.fab-item:hover .fab-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.fab-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.fab-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.fab-loyalty {
    background: linear-gradient(135deg, #C8D0DA 0%, #c9a227 100%);
    color: #0c0b09;
    box-shadow: 0 4px 20px rgba(200,208,218,0.35);
}

.fab-loyalty:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(200,208,218,0.5);
}

.fab-cart {
    background: linear-gradient(135deg, #E8E8E8 0%, #909090 100%);
    color: #0c0b09;
    box-shadow: 0 4px 20px rgba(192,192,192,0.35);
}

.fab-cart:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(200,208,218,0.5);
}

/* Badge contador del carrito */
.carrito-cantidad {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid #0c0b09;
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

/* Compatibilidad: .carrito-icono ahora es clase en el fab-btn */
.carrito-icono {
    /* heredado de .fab-btn + .fab-cart */
}

/* Modal del carrito */
.carrito-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 11, 9, 0.92);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    backdrop-filter: blur(12px);
}

.carrito-modal-overlay.activo {
    display: flex;
}

.carrito-modal {
    width: 100%;
    max-width: 450px;
    max-height: 85vh;
    background: #111009;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-right: none;
    border-radius: 12px 0 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.carrito-header {
    padding: 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.carrito-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: #C8D0DA;
    margin: 0;
}

.carrito-cerrar {
    background: none;
    border: none;
    color: #C8D0DA;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.carrito-cerrar:hover {
    transform: rotate(90deg);
}

.carrito-contenido {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    scrollbar-width: thin;
    scrollbar-color: #C8D0DA transparent;
}

.carrito-contenido::-webkit-scrollbar {
    width: 6px;
}

.carrito-contenido::-webkit-scrollbar-track {
    background: transparent;
}

.carrito-contenido::-webkit-scrollbar-thumb {
    background: #C8D0DA;
    border-radius: 3px;
}

.carrito-item {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.05);
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 12px;
    align-items: center;
}

.carrito-item-info {
    min-width: 0;
}

.carrito-item-nombre {
    color: #f5f0e8;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.carrito-item-familia {
    color: #b8ae96;
    font-size: 12px;
    margin-bottom: 6px;
}

.carrito-item-precio {
    color: #C8D0DA;
    font-size: 13px;
    font-weight: 600;
}

.carrito-item-cantidad {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #181610;
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 4px;
    padding: 2px;
}

.btn-cantidad {
    background: none;
    border: none;
    color: #C8D0DA;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.2s ease;
}

.btn-cantidad:hover {
    color: #c9a227;
}

.carrito-item-cantidad input {
    background: transparent;
    border: none;
    color: #f5f0e8;
    width: 30px;
    text-align: center;
    font-size: 12px;
}

.carrito-item-cantidad input:focus {
    outline: none;
}

.carrito-item-subtotal {
    color: #C8D0DA;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    min-width: 80px;
}

.btn-eliminar {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-eliminar:hover {
    background: #f87171;
    color: white;
}

.carrito-fte-contacto {
    padding: 20px 24px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.carrito-fte-contacto label {
    display: block;
    margin-bottom: 8px;
    color: #C8D0DA;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carrito-fte-contacto input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #181610;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    color: #f5f0e8;
    font-size: 13px;
    font-family: 'Raleway', sans-serif;
}

.carrito-fte-contacto input::placeholder { color: #b8ae96; }

.carrito-fte-contacto input:focus {
    outline: none;
    border-color: #C8D0DA;
    background: #1e1b12;
}

/* Campo teléfono con prefijo fijo +57 */
.carrito-phone-wrap {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    background: #181610;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.carrito-phone-wrap:focus-within {
    border-color: #C8D0DA;
    background: #1e1b12;
}

.carrito-phone-prefix {
    padding: 10px 12px;
    background: rgba(212, 175, 55, 0.1);
    border-right: 1px solid rgba(212, 175, 55, 0.15);
    color: #C8D0DA;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    user-select: none;
}

.carrito-phone-wrap input {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    margin-bottom: 0;
    color: #f5f0e8;
    font-size: 13px;
    font-family: 'Raleway', sans-serif;
    outline: none;
    min-width: 0;
}

#carrito-resumen {
    padding: 16px 24px;
    background: rgba(212, 175, 55, 0.04);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.carrito-resumen-fila {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #b8ae96;
}

.carrito-resumen-total {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    font-size: 14px;
    font-weight: 600;
    color: #C8D0DA;
}

.carrito-acciones {
    padding: 16px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-carrito {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-vaciar {
    background: #1e1b12;
    color: #f87171;
    border: 1px solid #f87171;
}

.btn-vaciar:hover {
    background: #f87171;
    color: white;
}

.btn-enviar-whatsapp {
    background: #C8D0DA;
    color: #0c0b09;
    border: 1px solid #C8D0DA;
}

.btn-enviar-whatsapp:hover {
    background: #c9a227;
    border-color: #c9a227;
}

.btn-enviar-whatsapp:disabled {
    background: #b8ae96;
    border-color: #b8ae96;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Notificación */
.notificacion-carrito {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #181610;
    border: 1px solid #C8D0DA;
    color: #f5f0e8;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 13px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.1);
}

.notificacion-carrito.visible {
    opacity: 1;
}

/* Botón "Agregar al carrito" en modal */
.btn-agregar-carrito {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: linear-gradient(135deg, #C8D0DA 0%, #c9a227 100%);
    color: #0c0b09;
    padding: 13px 28px;
    border: none;
    border-radius: 2px;
    font-family: 'Raleway', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s ease;
}

.btn-agregar-carrito:hover {
    background: linear-gradient(135deg, #c9a227 0%, #b8911f 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .carrito-modal {
        max-width: 100%;
    }

    .carrito-item {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }

    .carrito-item-cantidad,
    .carrito-item-subtotal {
        display: none;
    }
}
