* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.header {
  background: #950606;
  color: white;
  padding: 24px 32px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ── HEADER INNER (left content + right callout) ────────────────────────── */
.header-inner {
  display: flex;
  gap: 24px;
  align-items: center;
}

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

/* ── HEADER CALLOUT CARD ─────────────────────────────────────────────────── */
.header-callout {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  width: 288px;
  flex-shrink: 0;
  box-shadow: 0 3px 16px rgba(0,0,0,0.22);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.callout-intro {
  font-family: 'Fredoka', cursive;
  font-weight: 700;
  font-size: 1.08rem;
  color: #6e0404;
  line-height: 1.3;
  margin: 0;
}

.callout-body {
  font-size: 0.76rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.6;
  margin: 0;
}

.callout-phone {
  font-weight: 700;
  font-size: 0.95rem;
  color: #6e0404;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ── HEADER CONTACT CARD (Get in Touch form, top-right) ─────────────────── */
.header-contact {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  width: 280px;
  flex-shrink: 0;
  box-shadow: 0 3px 16px rgba(0,0,0,0.22);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

@media (max-width: 1050px) {
  .header-contact { display: none; }
}

@media (max-width: 720px) {
  .header-inner { flex-direction: column; }
  .header-callout { width: 100%; align-self: auto; }
}

/* ── PAGE BODY (tab/results column + get in touch sidebar) ───────────────── */
.page-body {
  display: flex;
  align-items: flex-start;
}

.page-main { flex: 1; min-width: 0; }

.page-sidebar {
  width: 290px;
  flex-shrink: 0;
  padding: 20px 20px 20px 8px;
}

@media (max-width: 960px) {
  .page-sidebar { display: none; }
}

/* ── GET IN TOUCH PANEL ──────────────────────────────────────────────────── */
.get-in-touch-panel {
  position: sticky;
  top: 20px;
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 3px 16px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.get-in-touch-title {
  font-family: 'Fredoka', cursive;
  font-weight: 700;
  font-size: 1.02rem;
  color: #6e0404;
  margin: 0;
}

/* ── CONTACT FORM ─────────────────────────────────────────────────────────── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-row { display: flex; gap: 7px; }
.form-row input { flex: 1; min-width: 0; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 8px 11px;
  font-size: 0.83rem;
  border: 1px solid #e0c4c4;
  border-radius: 6px;
  background: #fdf8f8;
  color: #1a1a2e;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #950606;
  box-shadow: 0 0 0 2px rgba(149,6,6,0.12);
  background: white;
}

.contact-form textarea { resize: vertical; min-height: 58px; }

.btn-form-submit {
  background: #950606;
  color: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

.btn-form-submit:hover { background: #b00808; }

.form-success {
  font-family: 'Fredoka', cursive;
  font-weight: 700;
  font-size: 1.05rem;
  color: #2e7d32;
  text-align: center;
  padding: 12px 0;
}

.form-error {
  font-size: 0.83rem;
  color: #950606;
  text-align: center;
  padding: 12px 0;
}

/* ── HEADER TOP ROW (logo + title) ───────────────────────────────────────── */
.header-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.company-logo {
  height: 116px;
  width: auto;
  flex-shrink: 0;
  border-radius: 8px;
}

.header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0;
}

.header-hint {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 8px;
}

.header-hint em {
  font-style: italic;
  opacity: 0.9;
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 700px;
}

/* ── SEARCH INPUT WRAPPER + ROTATING PLACEHOLDER ─────────────────────── */
.search-input-wrap {
  flex: 1;
  position: relative;
}

#search {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  outline: none;
  background: white;
  color: #1a1a2e;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#search:focus {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.4);
}

.search-ph-overlay {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  max-width: calc(100% - 32px);
  text-overflow: ellipsis;
  /* base transition — applies when exiting .ph-exit and .ph-enter */
  transition: opacity 0.28s ease, transform 0.28s ease;
}

/* slide up and fade out (current message leaving) */
.search-ph-overlay.ph-exit {
  opacity: 0;
  transform: translateY(calc(-50% - 6px));
}

/* pre-position new message below center before animating in */
.search-ph-overlay.ph-enter {
  opacity: 0;
  transform: translateY(calc(-50% + 6px));
  transition: none;   /* instant reposition — no animation while entering start state */
}

/* ── SEE ALL BUTTON ───────────────────────────────────────────────────── */
.btn-see-all {
  background: white;
  color: #950606;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 12px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background 0.15s;
}
.btn-see-all:hover { background: #fde8e8; }

/* ── TAB BAR ─────────────────────────────────────────────────────────────── */
.tab-bar {
  background: #7a0505;
  padding: 0 28px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 2px solid #5a0303;
}

.tab {
  background: rgba(0,0,0,0.16);
  color: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.13);
  border-bottom: 3px solid transparent;
  border-radius: 4px 4px 0 0;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  margin-bottom: -2px;
  letter-spacing: 0.02em;
}

.tab:hover {
  color: white;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  border-bottom-color: rgba(255,255,255,0.4);
}

.tab.active {
  color: white;
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
  border-bottom-color: white;
}

.tab-see-all {
  color: rgba(255,255,255,0.9);
  border-right: 1px solid rgba(255,255,255,0.15);
  margin-right: 6px;
  padding-right: 24px;
}

/* ── RESULTS ─────────────────────────────────────────────────────────────── */
#results {
  max-width: 860px;
  margin: 28px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hint, .no-results {
  color: #666;
  font-size: 0.95rem;
  padding: 20px 0;
  text-align: center;
}

/* ── SEARCH RESULTS HEADER (count label + open-all button) ──────────────── */
.search-results-header {
  background: white;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
  border-left: 4px solid #950606;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.search-match-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.01em;
}

.btn-open-all {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: #950606;
  color: white;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 6px rgba(149,6,6,0.22);
  transition: background 0.15s, box-shadow 0.15s;
  line-height: 1.3;
}

.btn-open-all:hover {
  background: #b00808;
  box-shadow: 0 3px 10px rgba(149,6,6,0.32);
}

.btn-open-all:active { transform: scale(0.985); }

.btn-open-all-icon {
  font-size: 0.68rem;
  opacity: 0.75;
  flex-shrink: 0;
}

/* ── PRODUCT CARDS (search results) ─────────────────────────────────────── */
.card {
  background: white;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
  border-left: 4px solid #950606;
}

.card-vendor {
  display: inline-block;
  background: #fde8e8;
  color: #950606;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.card-item {
  font-size: 0.82rem;
  color: #888;
  font-weight: 600;
  margin-bottom: 4px;
  font-family: monospace;
}

.card-desc {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 6px;
  line-height: 1.4;
}

.card-upc {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 14px;
  font-family: monospace;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── ALL-VENDORS SCROLL VIEW ─────────────────────────────────────────────── */
.vendor-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vendor-section-heading {
  background: #950606;
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 6px;
  margin-top: 8px;
}

/* ── VENDOR CONTEXT (inside header, replaces hint text when tab is active) ── */
.vendor-context {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.vendor-context.hidden { display: none; }

.vendor-ctx-logo {
  max-height: 75px;
  max-width: 220px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  background: white;
  border-radius: 6px;
  padding: 6px 14px;
}

.vendor-ctx-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.01em;
}

@media (max-width: 480px) {
  .vendor-ctx-logo { max-height: 48px; max-width: 150px; }
}

/* ── TAB BROWSE RESULTS ──────────────────────────────────────────────────── */
.tab-results-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #950606;
  padding-bottom: 4px;
  border-bottom: 2px solid #950606;
  margin-bottom: 4px;
}

.sheet-card {
  background: white;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
  border-left: 4px solid #950606;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sheet-card-info { flex: 1; min-width: 0; }

.sheet-card-name {
  font-size: 0.97rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 3px;
}

.sheet-card-count {
  font-size: 0.78rem;
  color: #999;
}

.sheet-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── AVAILABLE SELL SHEETS (bottom of search results) ───────────────────── */
.files-section {
  background: white;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
  border-left: 4px solid #950606;
}

.files-heading {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #950606;
  margin-bottom: 14px;
}

.files-count {
  font-weight: 400;
  color: #888;
  text-transform: none;
  letter-spacing: 0;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.file-row:last-child { border-bottom: none; }

.file-vendor-badge {
  display: inline-block;
  background: #fde8e8;
  color: #950606;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.file-name {
  flex: 1;
  font-size: 0.88rem;
  color: #1a1a2e;
  font-weight: 500;
  min-width: 0;
  word-break: break-word;
}

.file-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── PDF PREVIEW MODAL ───────────────────────────────────────────────────── */
#preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#preview-modal.hidden { display: none; }

.preview-box {
  background: white;
  border-radius: 10px;
  width: 100%;
  max-width: 960px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.35);
}

.preview-header {
  background: #950606;
  color: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

#preview-title {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#nav-counter {
  font-size: 0.78rem;
  opacity: 0.7;
  white-space: nowrap;
  min-width: 40px;
  max-width: 180px;
  text-align: center;
}

.btn-nav {
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-nav:hover:not(:disabled) { background: rgba(255,255,255,0.3); }
.btn-nav:disabled { opacity: 0.25; cursor: default; }

.preview-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

#preview-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #525659;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: #950606;
  color: white;
}

.btn-primary:hover { background: #b00808; }

.btn-secondary {
  background: #fde8e8;
  color: #950606;
}

.btn-secondary:hover { background: #f5cccc; }

.btn-success {
  background: #950606;
  color: white;
}

.btn-success:hover { background: #b00808; }

.btn-close {
  background: rgba(255,255,255,0.15);
  color: white;
}

.btn-close:hover { background: rgba(255,255,255,0.28); }
