/* ============================================
   FORM OVERLAY - ESTILO REACT
   ============================================ */

/* ---------- OVERLAY PRINCIPAL ---------- */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.form-overlay.active {
    display: block !important;
    opacity: 1;
}

.form-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
    cursor: pointer;
}

/* ---------- CONTENEDOR DEL OVERLAY ---------- */
.form-overlay-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-overlay.active .form-overlay-container {
    transform: translate(-50%, -50%) scale(1);
}

/* ---------- HEADER DEL OVERLAY ---------- */
.form-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: #f8f9fa;
    border-bottom: 2px solid #000;
}

.form-overlay-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-overlay-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.form-overlay-icon {
    font-size: 24px;
}

.form-overlay-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: transparent !important;
}

.form-overlay-close:hover {
    background: #e9ecef !important;
    color: #000;
    transform: rotate(90deg);
}

/* ---------- RESUMEN EN EL OVERLAY ---------- */
.form-overlay-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: #f1f3f5;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.summary-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    flex: 0 0 auto; /* No crece, no se encoge */
}

.summary-badge .badge-color,
.summary-badge .badge-size {
    font-size: 16px;
}

.summary-badge .badge-text {
    color: #333;
}

.summary-price {
    background: #000;
    color: #fff;
    font-weight: bold;
    flex: 0 0 auto; /* No crece, no se encoge */
    margin-left: auto; /* Mantiene el precio a la derecha */
}

.summary-price span {
    color: #fff;
}

