/* ================================================================
   WC Quote System — Frontend CSS
   ================================================================ */

/* ── BOTÓN EN EL CARRITO PRINCIPAL ─────────────────────────────── */
.wcqs-btn-quote {
  margin-top: 10px !important;
}
.wcqs-btn-quote-minicart {
  margin-top: 8px !important;
}

/* ── OVERLAY ─────────────────────────────────────────────────────── */
.wcqs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* ── MODAL WIDE (dos columnas) ──────────────────────────────────── */
.wcqs-modal-wide {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
  animation: wcqs-slide-in .22s ease;
  display: flex;
  flex-direction: column;
}
@keyframes wcqs-slide-in {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── HEADER DEL MODAL ───────────────────────────────────────────── */
.wcqs-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 28px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.wcqs-modal-header-icon {
  width: 36px;
  height: 36px;
  background: #fff4ec;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e07b2a;
  flex-shrink: 0;
}
.wcqs-modal-title {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #1a1a2e !important;
  margin: 0 !important;
  flex: 1;
}
.wcqs-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 4px;
  margin-left: auto;
}
.wcqs-modal-close:hover { color: #333; }

/* ── BODY: DOS COLUMNAS ─────────────────────────────────────────── */
.wcqs-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
}

/* Columna izquierda — formulario */
.wcqs-col-form {
  padding: 24px 28px;
  border-right: 1px solid #f0f0f0;
}
.wcqs-col-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.wcqs-col-subtitle {
  font-size: 12px;
  color: #999;
  margin: 0 0 16px;
}

