/*
 * Precision Merch quote tool styles.
 * Everything is scoped under #pm-quote so the tool sits inside the main site
 * theme (bootstrap.css + css/style.css) without leaking into it. The colour
 * variables stay on :root because the mockup designer overlay (designer.css)
 * is appended to <body>, outside #pm-quote, and reads them too.
 */
:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --border: #e6e6ea;
  --text: #1a1a1e;
  --text-muted: #74747c;
  --accent: #006fc4;
  --accent-hover: #00579a;
  --accent-soft: #e6f3fe;
  --ok: #157a3d;
  --ok-bg: #e8f6ee;
  --warn: #b45309;
  --warn-bg: #fef3e2;
  --danger: #b42323;
  --danger-bg: #fdecec;
}

/* ---------- Toolbar (search + favorites) ---------- */

#pm-quote .pm-toolbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 16px max(24px, calc((100% - 1400px) / 2 + 24px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  }

#pm-quote .search-form {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 520px;
}

#pm-quote .search-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 15px;
}

#pm-quote .search-form input:focus {
  outline: none;
  border-color: var(--accent);
}

#pm-quote .search-form button {
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

#pm-quote .search-form button:hover { background: var(--accent-hover); }

#pm-quote .favorites-select {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: var(--panel);
  cursor: pointer;
  max-width: 160px;
  flex-shrink: 0;
}

#pm-quote .favorites-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Main / browse ---------- */

#pm-quote .layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 900px) {
  #pm-quote .layout { grid-template-columns: 1fr; }
}

/* ---------- Sidebar (results list) ---------- */

#pm-quote .sidebar {
  border-right: 1px solid var(--border);
  padding: 20px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

@media (max-width: 900px) {
  #pm-quote .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: static;
    max-height: none;
  }
}

#pm-quote .sidebar-intro {
  padding: 4px 4px 18px;
}

#pm-quote .sidebar-intro h2 {
  font-size: 20px;
  margin: 0 0 8px 0;
  line-height: 1.25;
}

#pm-quote .sidebar-intro p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

#pm-quote .hint {
  color: var(--text-muted);
  padding: 30px 10px;
  font-size: 14px;
}

#pm-quote .results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#pm-quote .style-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 10px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

#pm-quote .style-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.07);
}

#pm-quote .style-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

#pm-quote .style-card .thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f4f4f6;
  border-radius: 8px;
  flex-shrink: 0;
}

#pm-quote .style-card .info {
  min-width: 0;
  flex: 1;
}

#pm-quote .style-card .brand-name {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

#pm-quote .style-card .style-name {
  font-weight: 700;
  font-size: 14px;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pm-quote .style-card .style-title {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pm-quote .style-card .price {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 3px;
}

#pm-quote .style-card .price .from {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
}

/* ---------- Detail (main panel) ---------- */

#pm-quote .detail-main {
  padding: 24px 32px;
  min-height: 480px;
}

#pm-quote .detail-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  max-width: 900px;
}

@media (max-width: 700px) {
  #pm-quote .detail-layout { grid-template-columns: 1fr; }
}

#pm-quote .detail-image {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: sticky;
  top: 90px;
  height: fit-content;
}

#pm-quote .detail-image img {
  width: 100%;
  height: 300px;
  object-fit: contain;
}

#pm-quote .detail-panel h2 {
  margin: 0 0 4px 0;
  font-size: 26px;
}

#pm-quote .detail-panel .subtitle {
  color: var(--text-muted);
  margin-bottom: 20px;
}

#pm-quote .section-label {
  font-weight: 700;
  font-size: 14px;
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#pm-quote .link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

#pm-quote .link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

#pm-quote .size-chart-panel {
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
}

#pm-quote .size-chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#pm-quote .size-chart-table th,
#pm-quote .size-chart-table td {
  text-align: left;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

#pm-quote .size-chart-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#pm-quote .size-chart-table tbody tr:last-child td {
  border-bottom: none;
}

