/* ===========================
   INTERFAZ MONTERREY — Quote Modal v1
   Dark glass enterprise aesthetic
   =========================== */

/* ── Animations ─────────────────────────────────────────────── */
@keyframes qmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes qmSlideUp {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes qmSpinStep {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Backdrop ───────────────────────────────────────────────── */
.qm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px;
  animation: qmFadeIn 0.22s ease both;
}

.qm-backdrop[hidden] {
  display: none;
}

/* ── Panel ──────────────────────────────────────────────────── */
.qm-panel {
  position: relative;
  width: calc(100% - 32px);
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0e0e0e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: qmSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.qm-panel::-webkit-scrollbar {
  width: 4px;
}
.qm-panel::-webkit-scrollbar-track {
  background: transparent;
}
.qm-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

/* ── Header ─────────────────────────────────────────────────── */
.qm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.07) 0%, transparent 100%);
  border-radius: 18px 18px 0 0;
}

.qm-header-info {
  flex: 1;
  min-width: 0;
}

.qm-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e50914;
  margin-bottom: 4px;
}

.qm-dialog-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.2;
}

.qm-product-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qm-product-badge[hidden] {
  display: none;
}

.qm-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  margin-left: 12px;
  margin-top: 2px;
}

.qm-close:hover {
  background: rgba(229, 9, 20, 0.25);
  color: #fff;
}

/* ── Body ───────────────────────────────────────────────────── */
.qm-body {
  padding: 20px 24px 4px;
}

/* ── Type Toggle ────────────────────────────────────────────── */
.qm-type-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
  gap: 3px;
}

.qm-type-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}

.qm-type-btn.active {
  background: #e50914;
  color: #fff;
  box-shadow: 0 2px 12px rgba(229, 9, 20, 0.4);
}

.qm-type-btn:not(.active):hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.75);
}

/* ── Form ───────────────────────────────────────────────────── */
.qm-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.qm-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.qm-section-label:first-child {
  margin-top: 0;
}

/* Two-column grid */
.qm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* ── Field ──────────────────────────────────────────────────── */
.qm-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.qm-field--full {
  grid-column: 1 / -1;
}

.qm-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
}

/* ── Inputs ─────────────────────────────────────────────────── */
.qm-input,
.qm-select,
.qm-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  padding: 11px 14px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.qm-input::placeholder,
.qm-textarea::placeholder {
  color: rgba(255, 255, 255, 0.22);
}

.qm-input:focus,
.qm-select:focus,
.qm-textarea:focus {
  border-color: #e50914;
  background: rgba(229, 9, 20, 0.05);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.12);
}

.qm-input.error,
.qm-select.error,
.qm-textarea.error {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.06);
}

.qm-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.35)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.qm-select option {
  background: #1a1a1a;
  color: #fff;
}

.qm-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}

/* ── Rental Fields (conditional section) ────────────────────── */
.qm-rental-fields {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.qm-rental-fields.visible {
  max-height: 500px;
  opacity: 1;
}

/* ── Error bar ──────────────────────────────────────────────── */
.qm-error {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 8px;
  color: #ff7777;
  font-size: 13px;
  padding: 10px 14px;
  margin-top: 10px;
  line-height: 1.4;
}

.qm-error[hidden] {
  display: none;
}

/* ── Submit button ──────────────────────────────────────────── */
.qm-submit {
  width: 100%;
  margin-top: 18px;
  margin-bottom: 4px;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #e50914 0%, #c0060f 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.18s, transform 0.15s, box-shadow 0.18s;
  box-shadow: 0 4px 18px rgba(229, 9, 20, 0.35);
}

.qm-submit:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(229, 9, 20, 0.5);
  transform: translateY(-1px);
}

.qm-submit:active:not(:disabled) {
  transform: translateY(0);
}

.qm-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.qm-submit-spinner {
  display: inline-flex;
  align-items: center;
}

.qm-submit-spinner[hidden] {
  display: none;
}

.qm-submit-spinner svg {
  animation: qmSpinStep 0.9s linear infinite;
}

/* ── Success state ──────────────────────────────────────────── */
.qm-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px 20px;
}

.qm-success[hidden] {
  display: none;
}

.qm-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 2px solid rgba(34, 197, 94, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
  margin-bottom: 18px;
  animation: qmSlideUp 0.3s ease both;
}

.qm-success-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.qm-success-msg {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  max-width: 340px;
  margin-bottom: 22px;
}

.qm-wa-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: #25d366;
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  margin-bottom: 12px;
}

.qm-wa-cta:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
}

.qm-close-success {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  padding: 8px 18px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.qm-close-success:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}

/* ── Footer brand ───────────────────────────────────────────── */
.qm-footer-brand {
  padding: 12px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.18);
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 18px 18px;
}

.qm-footer-brand span {
  color: rgba(229, 9, 20, 0.6);
  font-weight: 800;
}

/* ── Product card quote buttons ─────────────────────────────── */
.card-quote-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: #e50914;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.card-quote-modal-btn:hover {
  background: #c0060f;
  transform: translateY(-1px);
}

.card-rent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  background: rgba(255, 106, 0, 0.15);
  border: 1px solid rgba(255, 106, 0, 0.35);
  color: #ff6a00;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  margin-left: 6px;
}

.card-rent-btn:hover {
  background: rgba(255, 106, 0, 0.28);
  border-color: rgba(255, 106, 0, 0.55);
}

/* ── Detail page quote modal buttons ────────────────────────── */
.btn-quote-modal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #e50914 0%, #c0060f 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.3);
  text-decoration: none;
}

.btn-quote-modal:hover {
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.45);
  transform: translateY(-1px);
}

.btn-rent-modal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid rgba(255, 106, 0, 0.4);
  color: #ff6a00;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  text-decoration: none;
}

.btn-rent-modal:hover {
  background: rgba(255, 106, 0, 0.1);
  border-color: rgba(255, 106, 0, 0.65);
}

/* ── Mobile — bottom sheet style on small screens ──────────── */
@media (max-width: 600px) {
  .qm-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .qm-panel {
    width: 100%;
    max-width: 100%;
    max-height: 93vh;
    border-radius: 20px 20px 0 0;
    animation-name: qmSlideUp;
  }

  .qm-grid-2 {
    grid-template-columns: 1fr;
  }

  .qm-header {
    padding: 18px 18px 14px;
  }

  .qm-body {
    padding: 16px 18px 4px;
  }

  .qm-footer-brand {
    padding: 10px 18px 18px;
  }
}
