/* Ported from legacy header.asp — layout, contact modal, sidebar accents (Tailwind-friendly). */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* ══════════════════════════════════════════════════════════════════════════
   Contact Modal — native CSS overlay (replaces jQuery UI dialog).
   Opens as display:flex; closed as display:none via JS.
══════════════════════════════════════════════════════════════════════════ */

/* Full-viewport semi-transparent backdrop */
#contact-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9999;
  /* display:flex is set by JS when open; keeps centering ready */
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

/* Prevent page body from scrolling while the modal is open */
body.contact-modal-active {
  overflow: hidden;
}

/* Modal panel — flex column so header stays fixed and body scrolls */
#contact-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* On very small screens give the modal full width with minimal side padding */
@media (max-width: 480px) {
  #contact-modal-overlay {
    padding: 10px;
  }
  #contact-modal {
    max-height: 95vh;
  }
  .contact-modal-body {
    padding: 14px;
  }
}

/* ── Modal header ── */
.contact-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.contact-modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
}

/* Close × button */
#contact-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

#contact-modal-close:hover {
  color: #1e293b;
  background: #e2e8f0;
}

/* ── Scrollable body — contains result panel + form ── */
.contact-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ── Success / error result panel ── */
#contactresult {
  padding: 14px 16px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: #166534;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Form fieldset — no native border; full width ── */
#contactform fieldset {
  border: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* ── All text inputs, select, and textarea ── */
#contactform input[type="text"],
#contactform input[type="email"],
#contactform input[type="tel"],
#contactform select,
#contactform textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 8px 10px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-family: inherit;
}

#contactform textarea {
  height: 100px;
  resize: vertical;
}

#contactform input:focus,
#contactform select:focus,
#contactform textarea:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* ── Labels ── */
#contactform label {
  display: block;
  font-weight: 500;
  color: #334155;
  margin-bottom: 4px;
  font-size: 14px;
}

/* Dim the "(optional)" hint inside a label */
#contactform label .field-optional {
  font-weight: 400;
  font-size: 12px;
  color: #94a3b8;
}

/* ── Field spacing ── */
#contactform .inputspacing {
  margin-bottom: 14px;
}

/* ── Validation error banner ── */
#contactform .error {
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  font-size: 13px;
}

/* ── FAQ answer box — shown between subject select and message textarea ── */
#contactsubjectresult {
  border: 1px solid #bae6fd;
  border-left: 3px solid #38bdf8;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #0369a1;
  background: #f0f9ff;
  line-height: 1.5;
  /* display is toggled by JS; starts hidden */
}

/* ── Submit and Reset buttons ── */
#contactform input[type="submit"] {
  padding: 9px 24px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

#contactform input[type="submit"]:hover {
  background: #d97706;
}

#contactform input[type="reset"],
#contactform #cancelform {
  padding: 9px 24px;
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

#contactform input[type="reset"]:hover,
#contactform #cancelform:hover {
  background: #cbd5e1;
}

/* ── Button row ── */
.contact-form-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 6px;
  border-top: 1px solid #f1f5f9;
}

/* ── Honeypot — visually hidden from humans ── */
.honeyhide {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════
   Sidebar category navigation
══════════════════════════════════════════════════════════════════════════ */

#sidebar-categories ul li a:hover {
  color: #d97706;
  padding-left: 0.5rem;
  border-left: 3px solid #f59e0b;
  margin-left: -3px;
}

#sidebar-categories ul li a.active-category {
  color: #d97706;
  font-weight: 600;
  padding-left: 0.5rem;
  border-left: 3px solid #f59e0b;
  margin-left: -3px;
  background-color: #fef3c7;
}

#sidebar-categories .category-header.active-main {
  color: #d97706;
  background-color: #fef3c7;
  border-left-color: #d97706;
}

#sidebar-categories .sidebar-family:hover {
  padding-left: 0.5rem;
  border-left: 2px solid #f59e0b;
  margin-left: -2px;
}

#sidebar-categories .sidebar-family.active-category {
  color: #d97706;
  font-weight: 600;
  padding-left: 0.5rem;
  border-left: 2px solid #f59e0b;
  margin-left: -2px;
  background-color: #fef3c7;
}

/* Checkout: html/body overflow-x:hidden breaks position:sticky in Chromium. Use clip on checkout only. */
@media (min-width: 1024px) {
  html:has(#checkout-layout),
  body:has(#checkout-layout) {
    overflow-x: clip;
  }
}
