/**
 * Estilos del Configurador - Estilo Lowi
 * 
 * @package ContratacionOnline
 */

/* ========================================
   CONFIGURADOR PRINCIPAL
======================================== */

.configurador-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.configurador-header {
    text-align: center;
    margin-bottom: 60px;
}

.configurador-header h1 {
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.configurador-header p {
    font-size: 20px;
    color: #666;
    margin: 0;
}

/* ========================================
   SECCIONES DEL CONFIGURADOR
======================================== */

.seccion-config {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.seccion-titulo {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.numero-seccion {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2474C8 0%, #2474C8 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.seccion-titulo h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ========================================
   GRID DE TARJETAS
======================================== */

.tarjetas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.tarjeta {
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #fff;
}

.tarjeta:hover {
    border-color: #2474C8;
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.25);
}

.tarjeta.seleccionada {
    border-color: #2474C8;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.08) 0%, 
        rgba(118, 75, 162, 0.08) 100%);
}

.tarjeta-check {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #2474C8;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.tarjeta.seleccionada .tarjeta-check {
    display: flex;
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   TARJETAS DE FIBRA
======================================== */

.tarjeta-fibra .tarjeta-velocidad {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #2474C8 0%, #2474C8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.tarjeta-fibra .tarjeta-nombre {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.tarjeta-fibra .tarjeta-precio {
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.tarjeta-fibra .tarjeta-precio .precio {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
}

.tarjeta-fibra .tarjeta-precio .periodo {
    font-size: 16px;
    color: #999;
    margin-left: 4px;
}

/* ========================================
   LÍNEA INCLUIDA
======================================== */

.linea-incluida {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid #2474C8;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.linea-incluida h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2474C8;
}

.linea-incluida p {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* ========================================
   LÍNEAS ADICIONALES
======================================== */

#lineas-adicionales-container {
    margin-bottom: 20px;
}

.linea-adicional {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

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

.linea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.linea-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.btn-quitar-linea {
    background: #ff4444;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-quitar-linea:hover {
    background: #cc0000;
    transform: scale(1.05);
}

.selector-datos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.tarjeta-movil {
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: white;
}

.tarjeta-movil:hover {
    border-color: #2474C8;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.tarjeta-movil.seleccionada {
    border-color: #2474C8;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 100%);
}

.tarjeta-movil .gb {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.tarjeta-movil .precio {
    font-size: 18px;
    font-weight: 600;
    color: #2474C8;
}

.tarjeta-movil .check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #2474C8;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.tarjeta-movil.seleccionada .check {
    display: flex;
}

/* ========================================
   BOTÓN AÑADIR LÍNEA
======================================== */

.btn-add-linea {
    width: 100%;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.btn-add-linea:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

.btn-add-linea:active {
    transform: translateY(0);
}

.info-lineas {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* ========================================
   SECCIÓN RESUMEN
======================================== */

.seccion-resumen {
    background: linear-gradient(135deg, #2474C8 0%, #2474C8 100%);
    border-radius: 20px;
    padding: 50px 40px;
    color: white;

    top: 20px;
}

.resumen-header h2 {
    margin: 0 0 30px 0;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
}

#resumen-items {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.item-resumen {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
}

.item-resumen:last-child {
    border-bottom: none;
}

.resumen-total {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 16px;
}

.total-row.instalacion {
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.total-row.primer-recibo {
    padding-top: 15px;
    margin-top: 15px;
    border-top: 3px solid white;
    font-size: 24px;
    font-weight: 700;
}

/* ========================================
   BOTÓN CONTRATAR GRANDE
======================================== */

.btn-contratar-grande {
    width: 100%;
    background: white;
    color: #2474C8;
    border: none;
    padding: 25px 40px;
    border-radius: 16px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.btn-contratar-grande:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.btn-contratar-grande:active {
    transform: translateY(-2px);
}

.ventajas {
    text-align: center;
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.9;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 1024px) {
    .configurador-wrapper {
        padding: 30px 15px;
    }
    
    .seccion-config {
        padding: 30px 20px;
    }
    
    .configurador-header h1 {
        font-size: 36px;
    }
    
    .configurador-header p {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .configurador-header h1 {
        font-size: 30px;
    }
    
    .configurador-header p {
        font-size: 16px;
    }
    
    .seccion-titulo {
        gap: 15px;
    }
    
    .numero-seccion {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .seccion-titulo h2 {
        font-size: 22px;
    }
    
    .tarjetas-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .tarjeta-fibra .tarjeta-velocidad {
        font-size: 36px;
    }
    
    .tarjeta-fibra .tarjeta-nombre {
        font-size: 16px;
    }
    
    .tarjeta-fibra .tarjeta-precio .precio {
        font-size: 24px;
    }
    
    .selector-datos {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .seccion-resumen {
        position: static;
        padding: 30px 20px;
        margin-top: 30px;
    }
    
    .resumen-header h2 {
        font-size: 26px;
    }
    
    .btn-contratar-grande {
        font-size: 20px;
        padding: 20px 30px;
    }
}

@media (max-width: 480px) {
    .configurador-wrapper {
        padding: 20px 10px;
    }
    
    .seccion-config {
        padding: 25px 15px;
        margin-bottom: 20px;
    }
    
    .tarjetas-grid {
        grid-template-columns: 1fr;
    }
    
    .selector-datos {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .linea-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .btn-quitar-linea {
        width: 100%;
        justify-content: center;
    }
    
    .btn-add-linea {
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* ========================================
   ANIMACIONES ADICIONALES
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.configurador-wrapper {
    animation: fadeIn 0.5s ease;
}

.seccion-config {
    animation: fadeIn 0.6s ease;
}

.seccion-resumen {
    animation: fadeIn 0.7s ease;
}

/* ========================================
   ESTADOS DE LOADING
======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2474C8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   UTILIDADES
======================================== */

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* ========================================
   MODO OSCURO (OPCIONAL)
======================================== */

@media (prefers-color-scheme: dark) {
    .seccion-config {
        background: #1a1a1a;
        color: #fff;
    }
    
    .seccion-titulo h2 {
        color: #fff;
    }
    
    .tarjeta {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .tarjeta:hover {
        background: #333;
    }
    
    .linea-adicional {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .tarjeta-movil {
        background: #333;
        border-color: #444;
    }
    
    .tarjeta-fibra .tarjeta-nombre,
    .tarjeta-fibra .tarjeta-precio .precio,
    .tarjeta-movil .gb {
        color: #fff;
    }
}