/**
 * Cart Manager Styles
 * Estilos para el sistema de múltiples cuentas
 *
 * @package Noctorial_Checkout
 * @since 1.0.0
 */

/* ============================================
   Sistema de Pasos
   ============================================ */

.step-hidden {
    display: none !important;
}

.step-active {
    display: block;
}

/* ============================================
   Layout de 2 Columnas - Paso Configuración
   ============================================ */

.onepage-checkout-container[data-step="configuration"] {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin-top: 30px;
}

.configuracion-cuenta {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(247, 246, 240, 0.1);
    border-radius: 12px;
    padding: 24px;
}

.configuracion-cuenta .section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
}

.resumen-cuentas {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: radial-gradient(148.33% 135.18% at 10.75% -33.53%, rgba(17, 110, 251, 0.40) 0%, rgba(17, 110, 251, 0.00) 68.39%), radial-gradient(225.04% 274.28% at -40.27% -162.96%, rgba(17, 110, 251, 0.40) 0%, rgba(17, 110, 251, 0.00) 68.39%), linear-gradient(0deg, rgba(17, 110, 251, 0.03) 0%, rgba(17, 110, 251, 0.03) 100%), rgba(19, 23, 29, 0.20);
    padding: 24px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.resumen-cuentas .section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 16px;
}

/* ============================================
   Tabs de Navegación
   ============================================ */

.checkout-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(247, 246, 240, 0.1);
    padding-bottom: 12px;
}

