body {
  background:#f9f9f9;
  margin:0;
  font-family:'Montserrat', Arial, sans-serif;
}

/* Header / hero (match index) */
.hero-logo-wrap {
  text-align:center;
  margin-top:1rem;
}
.hero-logo-wrap img {
  width:120px;
}
.hero {
  background-color:#00569B;
  color:#fff;
  text-align:center;
  padding:2rem 1rem;
  margin:1.5rem auto 2rem;
  box-shadow:0 4px 10px rgba(0,0,0,0.05);
}
.hero h1 {
  font-size:2em;
  margin-bottom:0.5rem;
}
.hero p {
  font-size:1.1em;
  margin:0;
}

.container {
  width:90%;
  max-width:1200px;
  margin:0 auto 2rem;
}

.section-title {
  text-align:center;
  font-size:22px;
  margin-bottom:10px;
  font-weight:bold;
}

.input-row {
  display:flex;
  justify-content:center;
  gap:10px;
  margin-bottom:20px;
  flex-wrap:wrap;
}
.input-row input {
  padding:10px;
  font-size:16px;
  width:320px;
  border-radius:6px;
  border:1px solid #aaa;
}
.pink-btn {
  background:#FF006E;
  border:none;
  color:white;
  padding:10px 20px;
  border-radius:8px;
  cursor:pointer;
  font-weight:bold;
  font-size:16px;
  white-space:nowrap;
}

/* ========= MAIN TWO-COLUMN LAYOUT ========= */
.flyer-layout {
  display:flex;
  flex-direction:column;
  gap:20px;
}

/* mobile: preview first, options after */
.flyer-right {
  order:0;
}
.flyer-left {
  order:1;
}

/* desktop: side by side, only left scrolls */
@media (min-width:1024px) {
  .flyer-layout {
    flex-direction:row;
    align-items:flex-start;
  }

  .flyer-left {
    order:0;
    flex:1 1 0;
    height:calc(100vh - 220px);
    overflow-y:auto;
    padding-right:8px;
  }

  .flyer-right {
    order:1;
    flex:0 0 450px;
  }
}

/* League Tabs */
.league-tabs {
  display:flex;
  justify-content:center;
  gap:10px;
  margin:10px 0 20px;
  flex-wrap:wrap;
}
.league-tab {
  border-radius:999px;
  border:1px solid #0066B3;
  padding:6px 16px;
  cursor:pointer;
  background:white;
  color:#0066B3;
  font-weight:bold;
  font-size:14px;
}
.league-tab.active {
  background:#0066B3;
  color:white;
}

/* Team cards (selection) */
.item-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(110px, 1fr));
  gap:10px;
  margin-top:15px;
}
.item-card {
  background:white;
  border-radius:8px;
  border:1px solid #ccc;
  padding:6px;
  text-align:center;
  cursor:pointer;
  transition:0.2s;
}
.item-card img {
  max-width:100%;
  max-height:90px; /* increased logo size */
  object-fit:contain;
  margin-bottom:4px;
}
.item-card div {
  font-size:13px;
}
.item-card.selected {
  border:2px solid #FF006E;
  box-shadow:0 0 8px rgba(255,0,120,0.4);
}

/* Flyer preview container */
#flyer-preview {
  width:100%;
  background:white;
  border-radius:10px;
  padding:16px;
  border:1px solid #ddd;
  max-height:calc(100vh - 260px);
  overflow-y:auto;
}
#flyer-preview-inner {
  font-size:10px;
}
/* Off-screen container used ONLY for PDF rendering */
#pdf-root {
  position: absolute;
  left: -9999px;   /* keep it off-screen but still rendered */
  top: 0;
  width: 816px;    /* ~ letter width in px at 96dpi (optional but helps) */
  background: #ffffff;
}

/* ==============================
   PDF CARD STYLES – mirror server
   ============================== */
