/* Avisos de la web: carrito y mensajes generales */

.avc {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1090;
    width: 380px;
    max-width: calc(100vw - 32px);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(37, 32, 52, .28);
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    color: #252034;
    animation: avc-entra .3s cubic-bezier(.2, .9, .3, 1.1);
}

.avc *,
.avc *::before,
.avc *::after {
    box-sizing: border-box;
}

.avc.is-saliendo {
    animation: avc-sale .25s ease-in forwards;
}

@keyframes avc-entra {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
}

@keyframes avc-sale {
    to {
        opacity: 0;
        transform: translateY(24px);
    }
}

.avc__cab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 14px;
}

.avc__icono {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #EA1621;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.avc--info .avc__icono {
    background: #F1EFF4;
    color: #252034;
}

.avc--aviso .avc__icono {
    background: #252034;
}

.avc__textos {
    flex: 1;
    min-width: 0;
}

.avc__titulo {
    display: block;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.avc__texto {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #8A859A;
}

.avc__cerrar {
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #F1EFF4;
    cursor: pointer;
}

.avc__cerrar::before,
.avc__cerrar::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 2px;
    background: #252034;
    transform: translate(-50%, -50%) rotate(45deg);
}

.avc__cerrar::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.avc__cerrar:hover {
    background: #E6E3EB;
}

.avc__producto {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 18px;
    padding: 10px;
    border-radius: 12px;
    background: #F6F5F8;
}

.avc__mini {
    flex-shrink: 0;
    width: 56px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #3A3350, #1C1828);
}

.avc__mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avc__datos {
    flex: 1;
    min-width: 0;
}

.avc__nombre {
    display: block;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avc__tipo {
    font-size: 11px;
    color: #8A859A;
}

.avc__precio {
    flex-shrink: 0;
    font-family: 'Anton', 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 18px;
}

.avc__botones {
    display: flex;
    gap: 8px;
    padding: 14px 18px;
}

.avc__boton {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.avc__boton--linea {
    border: 2px solid #E6E3EB;
    background: #fff;
    color: #252034;
}

.avc__boton--linea:hover {
    border-color: #252034;
}

.avc__boton--rojo {
    flex: 1.3;
    border: 2px solid #EA1621;
    background: #EA1621;
    color: #fff;
}

.avc__boton--rojo:hover {
    border-color: #C50F19;
    background: #C50F19;
    color: #fff;
}

.avc__cerrar:focus-visible,
.avc__boton:focus-visible {
    outline: 2px solid #EA1621;
    outline-offset: 2px;
}

.avc__barra {
    height: 4px;
    background: #F1EFF4;
}

.avc__barra i {
    display: block;
    height: 100%;
    background: #EA1621;
    animation: avc-tiempo 4s linear forwards;
}

.avc.is-pausado .avc__barra i {
    animation-play-state: paused;
}

@keyframes avc-tiempo {
    from {
        width: 100%;
    }
    to {
        width: 0;
    }
}

/* Mensaje general: sin producto ni botones */

.avc--solo .avc__cab {
    padding-bottom: 16px;
}

/* El número del carrito del menú da un salto */

.avc-salta {
    display: inline-block;
    animation: avc-salta .6s ease;
}

@keyframes avc-salta {
    40% {
        transform: scale(1.4);
    }
    70% {
        transform: scale(.92);
    }
}

/* Móvil: hoja que sube desde abajo */

@media (max-width: 575.98px) {
    .avc {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-width: none;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(37, 32, 52, .25);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .avc__botones .avc__boton {
        padding: 12px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .avc,
    .avc.is-saliendo,
    .avc-salta {
        animation: none;
    }
}
