/**
 * MVX Booking - Estilos Frontend para Formularios Modulares
 * @version 3.2.2
 */

:root {
  --mvxb-primary: #0E332E;
  --mvxb-primary-hover: #16463f;
  --mvxb-accent: #22c55e;
  --mvxb-border: #d1d5db;
  --mvxb-bg-light: #f9fafb;
  --mvxb-text-main: #1f2937;
  --mvxb-text-muted: #6b7280;
  --mvxb-radius: 8px;
  --mvxb-danger: #ef4444;
}

.mvxb-product-form-wrapper {
  margin-top: 25px;
  width: 100%;
}

.mvxb-form {
  background: #ffffff;
  border: 1px solid var(--mvxb-border);
  border-radius: var(--mvxb-radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

/* Secciones y Títulos */
.mvxb-form-section {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f3f4f6;
}

.mvxb-form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 10px;
}

.mvxb-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mvxb-primary);
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
}

/* Grids */
.mvxb-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.mvxb-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .mvxb-grid-2,
  .mvxb-grid-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Campos e Inputs */
.mvxb-field {
  display: flex;
  flex-direction: column;
}

.mvxb-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mvxb-text-main);
  margin-bottom: 6px;
}

.mvxb-req {
  color: var(--mvxb-danger);
  margin-left: 2px;
}

.mvxb-input,
.mvxb-select,
.mvxb-textarea,
.mvxb-input-file {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--mvxb-border);
  border-radius: 6px;
  font-size: 0.925rem;
  color: var(--mvxb-text-main);
  background-color: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mvxb-input:focus,
.mvxb-select:focus,
.mvxb-textarea:focus {
  outline: none;
  border-color: var(--mvxb-primary);
  box-shadow: 0 0 0 3px rgba(14, 51, 46, 0.12);
}

.mvxb-input--readonly {
  background-color: var(--mvxb-bg-light);
  color: var(--mvxb-text-muted);
  cursor: not-allowed;
}

.mvxb-textarea {
  resize: vertical;
  min-height: 85px;
}

.mvxb-help-text {
  font-size: 0.775rem;
  color: var(--mvxb-text-muted);
  margin-top: 5px;
  line-height: 1.3;
}

/* Pestañas Selector de Vehículo (VIN vs Manual) */
.mvxb-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.mvxb-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--mvxb-bg-light);
  border: 1px solid var(--mvxb-border);
  border-radius: 6px;
  color: var(--mvxb-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mvxb-tab-btn.active {
  background: var(--mvxb-primary);
  border-color: var(--mvxb-primary);
  color: #ffffff;
}

.mvxb-tab-panel {
  display: block;
}

/* Botones de Envío */
.mvxb-form-actions {
  margin-top: 18px;
}

.mvxb-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  background-color: var(--mvxb-primary);
  color: #ffffff;
  font-size: 0.975rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.mvxb-btn-submit:hover {
  background-color: var(--mvxb-primary-hover);
  color: #ffffff;
}

.mvxb-btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Spinner de Carga */
.mvxb-spinner {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: mvxb-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes mvxb-spin {
  to { transform: rotate(360deg); }
}

/* Caja de Respuestas / Mensajes */
.mvxb-response-msg {
  margin-top: 15px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.mvxb-response-msg--success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.mvxb-response-msg--error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Estilos Específicos Formulario 4 (WhatsApp) */
.mvxb-form--wsp {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.mvxb-wsp-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--mvxb-radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mvxb-wsp-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.mvxb-wsp-icon-wrap {
  flex-shrink: 0;
}

.mvxb-wsp-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mvxb-primary);
  margin: 0 0 6px 0;
}

.mvxb-wsp-desc {
  font-size: 0.85rem;
  color: var(--mvxb-text-muted);
  margin: 0;
  line-height: 1.4;
}

.mvxb-btn-wsp {
  background-color: #25D366;
}

.mvxb-btn-wsp:hover {
  background-color: #1ebe57;
}

/* ── Previsualización de Fotos Adjuntas (Forms 2 y 3) ─────────────────────── */
.mvxb-file-preview-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mvxb-file-preview-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--mvxb-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}