/* =========================================================
   Floating enquiry buttons + tabbed popup
   Markup : floating-enquiry.php
   Script : assets/js/floating-enquiry.js
   Colours are the variables below - change them here.
   Button size: change the font-size / padding of .fe-pill.
   ========================================================= */

:root {
  --fe-orange: #d96d00;
  --fe-orange-dark: #b85c00;
  --fe-dark: #232323;
  --fe-red: #d32f2e;
  --fe-red-dark: #b32423;
}

/* ---------- Floating buttons (same stacked look on desktop and mobile) ---------- */

.fe-float {
  position: fixed;
  right: 14px;
  /* low in the corner, lined up with the WhatsApp pill - the buttons sit over Google's reCAPTCHA badge */
  bottom: 15px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.fe-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 15px 28px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-family: var(--body-font, 'Inter', sans-serif);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .2px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.fe-pill i { font-size: 16px; }

.fe-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}

.fe-pill:focus-visible {
  outline: 3px solid rgba(217, 109, 0, .45);
  outline-offset: 3px;
}

.fe-pill--dark { background: var(--fe-dark); }
.fe-pill--dark:hover { background: #000; }
.fe-pill--orange { background: var(--fe-orange); }
.fe-pill--orange:hover { background: var(--fe-orange-dark); }

/* the scroll-to-top arrow lives in the same corner - keep it above the buttons */
#scroll-top.active { bottom: 135px; right: 14px; }

/* above the reCAPTCHA badge (z-index ~2e9) while no popup is open; under the popup backdrop when one is */
body:not(.modal-open) .fe-float { z-index: 2147483001; }

/* phones: same design, a touch smaller so it never crowds the page */
@media (max-width: 575px) {
  .fe-float { right: 12px; bottom: 16px; gap: 10px; }
  .fe-pill { gap: 8px; padding: 13px 22px; font-size: 14.5px; }
  .fe-pill i { font-size: 14.5px; }
  #scroll-top.active { bottom: 122px; right: 12px; }
}

/* very small phones: slimmer pills so they never touch the WhatsApp pill on the left */
@media (max-width: 359px) {
  .fe-pill { gap: 7px; padding: 12px 15px; font-size: 13.5px; }
  .fe-pill i { font-size: 13.5px; }
}

/* ---------- Popup ---------- */

.fe-modal {
  font-family: var(--body-font, 'Inter', sans-serif);
}

/* each form has its own accent colour */
.fe-pane--quick {
  --fe-accent: var(--fe-orange);
  --fe-accent-dark: var(--fe-orange-dark);
  --fe-accent-rgb: 217, 109, 0;
}

.fe-pane--bulk {
  --fe-accent: var(--fe-red);
  --fe-accent-dark: var(--fe-red-dark);
  --fe-accent-rgb: 211, 47, 46;
}

/* the popup is narrower for Quick Enquiry and wider for Bulk Purchase Enquiry */
.fe-modal .modal-dialog {
  max-width: 500px;
  margin: 1rem auto;
  transition: max-width .25s ease, transform .3s ease-out;
}
.fe-modal[data-fe-active="bulk"] .modal-dialog { max-width: 620px; }

.fe-modal .modal-content {
  position: relative;
  border: 0;
  border-radius: 14px;
  color: #1f2328;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .32);
}

.fe-modal .modal-body { padding: 18px 28px 20px; }

/* ---------- Tabs + close ---------- */

.fe-modal .fe-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 0 28px;
}

.fe-modal .fe-tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #f0f0ee;
}

