/**
 * FREE SHIPPING REASSURANCE MODULE - STYLES
 * Version 1.1.0
 */

/* ============================================================================
   CONTENEDOR PRINCIPAL
   ============================================================================ */

.free-shipping-notification {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .950rem;
    line-height: 1.5;
}

/* ============================================================================
   ALERTAS (SUCCESS & WARNING)
   ============================================================================ */

.alert-reassurance {
    border-radius: .75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    animation: slideInAlert 0.3s ease-out;
}

@keyframes slideInAlert {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Alerta de Éxito (Envío Gratis) */
.alert-reassurance.alert-free-shipping {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-reassurance.alert-free-shipping .reassurance-content i { color: #28a745; }

.alert-reassurance.alert-free-shipping .progress-bar { background-color: linear-gradient(90deg, #28a745 0%, #20c997 100%); }

/* Alerta de Advertencia (Falta Monto) */
.free-shipping-notification .alert-reassurance.alert-no-free-shipping {
    border-radius: .75rem;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-reassurance.alert-no-free-shipping .reassurance-content i { color: #ffc107; }

.alert-reassurance.alert-no-free-shipping .progress-bar {
    background-color: linear-gradient(90deg, #ffc107 0%, #ffa500 100%);
}

/* ============================================================================
   CONTENIDO DE LA ALERTA
   ============================================================================ */

.reassurance-content {
    display: flex;
    gap: 14px;
    flex: 1;
    align-items: flex-start;
}

.reassurance-content i {
    font-size: 24px;
    margin-top: 2px;
    flex-shrink: 0;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reassurance-text {
    margin: 0;
    flex: 1;
}

.reassurance-message, .reassurance-message p {
    margin: 0;
    font-size: .950rem;
    line-height: 1.6;
    font-weight: 500;
    color: #010101;
}

.reassurance-message strong {
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

/* ============================================================================
   BARRA DE PROGRESO
   ============================================================================ */

.reassurance-progress {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.progress {
    width: 100%;
    height: 16px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    font-size: .950rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    z-index: 1;
    position: relative;
}

/* ============================================================================
   RESPONSIVE - TABLET (768px y menos)
   ============================================================================ */

@media (max-width: 768px) {
    .alert-reassurance {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 12px;
    }

    .reassurance-progress {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .progress {
        flex: 1;
        height: 6px;
    }

    .reassurance-message {
        font-size: 13px;
    }
}

/* ============================================================================
   RESPONSIVE - MOBILE (576px y menos)
   ============================================================================ */

@media (max-width: 576px) {
    .free-shipping-reassurance {
        margin: 15px 0;
        font-size: 13px;
    }

    .alert-reassurance {
        padding: 12px 14px;
        gap: 10px;
    }

    .reassurance-content {
        gap: 10px;
    }

    .reassurance-content i {
        font-size: 20px;
        min-width: 20px;
    }

    .reassurance-message {
        font-size: 12px;
        line-height: 1.5;
    }

    .reassurance-progress {
        width: 100%;
        gap: 8px;
    }

    .progress-text {
        font-size: 1rem;
    }
}

/* ============================================================================
   MODO OSCURO (DARK MODE)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .alert-success {
        background-color: rgba(40, 167, 69, 0.2);
        color: #4ade80;
        border-color: rgba(40, 167, 69, 0.4);
    }

    .alert-success .reassurance-content i {
        color: #4ade80;
    }

    .alert-warning {
        background-color: rgba(255, 193, 7, 0.2);
        color: #facc15;
        border-color: rgba(255, 193, 7, 0.4);
    }

    .alert-warning .reassurance-content i {
        color: #facc15;
    }

    .progress {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* ============================================================================
   ACCESIBILIDAD
   ============================================================================ */

/* Reducción de movimiento (prefers-reduced-motion) */
@media (prefers-reduced-motion: reduce) {
    .alert-reassurance {
        animation: none;
    }

    .progress-bar {
        transition: none;
    }

    .progress-bar::after {
        animation: none;
    }
}

/* Focus visible para navegación con teclado */
.alert-reassurance:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ============================================================================
   IMPRESIÓN
   ============================================================================ */

@media print {
    .free-shipping-reassurance {
        display: none;
    }
}

/* ============================================================================
   VARIANTES Y CASOS ESPECIALES
   ============================================================================ */

/* Cuando el módulo está cargando */
.free-shipping-reassurance.loading {
    opacity: 0.6;
    pointer-events: none;
}

.free-shipping-reassurance.loading .progress-bar::after {
    animation: shimmer 1s infinite;
}

/* Cuando hay error */
.free-shipping-reassurance.error {
    display: none;
}

/* Cuando está deshabilitado */
.free-shipping-reassurance.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================================================
   COMPATIBILIDAD CON TEMAS COMUNES
   ============================================================================ */

/* Bootstrap 4 compatibility */
.free-shipping-reassurance .alert {
    position: relative;
    padding: 0.75rem 1.25rem;
}

/* Bootstrap 5 compatibility */
.free-shipping-reassurance .alert-dismissible {
    padding-right: 3.5rem;
}

/* Foundation compatibility */
.free-shipping-reassurance .callout {
    margin: 0 0 1rem 0;
    padding: 1rem;
    border: 1px solid #dbdbdb;
    border-radius: 3px;
}