/* ---------- CUERPO DEL FORMULARIO ---------- */
.form-overlay-body {
    padding: 24px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.form-overlay-body::-webkit-scrollbar {
    width: 4px;
}

.form-overlay-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.form-overlay-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.form-overlay-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ---------- CAMPOS DEL FORMULARIO ---------- */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.form-row-2col .form-group {
    flex: 1;
    min-width: 140px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.form-group label i {
    margin-right: 4px;
    color: #666;
}

.form-group .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group .form-control:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.form-group .form-control::placeholder {
    color: #aaa;
}

/* ---------- BOTONES DE ACCIÓN ---------- */
.form-overlay-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    border: 1.5px solid #ddd;
    background: transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.btn-cancel:hover {
    background: #f1f3f5;
    border-color: #999;
}

.btn-submit {
    flex: 2;
    padding: 12px;
    border: none;
    background: #58d58d;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover {
    background: #27AE60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ---------- TÉRMINOS ---------- */
.form-terms {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f1f1f1;
}

.form-terms a {
    color: #000;
    text-decoration: underline;
    font-weight: 500;
}

.form-terms a:hover {
    color: #333;
}

/* ---------- BOTÓN CONTINUAR ---------- */
.btn-continuar {
    width: 100%;
    padding: 16px 24px;
    background: #cccccc;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: not-allowed;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0.5;
    margin-top: 20px;
}

.btn-continuar.btn-active {
    background: #58d58d;
    color: #fff;
    opacity: 1;
    cursor: pointer;
}

.btn-continuar.btn-active:hover {
    background: #27AE60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-continuar.btn-active:active {
    transform: translateY(0);
}

/* ---------- SECCIONES DE SELECCIÓN ---------- */
.selection-section {
    padding: 10px 0;
    transition: border 0.3s ease;
}

.selection-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.selection-status {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: #999;
}

.selection-status .status-ok {
    color: #28a745;
    font-weight: 500;
}

/* ---------- ESTILOS PARA BOTONES DE SELECCIÓN ---------- */
.color-options,
.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.color-btn {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    min-width: 100px;
    justify-content: center;
    position: relative;
}

.color-btn:hover {
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.color-btn.selected {
    border-color: #000;
    background: #f8f9fa;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.color-btn .color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.color-btn .color-name {
    font-size: 12px;
    font-weight: 600;
}

.color-btn .check-mark {
    display: none;
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
    margin-left: 4px;
}

.color-btn.selected .check-mark {
    display: inline;
}

/* ============================================
   BOTONES DE TALLA - CORREGIDOS (JUNTOS)
   ============================================ */

.size-btn {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 500;
    min-width: 60px;
    position: relative;
    line-height: 1.2;
    flex-direction: row !important;
    flex: 0 0 auto;
}

.size-btn:hover {
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.size-btn.selected {
    border-color: #000;
    background: #f8f9fa;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.size-btn .size-number {
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.size-btn .size-cm {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

.size-btn .check-mark {
    display: none;
    color: #28a745;
    font-weight: bold;
    font-size: 14px;
    position: absolute;
    top: -8px;
    right: -8px;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
}

.size-btn.selected .check-mark {
    display: inline;
}

/* ---------- RESUMEN DE SELECCIÓN ---------- */
.selection-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 10px 0;
    border-left: 4px solid #000;
}

.summary-content {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.summary-label {
    color: #666;
    font-weight: 500;
}

.summary-value {
    font-weight: 700;
    color: #000;
}

/* ---------- ANIMACIONES ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   RESPONSIVE - PRECIO AL LADO EN MÓVIL
   ============================================ */

/* ---------- TABLET (max-width: 768px) ---------- */
@media (max-width: 768px) {
    .form-overlay-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .form-overlay-header {
        padding: 14px 18px;
    }

    .form-overlay-title h3 {
        font-size: 17px;
    }

    .form-overlay-summary {
        padding: 10px 18px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
    }

    .summary-badge {
        font-size: 12px;
        padding: 4px 10px;
        flex: 0 0 auto;
    }

    .summary-price {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .form-overlay-body {
        padding: 18px;
        max-height: calc(95vh - 160px);
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-row-2col .form-group {
        min-width: 100%;
    }

    .form-group {
        min-width: 100%;
    }

    .form-overlay-actions {
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-submit {
        flex: 1;
    }

    .btn-continuar {
        font-size: 16px;
        padding: 14px 20px;
    }

    /* Ajuste de botones de talla en tablet */
    .size-btn {
        padding: 6px 10px;
        min-width: 55px;
        gap: 2px;
    }

    .size-btn .size-number {
        font-size: 14px;
    }

    .size-btn .size-cm {
        font-size: 9px;
    }
}

/* ---------- MÓVIL (max-width: 480px) ---------- */
@media (max-width: 480px) {
    .form-overlay-container {
        width: 98%;
        border-radius: 8px;
    }

    .form-overlay-header {
        padding: 12px 14px;
    }

    .form-overlay-title h3 {
        font-size: 15px;
    }

    .form-overlay-summary {
        padding: 8px 14px;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
    }

    .summary-badge {
        font-size: 11px;
        padding: 3px 8px;
        flex: 0 0 auto;
    }

    .summary-price {
        margin-left: auto;
        flex: 0 0 auto;
        font-size: 11px;
        padding: 3px 10px;
    }

    .form-overlay-body {
        padding: 14px;
    }

    .form-group .form-control {
        padding: 8px 12px;
        font-size: 13px;
    }

    .btn-cancel,
    .btn-submit {
        font-size: 14px;
        padding: 10px;
    }

    .form-overlay-close {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .color-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 75px;
    }

    .color-btn .color-preview {
        width: 18px;
        height: 18px;
    }

    /* Ajuste de botones de talla en móvil */
    .size-btn {
        padding: 5px 8px;
        min-width: 48px;
        gap: 2px;
    }

    .size-btn .size-number {
        font-size: 13px;
    }

    .size-btn .size-cm {
        font-size: 8px;
    }

    .btn-continuar {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* ---------- MÓVIL MUY PEQUEÑO (max-width: 360px) ---------- */
@media (max-width: 360px) {
    .form-overlay-summary {
        gap: 4px;
        padding: 6px 10px;
    }

    .summary-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .summary-price {
        font-size: 10px;
        padding: 2px 8px;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .color-btn {
        min-width: calc(50% - 6px);
        font-size: 11px;
        padding: 6px 8px;
    }

    .size-btn {
        min-width: calc(33.33% - 6px);
        padding: 4px 6px;
        gap: 1px;
    }

    .size-btn .size-number {
        font-size: 12px;
    }

    .size-btn .size-cm {
        font-size: 7px;
    }

    .btn-continuar {
        font-size: 12px;
        padding: 10px 12px;
        gap: 6px;
    }
    
    .btn-continuar i {
        font-size: 12px;
    }
}