/**
 * Estilos para el Cotizador Jesucomer Frontend
 * Diseño responsive que se adapta al tema de WordPress
 */

/* === BASE STYLES === */
.cotizador-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
    color: inherit;
    line-height: inherit;
}

.cotizador-wrapper * {
    box-sizing: border-box;
}

/* === TITLE === */
.cotizador-title {
    margin: 0 0 2rem 0;
    padding: 0;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    color: inherit;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 1rem;
}

/* === STEPS INDICATOR === */
.cotizador-steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    position: relative;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 1;
    color: #28a745;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: #007cba;
    color: white;
}

.step-item.completed .step-number {
    background: #28a745;
    color: white;
}

.step-label {
    font-size: 0.8em;
    text-align: center;
    font-weight: 500;
}

/* === STEPS CONTENT === */
.cotizador-step {
    display: none;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cotizador-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

.step-header {
    margin-bottom: 2rem;
    text-align: center;
}

.step-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3em;
    font-weight: 600;
    color: inherit;
}

.step-header p {
    margin: 0;
    color: #6c757d;
    font-size: 0.95em;
}

/* === FORMS === */
.cotizador-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h5 {
    margin: 0 0 1rem 0;
    padding: 0.5rem 0;
    font-size: 1.1em;
    font-weight: 600;
    color: inherit;
    border-bottom: 1px solid #e0e0e0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: inherit;
    font-size: 0.95em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d0d7de;
    border-radius: 0px;
    font-size: 1rem;
    font-family: inherit;
    color: inherit;
    background: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group input:invalid,
.form-group select:invalid {
    border-color: #f5db71;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* === COUNTRY SELECTOR WITH FLAGS === */
.country-selector {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #d0d7de;
    border-radius: 0px;
    background: white;
    transition: all 0.15s ease-in-out;
    overflow: hidden;
}

.country-selector:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.flag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 46px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 1px solid #d0d7de;
    font-size: 1.4em;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.country-select {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    flex: 1;
    padding: 0.75rem !important;
    outline: none !important;
    font-size: 1rem;
    font-family: inherit;
    color: inherit;
}

.country-select:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.country-select option {
    padding: 8px 12px;
    font-size: 1rem;
}

/* === BUTTONS === */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    min-width: 120px;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.btn-primary:hover:not(:disabled) {
    background: #f5db71;
    border-color: #f5db71;
    color: black;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
    border-color: #545b62;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-success:hover:not(:disabled) {
    background: #1e7e34;
    border-color: #1e7e34;
    color: white;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

/* === RESULTS === */
.cotizacion-result {
    margin-top: 2rem;
    animation: slideDown 0.3s ease-out;
}

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

.result-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.result-card h5 {
    margin: 0 0 1rem 0;
    font-size: 1.2em;
    font-weight: 600;
    color: inherit;
}

.result-details {
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.detail-label {
    font-weight: 500;
    color: #6c757d;
}

.detail-value {
    font-weight: bold;
    font-size: 1.1em;
    color: #007cba;
}

/* === CALENDAR SECTION === */
.calendar-section {
    margin: 0 auto;
}

/* === CONFIRMATION === */
.confirmation-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.confirmation-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
}

/* Confirmation Icon */
.confirmation-icon {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.confirmation-card h5 {
    margin: 0 0 1rem 0;
    font-size: 1.3em;
    font-weight: 600;
    color: inherit;
}

.confirmation-card p {
    margin-bottom: 1rem;
    color: inherit;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.loading-spinner {
    text-align: center;
    color: #007cba;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* === RESPONSIVE === */
@media (max-width: 767px) {
    .cotizador-step {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .cotizador-steps-indicator {
        gap: 0.5rem;
    }
    
    .step-label {
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .cotizador-title {
        font-size: 1.3em;
    }
    
    .step-header h4 {
        font-size: 1.2em;
    }
    
    .cotizador-steps-indicator {
        padding: 0.5rem;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8em;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === THEME INTEGRATION === */
.cotizador-wrapper {
    /* Heredar colores del tema */
    color: inherit;
    font-family: inherit;
}

/* Ajustes para temas oscuros */
@media (prefers-color-scheme: dark) {
    .cotizador-step {
        border-color: var(--wp--preset--color--border, #ffffff);
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        border-color: var(--wp--preset--color--border, #404040);
    }
    
    .result-card,
    .confirmation-card {
        background: var(--wp--preset--color--secondary, #2a2a2a);
    }
}
