/* Pedido rápido - Ventana y botón flotante */
.pedido-dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  width: min(92vw, 460px);
  max-height: 90vh;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  margin: auto;
  box-sizing: border-box;
  overflow: hidden;
}

.pedido-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pedido-modal-inner {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 24px 20px 24px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.pedido-modal-header {
  position: relative;
  padding-right: 36px;
  margin-bottom: 18px;
}

.pedido-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.pedido-subtitle {
  font-size: 0.92rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.pedido-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: all 0.15s ease;
}

.pedido-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pedido-close:focus-visible {
  outline: 2px solid #0056ce;
  outline-offset: 2px;
}

/* Floating labels (56px de alto, esquinas suaves) */
.pedido-field {
  position: relative;
  height: 56px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.pedido-field-textarea {
  height: auto;
  min-height: 76px;
}

.pedido-input {
  width: 100%;
  height: 56px;
  padding: 22px 14px 6px 14px;
  font-size: 16px; /* evita auto-zoom en iOS Safari */
  line-height: 1.2;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  font-family: inherit;
}

.pedido-textarea {
  height: auto;
  min-height: 76px;
  resize: vertical;
  padding-top: 24px;
}

.pedido-input:focus {
  border-color: #0056ce;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 86, 206, 0.12);
}

.pedido-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14.5px;
  color: #64748b;
  pointer-events: none;
  transition: all 0.15s ease;
  font-weight: 400;
  user-select: none;
}

.pedido-field-textarea .pedido-label {
  top: 18px;
  transform: none;
}

.pedido-input:focus ~ .pedido-label,
.pedido-input:not(:placeholder-shown) ~ .pedido-label {
  top: 13px;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #0056ce;
}

.pedido-input:not(:focus):not(:placeholder-shown) ~ .pedido-label {
  color: #64748b;
}

/* País: dos botones grandes */
.pedido-country-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 12px 0;
  box-sizing: border-box;
}

.pedido-country-legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pedido-country-options {
  display: flex;
  gap: 10px;
  width: 100%;
}

.pedido-country-label {
  flex: 1 1 0;
  cursor: pointer;
  position: relative;
}

.pedido-country-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pedido-country-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
}

.pedido-country-radio:checked + .pedido-country-btn {
  border-color: #0056ce;
  background: #eef5ff;
  color: #0056ce;
  box-shadow: 0 0 0 1px #0056ce;
}

.pedido-country-radio:focus-visible + .pedido-country-btn {
  outline: 2px solid #0056ce;
  outline-offset: 2px;
}

/* Honeypot */
.pedido-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Consentimiento */
.pedido-consent {
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  margin: 4px 0 16px 0;
}

.pedido-consent a {
  color: #0056ce;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Botón enviar */
.pedido-submit-btn {
  width: 100%;
  height: 52px;
  border-radius: 10px;
  background: #0056ce;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  box-sizing: border-box;
}

.pedido-submit-btn:hover:not(:disabled) {
  background: #0045a5;
}

.pedido-submit-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.pedido-submit-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: 0.85;
}

/* Error banner */
.pedido-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: #991b1b;
  font-size: 13.5px;
  line-height: 1.4;
  box-sizing: border-box;
}

.pedido-error p {
  margin: 0 0 8px 0;
}

.pedido-error-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #25d366;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.pedido-error-wa-btn:hover {
  background: #20ba5a;
}

/* Pantalla de éxito */
.pedido-success-view {
  text-align: center;
  padding: 8px 4px 4px 4px;
}

.pedido-success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px auto;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pedido-success-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.pedido-success-sub {
  font-size: 0.95rem;
  line-height: 1.45;
  color: #475569;
  margin: 0 0 18px 0;
}

.pedido-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border-radius: 10px;
  background: #25d366;
  color: #ffffff;
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.pedido-wa-btn:hover {
  background: #20ba5a;
}

.pedido-wa-btn:active {
  transform: scale(0.99);
}

.pedido-success-email {
  font-size: 13px;
  color: #64748b;
  margin: 14px 0 0 0;
  line-height: 1.4;
}

/* Botón flotante en escritorio y barra fija en celular */
.pedido-floating-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
}

.pedido-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0056ce;
  color: #ffffff !important;
  padding: 13px 22px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 86, 206, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  box-sizing: border-box;
}

.pedido-floating-btn:hover {
  background: #0045a5;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 86, 206, 0.45);
}

.door .button.secondary {
  margin-top: 18px;
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

/* Vista móvil */
@media (max-width: 768px) {
  .pedido-floating-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) 16px;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
  }

  .pedido-floating-btn {
    width: 100%;
    justify-content: center;
    height: 48px;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 16px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 86, 206, 0.25);
  }

  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .pedido-dialog {
    width: 94vw;
    border-radius: 16px;
    margin: auto;
  }

  .pedido-modal-inner {
    padding: 20px 18px 16px 18px;
  }
}