.page {
  width:100%;
  box-sizing:border-box;
  margin-bottom:12px;
  page-break-after:always;
}
.page:last-child {
  page-break-after:auto;
}
.header {
  padding:6px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border:1px solid #ccc;
  border-radius:4px;
  margin-bottom:8px;
  background:#fff;
  page-break-inside:avoid;
  position:relative;
}
.footer {
  margin-top:16px;
  padding:6px;
  text-align:center;
  border:1px solid #ccc;
  border-radius:4px;
  font-size:10px;
  background:#fff;
  page-break-inside:avoid;
}
.header-title {
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  font-size:20px;
  font-weight:bold;
  text-align:center;
  width:max-content;
}
.card-row {
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
  page-break-inside:avoid;
}
.product-card {
  flex:1 1 50%;
  border:1px solid #ccc;
  padding:4px 2px 4px 4px;
  box-sizing:border-box;
  border-radius:4px;
  min-width:0;
  page-break-inside:avoid;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.product-header {
  background-color:#444;
  color:white;
  padding:4px;
  margin-bottom:4px;
  font-size:12px;
  font-weight:bold;
  text-align:center;
  border-radius:4px 4px 0 0;
}
.product-content {
  display:flex;
  gap:2px;
  align-items:center;
  justify-content:center;
  flex-grow:1;
}
.product-details {
  flex:1;
  display:flex;
  align-items:center;
}
.product-image {
  flex:0 0 90px;
  text-align:center;
  display:flex;
  align-items:center;
  justify-content:center;
}
.product-image img {
  max-width:90px;
  max-height:80px;
  object-fit:contain;
  border-radius:2px;
}
.product-image .placeholder {
  width:90px;
  height:80px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  font-size:10px;
  color:#999;
  background-color:#f5f5f5;
  border-radius:2px;
  border:1px solid #ccc;
}
.product-details table {
  width:100%;
  border-collapse:collapse;
  margin-top:2px;
}
.product-details th,
.product-details td {
  border:1px solid #ccc;
  padding:2px 4px;
  text-align:left;
  font-size:10px;
}
.product-details th {
  background-color:#f0f0f0;
}
.product-details td:nth-child(2) {
  font-size:9px;
  word-break:break-word;
}
.team-section-title {
  font-size:14px;
  font-weight:600;
  margin:4px 0 6px;
}

/* AVAILABLE / OOS ITEMS SELECTION */
.available-hint {
  text-align:center;
  color:#666;
  margin-top:-6px;
  margin-bottom:8px;
  font-size:12px;
}

.available-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:12px;
  margin-top:10px;
}

.product-select-row {
  justify-content:center;
}
.product-select-btn.secondary {
  background:#e5e7eb;
  color:#111827;
}

.group-toggle-row {
  text-align:center;
  font-size:13px;
  margin-top:-10px;
  margin-bottom:12px;
}
.group-toggle-row input {
  margin-right:6px;
}

.available-card {
  background:#fff;
  border:1px solid #ccc;
  border-radius:8px;
  padding:8px;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition:border-color 0.2s, box-shadow 0.2s, transform 0.1s, opacity 0.2s;
}
.available-card:hover {
  transform:translateY(-1px);
  box-shadow:0 2px 6px rgba(0,0,0,0.08);
}
.available-card.selected {
  border-color:#FF006E;
  box-shadow:0 0 0 2px rgba(255,0,110,0.25);
}

.available-card.oos-card {
  opacity:0.7;
}
.available-card.oos-card.selected {
  opacity:1;
}

.available-card-image {
  width:70px;
  height:70px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.available-card-image img {
  max-width:70px;
  max-height:70px;
  object-fit:contain;
  border-radius:2px;
}
.available-card-image .placeholder {
  width:70px;
  height:70px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  font-size:9px;
  color:#999;
  background-color:#f5f5f5;
  border-radius:2px;
  border:1px solid #ccc;
}

.available-card-info {
  flex:1;
  min-width:0;
}

.available-card-title {
  font-size:14px;
  font-weight:600;
  margin-bottom:2px;
}

.available-card-meta {
  font-size:12px;
  color:#555;
}
.available-card-meta span {
  display:block;
}