.checkout-tab {
    border-radius: 8px;
border: 0.5px solid rgba(247, 246, 240, 0.10);
background: rgba(237, 237, 240, 0.04);
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.checkout-tab .tab-number {
    background: rgba(255, 255, 255, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.checkout-tab.active {
    border-radius: 8px;
    border: 0.5px solid rgba(247, 246, 240, 0.10);
    background: rgba(16, 110, 251, 0.30);
    color: #ffffff;
}

.checkout-tab.active .tab-number {
    background: #116EFB;
    color: #ffffff;
}

.checkout-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.checkout-tab.disabled:hover {
    background: transparent;
}

.checkout-tab:not(.disabled):hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   Banner de Cuentas Añadidas
   ============================================ */
.noctorial-accounts-list {
    border-radius: 16px;
    border: 1px solid rgba(247, 246, 240, 0.05);
    background: rgba(237, 237, 240, 0.01);
}

.accounts-banner {
    display: none; /* Oculto por defecto, se muestra con JS cuando hay cuentas */
    background: rgba(237, 237, 240, 0.04);
    border-radius: 16px 16px 0 0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accounts-count {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.btn-add-account-small {
    border-radius: 8px;
    background: rgba(16, 110, 251, 0.30);
    border: 1px solid rgba(17, 110, 251, 0.3);
    color: #ffffff;
    font-size: 14px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-add-account-small:hover {
    background: rgba(16, 110, 251, 0.30);
    border-color: #116EFB;
}

/* ============================================
   Lista de Cuentas
   ============================================ */

#accounts-list {
    margin-bottom: 20px;
}

.no-accounts {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.account-item {
    border-bottom: 1px solid rgba(247, 246, 240, 0.1);
    padding: 12px 18px 12px 18px;
    transition: all 0.3s ease;
}

.account-item:last-child {
    border-bottom: none;
}

.account-item:hover {
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 2px 8px rgba(119, 163, 235, 0.1);
}

.account-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-label {
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    color: #F7F6F0;
    text-transform: uppercase;
}

.account-description {
    font-size: 18px;
    font-style: normal;
    font-weight: 300;
    line-height: normal;
    color: #F7F6F0;
}

.account-addons {
    font-size: 14px;
    font-style: normal;
    font-weight: 200;
    line-height: normal;
    color: #f7f6f0de;
    margin-top: 4px;
}

.account-price {
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    color: #F7F6F0;
    min-width: 80px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* Estilos para precios en oferta */
.account-price .price-regular {
    font-size: 14px;
    font-weight: 400;
    color: rgba(247, 246, 240, 0.5);
    text-decoration: line-through;
}

.account-price .price-sale {
    font-size: 18px;
    font-weight: 700;
    color: #4ade80;
}

.btn-remove-account {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-remove-account:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
}

.btn-remove-account .icon-trash {
    display: block;
}

/* ============================================
   Botón Añadir Cuenta Principal
   ============================================ */

.btn-add-account-main {
    background: rgba(17, 110, 251, 0.1);
    border: 1px solid rgba(17, 110, 251, 0.3);
    color: #116EFB;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-account-main:hover {
    background: rgba(17, 110, 251, 0.15);
    border-color: #116EFB;
    transform: translateY(-1px);
}

.btn-add-account-main:active {
    transform: translateY(0);
}

.btn-add-account-main.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-add-account-main.loading::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

/* ============================================
   Botón Proceder a Pago
   ============================================ */

#btn-proceed-to-payment {
    background: linear-gradient(135deg, #116EFB 0%, #0E5FD8 100%);
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#btn-proceed-to-payment:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 110, 251, 0.3);
}

#btn-proceed-to-payment:active:not(:disabled) {
    transform: translateY(0);
}

#btn-proceed-to-payment:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

#btn-proceed-to-payment.loading {
    opacity: 0.7;
    cursor: wait;
}

/* ============================================
   Cupón Colapsable
   ============================================ */

.coupon-section {
    margin: 20px 0;
    border-top: 1px solid rgba(247, 246, 240, 0.1);
    padding-top: 16px;
}

.coupon-toggle {
    width: 100%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    padding: 8px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
    text-align: left;
}

.coupon-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.coupon-toggle .arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.coupon-content {
    overflow: hidden;
    transition: all 0.3s ease;
    padding-top: 12px;
}

.coupon-content.collapsed {
    display: none;
}

.coupon-field {
    display: flex;
    gap: 8px;
}

.coupon-field input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(247, 246, 240, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.coupon-field input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.coupon-field button {
    background: rgba(17, 110, 251, 0.1);
    border: 1px solid rgba(17, 110, 251, 0.3);
    color: #116EFB;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.coupon-field button:hover {
    background: rgba(17, 110, 251, 0.15);
    border-color: #116EFB;
}

/* ============================================
   Toast de Notificaciones
   ============================================ */

.noctorial-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #ffffff;
    color: #333333;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    display: none;
    max-width: 350px;
    animation: slideInUp 0.3s ease;
}

.noctorial-toast.success {
    background: #10b981;
    color: #ffffff;
}

.noctorial-toast.error {
    background: #ef4444;
    color: #ffffff;
}

.noctorial-toast.info {
    background: #3b82f6;
    color: #ffffff;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes loading-dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ============================================
   Mini-Resumen (Paso 2)
   ============================================ */

.mini-summary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(247, 246, 240, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.mini-summary h4 {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-top: 1px solid rgba(247, 246, 240, 0.1);
    margin-top: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #116EFB;
}

/* ============================================
   Responsive Tablet & Mobile
   ============================================ */

@media (max-width: 1024px) {
    /* Cambiar layout a una sola columna */
    .onepage-checkout-container[data-step="configuration"] {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Quitar sticky del resumen en móvil */
    .resumen-cuentas {
        position: static;
        max-height: none;
    }
    
    /* Mantener layout horizontal en tablet también */
    .account-main {
        flex-wrap: nowrap;
        gap: 12px;
    }
    
    .account-info {
        flex: 1;
        min-width: 0;
    }
    
    .account-description {
        font-size: 17px;
    }
    
    .account-price {
        flex-shrink: 0;
    }
    
    .btn-remove-account {
        flex-shrink: 0;
    }
}

/* ============================================
   Responsive Mobile
   ============================================ */

@media (max-width: 768px) {
    .checkout-tabs {
        gap: 8px;
    }
    
    .checkout-tab {
        font-size: 14px;
        padding: 8px 14px;
    }
    
    .checkout-tab .tab-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .accounts-banner {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .btn-add-account-small {
        width: 100%;
        text-align: center;
    }
    
    /* Mantener todo horizontal en móvil */
    .account-main {
        flex-wrap: nowrap;
        gap: 12px;
    }
    
    /* Ajustar información de cuenta para que ocupe el espacio disponible */
    .account-info {
        flex: 1;
        min-width: 0;
    }
    
    /* Hacer que la descripción sea más compacta */
    .account-description {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Precios más compactos en móvil pero mantener vertical */
    .account-price {
        min-width: 70px;
        flex-shrink: 0;
    }
    
    /* Botón de eliminar más compacto */
    .btn-remove-account {
        padding: 4px;
        flex-shrink: 0;
    }
    
    .noctorial-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

