/**
 * Estilos para el Formulario de Viajes VOGE
 * Versión: 1.7
 *
 * Estructura:
 * 1. FUENTES Y CONFIGURACIÓN GENERAL
 * 2. ESTRUCTURA DEL FORMULARIO
 * 3. TIPOGRAFÍA (Labels, Títulos, Párrafos)
 * 4. CAMPOS DE FORMULARIO (Inputs, Selects, Textarea)
 * 5. BOTONES
 * 6. PREVISUALIZACIÓN DE IMÁGENES
 * 7. ELEMENTOS DINÁMICOS (Overlay, Spinner)
 * 8. VENTANA MODAL (Cropper)
 * 9. ANIMACIONES
 */

/* -------------------------------------------------------------------------- */
/* 1. FUENTES Y CONFIGURACIÓN GENERAL                      */
/* -------------------------------------------------------------------------- */
/*
 * Para que la tipografía Barlow funcione, asegúrate de que tu tema la esté cargando.
 * Si no es así, puedes añadir el siguiente código en el functions.php de tu tema hijo:
 *
 * function theme_enqueue_google_fonts() {
 * wp_enqueue_style( 'google-fonts-barlow', 'https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,500;1,500&display=swap', false );
 * }
 * add_action( 'wp_enqueue_scripts', 'theme_enqueue_google_fonts' );
 *
*/

/* -------------------------------------------------------------------------- */
/* 2. ESTRUCTURA DEL FORMULARIO                        */
/* -------------------------------------------------------------------------- */
.form-container { 
    max-width: 600px; 
    margin: auto; 
    position: relative;
    font-family: 'Barlow', sans-serif;
}

.form-step { 
    display: none; 
}

.form-step.active { 
    display: block; 
}

/* -------------------------------------------------------------------------- */
/* 3. TIPOGRAFÍA (Labels, Títulos, Párrafos)                   */
/* -------------------------------------------------------------------------- */
.form-container h3 {
    margin-bottom: 2em;
}

.form-container label { 
    display: block; 
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 18px;
    margin-top: 15px; 
}

#step-3 h2 {
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-style: italic;
    font-size: 56px;
    line-height: 1.2; 
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: #254F57;
    text-align: center;
}

#step-3 p {
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.4;
    text-align: center;
}

/* -------------------------------------------------------------------------- */
/* 4. CAMPOS DE FORMULARIO (Inputs, Selects, etc)               */
/* -------------------------------------------------------------------------- */
.form-container input[type="text"],
.form-container select, 
.form-container textarea { 
    width: 100%; 
    height: 56px;
    padding: 10px; 
    margin-top: 5px; 
    margin-bottom: 16px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #CCCCCC;
    background-color: #FFFFFF;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #333;
}

.form-container textarea {
    height: auto;
}

.form-container input::placeholder,
.form-container textarea::placeholder {
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #818181;
}

.radio-group-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 16px;
}

.radio-group-container label {
    margin-top: 0;
    margin-right: 20px;
    font-weight: normal;
}

.form-container input[type="radio"] {
    width: auto;
    height: auto;
    margin-right: 5px;
    margin-bottom: 0;
}

/* -------------------------------------------------------------------------- */
/* 5. BOTONES                                 */
/* -------------------------------------------------------------------------- */
.form-navigation-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.form-navigation-buttons button,
.form-navigation-buttons button[type="submit"] {
    background-color: #254F57;
    border: none;
    border-radius: 8px;
    height: 56px;
    width: 172px;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #FFFFFF;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.form-navigation-buttons button:hover {
    background-color: #1a3a3f;
}

/* -------------------------------------------------------------------------- */
/* 6. PREVISUALIZACIÓN DE IMÁGENES                      */
/* -------------------------------------------------------------------------- */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 5px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    min-height: 50px;
}

.image-preview-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.image-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.image-preview-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    line-height: 18px;
    font-family: sans-serif;
    transition: transform 0.2s;
}

.image-preview-remove:hover {
    transform: scale(1.1);
}

/* -------------------------------------------------------------------------- */
/* 7. ELEMENTOS DINÁMICOS (Overlay, Spinner)                 */
/* -------------------------------------------------------------------------- */
.form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 5px;
    text-align: center;
}

.form-spinner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner-message {
    font-weight: bold;
    color: #333;
}

.form-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

/* -------------------------------------------------------------------------- */
/* 8. VENTANA MODAL (Cropper)                         */
/* -------------------------------------------------------------------------- */
#voge-crop-modal {
    position: fixed;
    inset: 0; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Se activa con JS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#voge-crop-modal .modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    position: absolute;
    top: 10vw;
    left: 50vw;
    transform: translate(-50%, 0); /* centrado horizontal */
    box-sizing: border-box;
    overflow: hidden; /* evita desbordes del cropper */
}

#voge-crop-modal .img-container {
  width: 100%;
  height: calc(100% - 64px); /* deja espacio para el título/botón */
  max-height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
}

/* Asegurar que el Cropper no exceda el popup */
#voge-crop-modal .cropper-container,
#voge-crop-modal .cropper-wrap-box,
#voge-crop-modal .cropper-canvas,
#voge-crop-modal .cropper-view-box {
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Imagen base */
#voge-crop-modal #image-to-crop {
  max-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Botón recortar a ancho completo */
#voge-crop-modal #crop-button {
  width: 100%;
  margin-top: 12px;
}

/* Responsive: tablet/móvil — centrar y limitar por viewport */
@media (max-width: 1023px) {
  #voge-crop-modal .modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 90vw;
    height: auto;
    max-height: 90vh;
  }
  #voge-crop-modal .img-container {
    height: calc(90vh - 120px); /* ajusta según el alto de header/botón */
  }
}


/* -------------------------------------------------------------------------- */
/* 9. ANIMACIONES                               */
/* -------------------------------------------------------------------------- */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* -------------------------------------------------------------------------- */
/* 10. Estilos para el Metabox de Viajes VOGE en el Admin */
/* -------------------------------------------------------------------------- */
/* Contenedor del uploader de imagen única */
.voge-image-uploader .voge-image-preview img {
    max-width: 150px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Contenedor de la galería */
.voge-gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.voge-gallery-preview li {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100px;
    height: 100px;
    cursor: move;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.voge-gallery-preview li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botón para borrar imagen de la galería */
.voge-remove-gallery-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #d63638; /* Rojo de WordPress */
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    border: 1px solid #fff;
    cursor: pointer;
    font-weight: bold;
    line-height: 20px;
    padding: 0;
    text-align: center;
    transition: background-color 0.2s;
}

.voge-remove-gallery-image:hover {
    background: #a02728;
}

/* Acepto recibir... — checkbox grande y alineado */
.acceptance-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}

.acceptance-container input[type="checkbox"] {
  width: 25px;
  height: 25px;
  min-width: 25px;
  min-height: 25px;
  /* Mantener apariencia nativa y permitir color del tema si existe */
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
  accent-color: #111; /* ajustá al color de marca si querés */
  cursor: pointer;
}

.acceptance-container label {
  display: inline-block; /* asegura que quede al lado, no abajo */
  line-height: 40px;
}

/* Slider ancho completo */
#road_type_slider {
  width: 100%;
  display: block;
}

/* Labels del slider en extremos */
.slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

#asphalt-label,
#gravel-label {
  white-space: nowrap;
  font-weight: 600; /* opcional */
}