#pm-quote .color-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

#pm-quote .color-picker select {
  flex: 1;
  max-width: 280px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--panel);
  cursor: pointer;
}

#pm-quote .color-picker select:focus {
  outline: none;
  border-color: var(--accent);
}

#pm-quote .swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  display: inline-block;
  flex-shrink: 0;
}

#pm-quote .swatch-large {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}

#pm-quote .qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

#pm-quote .qty-row input[type="number"] {
  width: 110px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
}

#pm-quote .qty-hint {
  font-size: 13px;
  color: var(--text-muted);
}

#pm-quote .tier-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 8px;
}

#pm-quote .locations {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#pm-quote .location-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

#pm-quote .location-row label.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  flex: 1;
  cursor: pointer;
}

#pm-quote .location-row select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

#pm-quote .location-row .rate-hint {
  font-size: 12px;
  color: var(--text-muted);
}

#pm-quote .size-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

#pm-quote .size-table th,
#pm-quote .size-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

#pm-quote .size-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#pm-quote .size-table td.price-cell {
  font-weight: 700;
}

#pm-quote .size-qty-input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

#pm-quote .size-table tfoot td {
  border-bottom: none;
  border-top: 2px solid var(--border);
  padding-top: 12px;
}

#pm-quote .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

#pm-quote .status-pill.in { color: var(--ok); background: var(--ok-bg); }
#pm-quote .status-pill.low { color: var(--warn); background: var(--warn-bg); }
#pm-quote .status-pill.out { color: var(--danger); background: var(--danger-bg); }

#pm-quote .summary-box {
  margin-top: 24px;
  background: var(--accent-soft);
  border: 1px solid #b9dcfb;
  border-radius: 12px;
  padding: 18px 20px;
}

#pm-quote .summary-box .grand-total {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

#pm-quote .summary-box .grand-total-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

#pm-quote .upsell-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ok);
  background: var(--ok-bg);
  border-radius: 8px;
  padding: 8px 12px;
}

/* ---------- Shipping estimator ---------- */

#pm-quote .shipping-row {
  display: flex;
  gap: 10px;
}

#pm-quote .shipping-row input {
  flex: 1;
  max-width: 200px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

#pm-quote .secondary-btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#pm-quote .secondary-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#pm-quote #shipping-result {
  margin-top: 10px;
}

/* ---------- Order form ---------- */

#pm-quote .order-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 500px) {
  #pm-quote .order-form-grid { grid-template-columns: 1fr; }
}

#pm-quote .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

#pm-quote .form-field .required { color: var(--danger); }
#pm-quote .form-field .optional { color: var(--text-muted); font-weight: 400; }

#pm-quote .form-field input,
#pm-quote .form-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  resize: vertical;
}

#pm-quote .form-field input:focus,
#pm-quote .form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

#pm-quote #file-warning {
  margin-top: 8px;
}

#pm-quote #file-warning a {
  color: var(--accent);
  font-weight: 600;
}

#pm-quote .file-list {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

#pm-quote .file-list ul {
  margin: 4px 0 0 0;
  padding-left: 18px;
}

#pm-quote .submit-btn {
  margin-top: 18px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

#pm-quote .submit-btn:hover { background: var(--accent-hover); }
#pm-quote .submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

#pm-quote .error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #f5c2c2;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

#pm-quote .loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ---------- Status line (was a bare <footer>) ---------- */

#pm-quote .pm-status {
  text-align: center;
  padding: 16px 24px 24px;
  color: var(--text-muted);
  font-size: 13px;
  min-height: 20px;
}

/* ---------- Theme integration ---------- */