.fe-modal .fe-tab {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 11px 14px;
  white-space: nowrap;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #555b66;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.fe-modal .fe-tab i { flex: 0 0 auto; font-size: 13px; }

.fe-modal .fe-tab:hover { color: #111; background: rgba(0, 0, 0, .05); }

.fe-modal .fe-tab:focus-visible {
  outline: 3px solid rgba(217, 109, 0, .45);
  outline-offset: 1px;
}

.fe-modal .fe-tab[aria-selected="true"] {
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}
/* active tab wears the colour of its floating button */
.fe-modal .fe-tab--quick[aria-selected="true"] { background: var(--fe-orange); }
.fe-modal .fe-tab--bulk[aria-selected="true"]  { background: var(--fe-dark); }

.fe-modal .fe-close {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #111;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease;
}
.fe-modal .fe-close:hover { background: #f0f0f0; }

/* ---------- Headings ---------- */

.fe-modal .fe-kicker {
  margin: 0 0 6px;
  color: var(--fe-red);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.fe-modal .fe-title {
  margin: 0 0 6px;
  color: #111;
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.fe-modal .fe-sub {
  margin: 0 0 16px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.fe-modal .fe-section {
  margin: 18px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ececec;
  color: #111;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

/* ---------- Fields ---------- */

.fe-modal .fe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.fe-modal .fe-field { margin: 0 0 12px; }

.fe-modal .fe-label {
  display: block;
  margin: 0 0 6px;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.fe-modal .fe-req { color: #111; }

.fe-modal .fe-help {
  margin: -2px 0 8px;
  color: #6b7280;
  font-size: 12px;
}

.fe-modal .fe-field input[type="text"],
.fe-modal .fe-field input[type="tel"],
.fe-modal .fe-field input[type="email"],
.fe-modal .fe-field textarea {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #dcdfe4;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #111;
  font-family: inherit;
  font-size: 13.5px;
  outline: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.fe-modal .fe-field textarea {
  height: auto;
  min-height: 70px;
  padding: 10px 12px;
  resize: vertical;
}

.fe-modal .fe-field input::placeholder,
.fe-modal .fe-field textarea::placeholder { color: #9aa0a8; opacity: 1; }

.fe-modal .fe-field input:focus,
.fe-modal .fe-field textarea:focus {
  border-color: var(--fe-accent);
  box-shadow: 0 0 0 3px rgba(var(--fe-accent-rgb), .16);
}

.fe-modal .fe-error {
  display: none;
  margin-top: 5px;
  color: #d32f2e;
  font-size: 12px;
  line-height: 1.35;
}

.fe-modal .fe-field.is-invalid .fe-error { display: block; }

.fe-modal .fe-field.is-invalid input,
.fe-modal .fe-field.is-invalid textarea {
  border-color: #d32f2e;
  background: #fffafa;
}

/* ---------- Product checkboxes ---------- */

.fe-modal .fe-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  padding: 12px 16px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #f8f8f6;
}

.fe-modal .fe-field.is-invalid .fe-checks {
  border-color: #d32f2e;
  background: #fffafa;
}

.fe-modal .fe-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #333;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
}

.fe-modal .fe-check input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--fe-accent);
  cursor: pointer;
}

/* ---------- Submit, status, success ---------- */

.fe-modal .fe-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  margin: 6px 0 0;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--fe-accent);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}

.fe-modal .fe-submit:hover { background: var(--fe-accent-dark); }
.fe-modal .fe-submit:disabled { opacity: .75; cursor: progress; }

.fe-modal .fe-submit:focus-visible {
  outline: 3px solid rgba(var(--fe-accent-rgb), .4);
  outline-offset: 2px;
}

.fe-modal .fe-note {
  margin: 10px 0 0;
  color: #8a8f98;
  font-size: 11.5px;
  text-align: center;
}

.fe-modal .fe-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #f4c7c7;
  border-radius: 8px;
  background: #fdecec;
  color: #9c1c1c;
  font-size: 13px;
  line-height: 1.45;
}

.fe-modal .fe-success { padding: 28px 4px 6px; text-align: center; }
.fe-modal .fe-success > i { color: #1f9d55; font-size: 48px; }

.fe-modal .fe-success h3 {
  margin: 14px 0 6px;
  color: #111;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
}

.fe-modal .fe-success p {
  margin: 0 0 20px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.55;
}

.fe-modal .fe-submit--ghost {
  background: #f1f1f1;
  color: #111;
}
.fe-modal .fe-submit--ghost:hover { background: #e4e4e4; }

/* honeypot - kept off-screen, never display:none (bots skip those) */
.fe-modal .fe-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Small screens ---------- */

@media (max-width: 575px) {
  .fe-modal .modal-dialog,
  .fe-modal[data-fe-active="bulk"] .modal-dialog { max-width: none; margin: .75rem; }

  .fe-modal .fe-head { padding: 14px 12px 0 14px; gap: 8px; }
  .fe-modal .modal-body { padding: 16px 16px 18px; }

  .fe-modal .fe-tab {
    flex: 1 1 0;
    flex-direction: column;
    gap: 4px;
    padding: 9px 6px;
    font-size: 12.5px;
    white-space: normal;
  }
  .fe-modal .fe-tab i { font-size: 14px; }

  .fe-modal .fe-grid { grid-template-columns: 1fr; }
  .fe-modal .fe-title { font-size: 20px; }
}

@media print { .fe-float { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .fe-pill, .fe-modal .fe-submit, .fe-modal .fe-field input,
  .fe-modal .fe-field textarea, .fe-modal .fe-tab,
  .fe-modal .modal-dialog { transition: none; }
}