/* Inputs del formulario — sin labels, solo placeholders */
.wcqs-col-form .wcqs-field {
  margin-bottom: 10px;
}
.wcqs-col-form .wcqs-field input[type="text"],
.wcqs-col-form .wcqs-field input[type="email"],
.wcqs-col-form .wcqs-field input[type="tel"],
.wcqs-col-form .wcqs-field input[type="password"],
.wcqs-col-form .wcqs-field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #fafafa;
  transition: border .2s, background .2s;
  box-sizing: border-box;
  outline: none;
}
.wcqs-col-form .wcqs-field input:focus,
.wcqs-col-form .wcqs-field textarea:focus {
  border-color: #e07b2a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(224,123,42,.08);
}
.wcqs-col-form .wcqs-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── USUARIO LOGUEADO ───────────────────────────────────────────── */
.wcqs-logged-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.wcqs-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e07b2a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 15px;
  flex-shrink: 0;
}
.wcqs-logged-info div { display: flex; flex-direction: column; }
.wcqs-logged-info strong { font-size: 13px; color: #333; }
.wcqs-logged-info span   { font-size: 12px; color: #888; }

/* ── CHECKBOX CREAR CUENTA ──────────────────────────────────────── */
.wcqs-field-check {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.wcqs-check-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #333 !important;
}
.wcqs-check-label input[type="checkbox"] { width: auto; margin: 0; accent-color: #e07b2a; }
.wcqs-check-hint { font-size: 11px; color: #aaa; margin: 4px 0 0 22px; }

/* ── COLUMNA DERECHA — resumen ──────────────────────────────────── */
.wcqs-col-summary {
  padding: 24px 28px;
  background: #f7f8fa;
  border-radius: 0 0 0 0;
}

.wcqs-summary-items {
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wcqs-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ebebeb;
}
.wcqs-summary-item:last-child { border-bottom: none; }
.wcqs-summary-item-name {
  font-size: 13px;
  color: #333;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.wcqs-summary-item-name small { font-size: 11px; color: #999; }
.wcqs-summary-item-price {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.wcqs-summary-totals {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1.5px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wcqs-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #555;
}
.wcqs-summary-total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1.5px solid #e0e0e0;
}
.wcqs-summary-total span:first-child {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
}
.wcqs-summary-total span:last-child {
  font-size: 15px;
  font-weight: 700;
  color: #e07b2a;
}

/* ── FOOTER CON BOTONES ─────────────────────────────────────────── */
.wcqs-modal-footer {
  display: flex;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  border-radius: 0 0 12px 12px;
  flex-shrink: 0;
}
.wcqs-btn-cancel {
  flex: 1;
  padding: 13px 20px;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.wcqs-btn-cancel:hover { border-color: #999; color: #333; }

.wcqs-btn-confirm {
  flex: 2;
  padding: 13px 28px;
  background: #e07b2a;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.wcqs-btn-confirm:hover { background: #c96a1c; }
.wcqs-btn-confirm:disabled { opacity: .65; cursor: wait; }

/* ── SPINNER ────────────────────────────────────────────────────── */
.wcqs-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wcqs-spin .6s linear infinite;
}
@keyframes wcqs-spin { to { transform: rotate(360deg); } }

/* ── ALERTAS ────────────────────────────────────────────────────── */
.wcqs-alert {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  margin-top: 10px;
}
.wcqs-alert-error   { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }
.wcqs-alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* ── ESTADO ÉXITO ───────────────────────────────────────────────── */
.wcqs-success-wrap {
  padding: 40px 32px;
  text-align: center;
}
.wcqs-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #27ae60;
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.wcqs-success-number {
  font-size: 16px;
  font-weight: bold;
  color: #1a1a2e;
  margin: 0 0 6px;
}
.wcqs-success-msg {
  font-size: 13px;
  color: #888;
  margin-bottom: 22px;
}
.wcqs-success-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.wcqs-btn-action-pdf {
  padding: 11px 22px;
  background: #e07b2a;
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none !important;
  transition: background .2s;
}
.wcqs-btn-action-pdf:hover { background: #c96a1c; }
.wcqs-btn-action-email {
  padding: 11px 22px;
  background: #fff;
  border: 1.5px solid #e07b2a;
  color: #e07b2a;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.wcqs-btn-action-email:hover { background: #e07b2a; color: #fff; }
.wcqs-modal-close-text {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  font-size: 12px;
  color: #bbb;
  cursor: pointer;
  text-decoration: underline;
}
.wcqs-print-hint {
  font-size: 12px;
  color: #7f6000;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px auto;
  max-width: 380px;
  line-height: 1.5;
  text-align: left;
}

/* ── DATOS FISCALES (toggle en modal) ──────────────────────────── */
.wcqs-fiscal-toggle { margin: 12px 0 0; }
.wcqs-fiscal-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #e07b2a;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
}
.wcqs-fiscal-toggle-icon { display: inline-block; transition: transform .2s; font-size: 10px; }
.wcqs-fiscal-toggle-btn.open .wcqs-fiscal-toggle-icon { transform: rotate(90deg); }
.wcqs-fiscal-optional { font-weight: 400; color: #aaa; font-size: 11px; }
.wcqs-fiscal-fields {
  margin-top: 10px;
  padding: 14px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #eee;
}
.wcqs-fiscal-row { display: grid; gap: 8px; margin-bottom: 8px; }
.wcqs-fiscal-row:last-child { margin-bottom: 0; }
.wcqs-fiscal-row-2 { grid-template-columns: 1fr 1fr; }
.wcqs-fiscal-row-3 { grid-template-columns: 2fr 1fr 1fr; }
.wcqs-fiscal-fields .wcqs-field label { font-size: 11px; color: #666; margin-bottom: 3px; display: block; }
.wcqs-fiscal-fields .wcqs-field input,
.wcqs-fiscal-fields .wcqs-field select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}
.wcqs-fiscal-fields .wcqs-field input:focus,
.wcqs-fiscal-fields .wcqs-field select:focus {
  outline: none;
  border-color: #e07b2a;
}
.wcqs-fiscal-complete-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #27ae60; background: #eafaf1;
  border: 1px solid #a9dfbf; border-radius: 12px; padding: 2px 10px; margin-left: 8px;
}
.wcqs-fiscal-incomplete-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #e07b2a; background: #fef5ec;
  border: 1px solid #f5cba7; border-radius: 12px; padding: 2px 10px; margin-left: 8px;
}
.wcqs-fiscal-account .wcqs-fiscal-fields { background: #fff; border: none; padding: 0; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .wcqs-modal-body { grid-template-columns: 1fr; }
  .wcqs-col-form   { border-right: none; border-bottom: 1px solid #f0f0f0; padding: 20px; }
  .wcqs-col-summary { padding: 20px; }
  .wcqs-modal-footer { padding: 16px 20px; }
  .wcqs-modal-header { padding: 16px 20px; }
  .wcqs-fiscal-row-2,
  .wcqs-fiscal-row-3 { grid-template-columns: 1fr; }
}

/* ── CAMPO CONTRASEÑA CON OJITO ───────────────────────────────── */
.wcqs-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.wcqs-password-wrap #wcqs-password {
  padding-right: 42px !important;
  flex: 1;
}
.wcqs-password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color .2s;
}
.wcqs-password-toggle:hover { color: #e07b2a; }

/* ── DOS CAMPOS EN UNA FILA (empresa / ciudad) ───────────────── */
.wcqs-field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 480px) {
  .wcqs-field-row-2 { grid-template-columns: 1fr; }
}
