/* ===================================================================
   Magic Service - Complementos de Carrito
   Estilos del carrusel en el carrito
   Paleta ERP: Vino, Naranja, Dorado, Verde
   =================================================================== */

:root {
    --mscc-vino:       #8B1A2B;
    --mscc-vino-osc:   #6f1522;
    --mscc-naranja:    #F27405;
    --mscc-dorado:     #D99B29;
    --mscc-verde-bg:   #E1F5EE;
    --mscc-verde-tx:   #085041;
    --mscc-crema:      #FFF8F0;
    --mscc-texto:      #1c1c1c;
    --mscc-texto-sec:  #666;
    --mscc-gris-cl:    #eaeaea;
    --mscc-borde:      #f0e6d3;
}

/* ═══════════════════════════════════════════════════
   CONTENEDOR PRINCIPAL
   ═══════════════════════════════════════════════════ */

.mscc-carrusel-wrap {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 100%;
    margin: 28px 0;
    padding: 24px;
    background-color: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--mscc-borde);
    box-sizing: border-box;
}

/* Header del carrusel */
.mscc-carrusel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.mscc-carrusel-titulo {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 24px;
    font-weight: normal;
    color: var(--mscc-vino);
    margin: 0;
    line-height: 1.2;
}

.mscc-carrusel-nav {
    display: flex;
    gap: 8px;
}

.mscc-carrusel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--mscc-vino);
    background-color: #ffffff;
    color: var(--mscc-vino);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.mscc-carrusel-btn:hover:not(:disabled) {
    background-color: var(--mscc-vino);
    color: #ffffff;
}

.mscc-carrusel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mscc-carrusel-btn svg {
    display: block;
}


/* ═══════════════════════════════════════════════════
   CARRUSEL (TRACK DESLIZABLE)
   ═══════════════════════════════════════════════════ */

.mscc-carrusel-track-wrap {
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    /* Espacio para que el foco/glow del hover no se corte */
    margin: -10px -6px;
    padding: 10px 6px;
}

.mscc-carrusel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding: 6px 2px; /* Padding vertical para el efecto de hover translateY */
}

.mscc-carrusel-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}


/* ═══════════════════════════════════════════════════
   TARJETA DE PRODUCTO
   ═══════════════════════════════════════════════════ */

.mscc-card {
    flex: 0 0 200px;
    max-width: 200px;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--mscc-gris-cl);
    padding: 14px;
    position: relative;
    scroll-snap-align: start;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mscc-card:hover {
    transform: translateY(-3px);
    border-color: var(--mscc-vino);
    box-shadow: 0 6px 16px rgba(139, 26, 43, 0.08);
}

.mscc-card-imagen {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: var(--mscc-crema);
}

.mscc-card-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.mscc-card:hover .mscc-card-imagen img {
    transform: scale(1.05);
}

.mscc-card-info {
    flex: 1;
    min-height: 60px;
}

.mscc-card-nombre {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--mscc-texto);
    line-height: 1.35;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mscc-card-nombre a {
    color: inherit;
    text-decoration: none;
}

.mscc-card-nombre a:hover {
    color: var(--mscc-vino);
}

.mscc-card-precio {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--mscc-vino);
    line-height: 1.2;
}

.mscc-card-precio .amount {
    color: inherit;
    font-weight: inherit;
}

.mscc-card-precio del {
    opacity: 0.5;
    font-weight: 500;
    margin-right: 6px;
    font-size: 13px;
}

.mscc-card-precio ins {
    text-decoration: none;
    color: var(--mscc-naranja);
}


/* Botón "+" flotante en la tarjeta */
.mscc-card-boton {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--mscc-naranja);
    color: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 10px rgba(242, 116, 5, 0.35);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 2;
}

.mscc-card-boton:hover:not(:disabled) {
    background-color: var(--mscc-vino);
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(139, 26, 43, 0.4);
}

.mscc-card-boton:disabled {
    cursor: default;
    opacity: 0.8;
}

.mscc-card-boton svg {
    display: block;
}

.mscc-card-boton[data-estado="cargando"] {
    background-color: var(--mscc-texto-sec);
}

.mscc-card-boton[data-estado="exito"] {
    background-color: var(--mscc-verde-tx);
    animation: mscc-pop 0.35s ease;
}

@keyframes mscc-pop {
    0%   { transform: scale(0.85); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes mscc-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.mscc-spin {
    animation: mscc-spin 0.9s linear infinite;
    transform-origin: center;
}


/* ═══════════════════════════════════════════════════
   TOAST DE NOTIFICACIÓN
   ═══════════════════════════════════════════════════ */

.mscc-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--mscc-verde-tx);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 90%;
    white-space: nowrap;
}

.mscc-toast.mscc-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mscc-toast-error {
    background-color: #C62828;
}


/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 767px) {
    .mscc-carrusel-wrap {
        padding: 18px 14px;
        margin: 20px 0;
    }

    .mscc-carrusel-titulo {
        font-size: 20px;
    }

    .mscc-carrusel-nav {
        display: none; /* En móvil se desliza con el dedo */
    }

    .mscc-card {
        flex: 0 0 160px;
        max-width: 160px;
        padding: 12px;
    }

    .mscc-card-boton {
        top: 18px;
        right: 18px;
        width: 32px;
        height: 32px;
    }

    .mscc-card-nombre {
        font-size: 12px;
    }

    .mscc-card-precio {
        font-size: 14px;
    }

    .mscc-toast {
        font-size: 13px;
        padding: 11px 18px;
        bottom: 20px;
    }
}


/* ═══════════════════════════════════════════════════
   ACCESIBILIDAD
   ═══════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .mscc-card,
    .mscc-card-imagen img,
    .mscc-card-boton,
    .mscc-toast {
        transition: none !important;
        animation: none !important;
    }
    .mscc-carrusel-track {
        scroll-behavior: auto;
    }
}
