/* ==========================================================================
   COMPONENTS/QUOTE-MODAL.CSS
   Quote / order modal (includes/quote_modal.php + assets/js/quote_modal.js). Loaded on every page.
   ========================================================================== */

/* ==========================================================================
   MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(46, 42, 74, 0.55);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

/* [UNUSED] Not referenced by any page or script — safe to delete after review.

.modal-custom {
  background: var(--white);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
  margin: auto;
}
*/

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ink);
  border: none;
  cursor: pointer;
}

/* [UNUSED] Not referenced by any page or script — safe to delete after review.

.modal-custom h3 {
  font-size: 22px;
  margin-bottom: 4px;
}

.modal-custom .sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.field select,
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(46, 42, 74, 0.15);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--coral);
}

.seg {
  display: flex;
  background: var(--cream);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.seg button {
  flex: 1;
  padding: 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all .2s ease;
  border: none;
  cursor: pointer;
}

.seg button.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(46, 42, 74, 0.12);
}

.price-box {
  background: var(--ink);
  border-radius: 14px;
  padding: 22px;
  margin: 22px 0;
  color: var(--white);
  text-align: center;
}

.price-box .orig {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
}

.price-box .final {
  font-family: 'Sora', sans-serif;
  font-size: 38px;
  color: var(--coral);
}

.price-box .disc-tag {
  display: inline-block;
  background: var(--coral);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 8px;
}

/* About Section *\/
.about-visual {
  background: var(--cream);
  border-radius: 18px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.av-stat {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
}

.av-stat b {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  color: var(--coral);
  display: block;
}

.av-stat span {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.about-text p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.75;
  margin-bottom: 16px;
}
*/

/* ==========================================================================
   QUOTE FORM MODAL
   ========================================================================== */

.modal-quote {
  background: #F8F5F0 !important;
  border: 1px solid #DDD5C8 !important;
  border-radius: 6px !important;
  box-shadow: 0 20px 60px rgba(46, 42, 74, 0.25) !important;
  max-width: 680px;
  width: 95%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px 32px 28px;
  scroll-behavior: smooth;
  position: relative;
}

.modal-quote::-webkit-scrollbar { width: 5px; }

.modal-quote::-webkit-scrollbar-track { background: transparent; }

.modal-quote::-webkit-scrollbar-thumb { background: var(--coral); border-radius: 4px; }

/* ── Modal Header ── */
.qm-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #E0D8CC;
}

.qm-icon-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--coral-glow);
  border: 1px solid rgba(255,140,105,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qm-icon-wrap svg {
  width: 22px;
  height: 22px;
  stroke: var(--coral);
  fill: none;
}

.qm-title {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 3px;
  line-height: 1.2;
}

.qm-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.4;
}

/* ── Modal Close ── */
.modal-quote .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: #E8E2D7;
  border: 1px solid #D2C7B8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}

.modal-quote .modal-close:hover {
  background: #DCD4C6;
}

/* ── Form Row (2-Column) ── */
.qm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}

/* ── Field Group ── */
.qm-field {
  margin-bottom: 16px;
}

/* ── Labels ── */
.qm-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px;
}

.qm-label svg {
  width: 14px;
  height: 14px;
  stroke: var(--coral);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.qm-req {
  color: var(--coral);
  font-weight: 700;
  font-size: 13px;
}

/* ── Inputs ── */
.qm-input {
  width: 100%;
  background: #EDE8DF;
  border: 1px solid #D2C7B8;
  border-radius: 4px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.qm-input::placeholder {
  color: #9A9494;
}

.qm-input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 140, 105, 0.1);
  background: #F4EFEB;
}

.qm-input.is-error {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.08);
}

.qm-textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

/* ── Select Wrapper ── */
.qm-select-wrap {
  position: relative;
}

.qm-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23FF8C69' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* ── Error Text ── */
.qm-error {
  font-size: 11px;
  color: #e53e3e;
  font-weight: 600;
  display: block;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.qm-error:not(:empty) {
  max-height: 40px;
  opacity: 1;
  margin-top: 4px;
}

/* ── Dynamic Spec Fields Container ── */
.qm-spec-container {
  transition: all 0.3s ease;
}

.qm-spec-container .qm-row {
  animation: qmFieldFadeIn 0.35s ease;
}

@keyframes qmFieldFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Quantity Stepper ── */
.qm-qty-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 160px;
}

.qm-qty-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8E2D7;
  border: 1px solid #D2C7B8;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.qm-qty-btn:first-child { border-radius: 4px 0 0 4px; }

.qm-qty-btn:last-child { border-radius: 0 4px 4px 0; }