/* Smaller banner than the service pages: the tool is the point of the page. */
.fh5co-cover.fh5co-cover-sm.pm-quote-cover,
.fh5co-cover.fh5co-cover-sm.pm-quote-cover .display-t,
.fh5co-cover.fh5co-cover-sm.pm-quote-cover .display-tc {
  height: 360px;
}
.pm-quote-cover h1 { color: #fff; }

/* At this shorter height "cover" scales the banner image by width, which
   exposes the grey strip on its right edge. Oversize it slightly instead. */
@media screen and (min-width: 769px) {
  .fh5co-cover.pm-quote-cover {
    background-size: 110% auto !important;
    background-position-x: left !important;
  }
}
.pm-quote-cover p { color: rgba(255, 255, 255, 0.8); }

/* Phones: leave room for the fixed nav bar above the heading. */
@media screen and (max-width: 768px) {
  .fh5co-cover.fh5co-cover-sm.pm-quote-cover {
    height: 330px;
    padding-top: 70px;
  }
  .fh5co-cover.fh5co-cover-sm.pm-quote-cover .display-t,
  .fh5co-cover.fh5co-cover-sm.pm-quote-cover .display-tc {
    height: 260px;
  }
  .pm-quote-cover h1 { font-size: 36px; margin-bottom: 14px; }
  .pm-quote-cover p { font-size: 15px; line-height: 1.5; margin-bottom: 0; }
}

#pm-quote {
  clear: both; /* the theme banner is floated */
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

#pm-quote *,
#pm-quote *::before,
#pm-quote *::after { box-sizing: border-box; }

/* Undo theme / bootstrap element styles inside the tool. */
#pm-quote h1, #pm-quote h2, #pm-quote h3, #pm-quote h4 {
  font-family: inherit;
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
}
#pm-quote h3 { font-size: 18px; margin: 18px 0 10px; }
#pm-quote p { margin: 1em 0; }
#pm-quote a { color: var(--accent); }
#pm-quote a:hover, #pm-quote a:focus { color: var(--accent-hover); }
#pm-quote label { font-weight: inherit; margin-bottom: 0; max-width: none; }
#pm-quote input, #pm-quote select, #pm-quote textarea, #pm-quote button {
  font-family: inherit;
  line-height: normal;
  color: var(--text);
}
#pm-quote button { color: inherit; }
#pm-quote input[type="file"] { display: block; font-size: 13px; }
#pm-quote table { background: transparent; }

/* Bootstrap's .checkbox makes the box absolute and pushes it out of the label. */
#pm-quote .location-row label.checkbox { position: static; margin: 0; min-height: 0; padding: 0; }
#pm-quote .location-row label.checkbox input[type="checkbox"] { position: static; margin: 0; }

/* Keep buttons white-on-accent after the generic reset above. */
#pm-quote .search-form button,
#pm-quote .submit-btn { color: #fff; }
#pm-quote .link-btn { color: var(--accent); }
#pm-quote .secondary-btn:hover { color: var(--accent); }
#pm-quote .detail-panel h2 { font-weight: 700; }
#pm-quote .sidebar-intro h2 { font-weight: 700; }

#pm-quote .layout { border-top: 1px solid var(--border); }

/* #page has overflow-x:hidden in the theme, which turns it into a scroll
   container and silently disables position:sticky for the sidebar.
   overflow-x:clip clips the same way without that side effect. */
.pm-quote-page #page { overflow-x: clip; }

/* Let grid columns shrink below their content (long nowrap product names,
   wide size tables) instead of pushing past the viewport on phones. */
#pm-quote .layout > *,
#pm-quote .detail-layout > * { min-width: 0; }
#pm-quote .detail-panel { overflow-x: auto; }

/* Mockup launch button lives inside the tool; keep its text white. */
#pm-quote .md-primary { color: #fff; }

@media (max-width: 600px) {
  #pm-quote .pm-toolbar { padding: 14px 16px; }
  #pm-quote .sidebar { padding: 16px; }
  #pm-quote .detail-main { padding: 20px 16px; min-height: 0; }
  #pm-quote .size-table th,
  #pm-quote .size-table td { padding: 8px 6px; font-size: 13px; }
  #pm-quote .size-table th { font-size: 10px; }
  #pm-quote .location-row { flex-wrap: wrap; }
}