.qm-qty-btn:hover { background: #DCD4C6; }

.qm-qty-input {
  width: 60px;
  text-align: center;
  border-radius: 0;
  border-left: none;
  border-right: none;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  padding: 8px 4px;
  -moz-appearance: textfield;
}

.qm-qty-input::-webkit-inner-spin-button,
.qm-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Live Price Bar ── */
.qm-price-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(135deg, #2E2A4A 0%, #3D3868 100%);
  border: 1px solid rgba(138,124,200,0.25);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 16px;
  animation: qmFieldFadeIn 0.35s ease;
}

.qm-price-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qm-price-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.qm-price-value {
  font-family: 'Sora', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--coral);
  line-height: 1.1;
}

.qm-price-note {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  text-align: right;
}

/* ── File Drop Zone ── */
.qm-file-drop {
  border: 1.5px dashed #D2C7B8;
  border-radius: 4px;
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #EDE8DF;
  position: relative;
}

.qm-file-drop:hover,
.qm-file-drop.dragover {
  border-color: var(--coral);
  background: #F5EDDF;
}

.qm-file-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.qm-file-hint {
  font-size: 11px;
  color: #9A9494;
  margin-top: 2px;
}

/* ── File Preview ── */
.qm-file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.qm-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.qm-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.qm-file-size {
  font-size: 11px;
  color: #9A9494;
  display: block;
}

.qm-file-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: #E8E2D7;
  border: 1px solid #D2C7B8;
  color: #c53030;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}

.qm-file-remove:hover {
  background: #fc8181;
  color: #fff;
}

/* ── Status Message ── */
.qm-status {
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  animation: qmFieldFadeIn 0.3s ease;
}

.qm-status.success {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #276749;
}

.qm-status.error {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #c53030;
}

/* ── Submit Button ── */
.qm-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25);
}

.qm-submit-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.qm-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  filter: brightness(1.05);
}

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

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

/* ── Color/BW Toggle Chips ── */
.qm-chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #EDE8DF;
  border: 1.5px solid #D2C7B8;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.qm-chip:hover {
  border-color: var(--coral);
}

.qm-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.qm-chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.qm-chip-dot.bw { background: linear-gradient(135deg, #333 50%, #ccc 50%); }

.qm-chip-dot.color { background: linear-gradient(135deg, #FF8C69, #8A7CC8, #25D366); }

@media (max-width: 600px) {
  .qm-row {
    grid-template-columns: 1fr;
  }

  .modal-quote {
    padding: 20px 16px 16px !important;
    max-height: 95vh;
    width: 100%;
    border-radius: 4px !important;
  }

  .qm-header {
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }

  .qm-title { font-size: 17px; }

  .qm-sub { font-size: 12px; }

  .qm-icon-wrap {
    width: 40px;
    height: 40px;
  }

  .qm-icon-wrap svg {
    width: 18px;
    height: 18px;
  }

  .qm-price-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
  }

  .qm-price-note {
    text-align: left;
  }

  .qm-chip-group {
    gap: 6px;
  }

  .qm-chip {
    padding: 6px 10px;
    font-size: 12px;
  }

  .qm-submit-btn {
    font-size: 14px;
    padding: 12px 18px;
  }

  .qm-field {
    margin-bottom: 14px;
  }

  .qm-label {
    font-size: 10.5px;
  }
}

/* ==========================================================================
   MOBILE (≤767px)
   ========================================================================== */

@media (max-width: 767px) {
  /* Modal: full screen padding */
  .modal-overlay {
    padding: 10px;
  }

  .modal-quote {
    padding: 20px 16px 16px !important;
    max-height: 95vh;
  }
}

/* ==========================================================================
   KEYBOARD FOCUS, REORDER STRIP & AFTER-SEND SCREEN
   ========================================================================== */

.qm-chip:focus-visible,
.qm-file-drop:focus-within {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.qm-reorder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 18px;
  padding: 10px 12px;
  background: #EDE8DF;
  border: 1px solid #D2C7B8;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink);
}

.qm-reorder[hidden],
.qm-done[hidden] {
  display: none;
}

.qm-reorder-btn,
.qm-done-close {
  min-height: 44px;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.modal-quote.is-done .qm-header,
.modal-quote.is-done #quoteForm {
  display: none;
}

.qm-done {
  text-align: center;
  padding: 8px 4px 4px;
}

.qm-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
}

.qm-done .qm-title:focus {
  outline: none;
}

.qm-done-steps {
  max-width: 460px;
  margin: 20px auto;
  padding-left: 20px;
  text-align: left;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.qm-done-steps li + li {
  margin-top: 6px;
}

.qm-done-upi {
  max-width: 460px;
  margin: 0 auto 14px;
  text-decoration: none;
}

.qm-done-link {
  display: block;
  min-height: 44px;
  padding: 12px 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
}

.qm-done-close {
  min-width: 140px;
  margin-top: 6px;
}

/* Privacy notice above the send button */
.qm-privacy-note {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.qm-privacy-note a {
  color: var(--ink);
  font-weight: 600;
}
