/* ==========================================================================
   AOM — Products catalog page styles
   ========================================================================== */

/* ---------- Hero ---------- */
.main-wrapper > .catalog-hero{margin:0;border-radius:0;--section-inset:0px}
.catalog-hero{padding:4.5rem 0 3rem}
.catalog-hero .container{display:flex;flex-direction:column;align-items:center;text-align:center}
.catalog-hero-title{font-size:clamp(2.4rem,4.6vw,3.6rem)}
.catalog-hero-sub{margin-top:1rem;font-size:1.08rem;color:var(--grey-700);max-width:52ch}
/* The note reads as exactly two lines: one sentence each */
.catalog-hero-note{max-width:none}
.catalog-hero-note-line{display:block}
.catalog-hero-note{margin-top:1.4rem}
.catalog-hero-note a{color:var(--purple);text-decoration:underline}

/* ---------- Layout: filters left, results right ---------- */
.catalog{padding:2.5rem 0 5rem}
.catalog-layout{
  display:grid;
  grid-template-columns:240px 1fr;
  align-items:start;
  gap:2.8rem;
}
.catalog-sidebar{
  display:flex;
  flex-direction:column;
  gap:2rem;
}
.catalog-filter-heading{font-weight:400;
  font-family:var(--font-mono);
  font-size:.7rem;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--grey-400);
  margin-bottom:.9rem;
}
/* Independent toggles, not radios: picking Women's Health doesn't clear
   HRT — each button just adds/removes its own category from the filter
   (see main.js), so results widen as more are checked, "All" clears them. */
.catalog-cats{display:flex;flex-direction:column;gap:.4rem}
.catalog-cat{
  padding:.55rem .9rem;
  min-height:44px;
  border:1.5px solid var(--grey-200);
  border-radius:10px;
  font-family:var(--font-mono);
  font-size:.8rem;
  font-weight:400;
  color:var(--ink);
  text-align:left;
  transition:background .25s var(--ease),border-color .25s var(--ease),color .25s var(--ease);
}
.catalog-cat:hover{border-color:var(--grey-400);color:var(--ink)}
.catalog-cat.is-active{background:var(--purple);border-color:var(--purple);color:var(--white)}
.select-block{width:100%}
.select-block .select-trigger{width:100%;justify-content:space-between}

/* ---------- Toolbar (results side) ---------- */
.catalog-main{min-width:0}
.catalog-toolbar{
  display:flex;
  gap:.6rem;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:2.2rem;
}
.catalog-search{
  font:inherit;
  font-size:.88rem;
  padding:.6rem 1rem;
  border:1.5px solid var(--grey-200);
  border-radius:var(--radius-pill);
  background:var(--white);
  color:var(--ink);
  flex:1 1 200px;
  max-width:320px;
}
.catalog-search:focus{outline:none;border-color:var(--purple)}
@media (max-width:900px){
  .catalog-layout{grid-template-columns:minmax(0,1fr)} /* never let a nowrap chip strip widen the column */
  .catalog-sidebar,.catalog-filter-group,.catalog-cats{min-width:0}
  .catalog-sidebar{flex-direction:row;flex-wrap:wrap;gap:1.2rem}
  .catalog-filter-group{flex:1 1 220px}
  .catalog-cats{flex-direction:row;flex-wrap:wrap}
  .catalog-cat{border-radius:var(--radius-pill)}
}
/* Phone: filters collapse to three compact rows — a swipeable strip of
   specialty chips (bleeding to the screen edges), the dosage-form select
   full width, then the search beside the view toggle — so the first
   product is on screen, not 460px down. */
@media (max-width:640px){
  .catalog{padding-top:1.6rem}
  .catalog-layout{gap:1.4rem}
  .catalog-sidebar{flex-direction:column;flex-wrap:nowrap;gap:1.1rem} /* a wrapping column sizes its line to the widest item — the whole chip strip */
  .catalog-filter-group{flex:none} /* the 220px basis above would become height here */
  .catalog-filter-heading{margin-bottom:.6rem}
  .catalog-cats{
    flex-wrap:nowrap;
    gap:.4rem;
    overflow-x:auto;
    scrollbar-width:none;
    margin:0 calc(-1 * var(--gutter));
    padding:0 var(--gutter);
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
  }
  .catalog-cats::-webkit-scrollbar{display:none}
  .catalog-cat{flex:none;white-space:nowrap;scroll-snap-align:start}
  .catalog-toolbar{margin-bottom:1.2rem;flex-wrap:nowrap}
  .catalog-search{max-width:none;min-height:44px}
  .catalog-view-btn{width:44px;height:44px}
  .select-trigger{min-height:44px}
}

/* ---------- Custom select (dosage-form filter) ---------- */
.select{position:relative}
.select-trigger{
  display:inline-flex;
  align-items:center;
  gap:.7rem;
  font:inherit;
  font-family:var(--font-mono);
  font-size:.82rem;
  padding:.6rem 1rem;
  border:1.5px solid var(--grey-200);
  border-radius:var(--radius-pill);
  background:var(--white);
  color:var(--ink);
  transition:border-color .25s var(--ease);
}
.select-trigger:hover{border-color:var(--grey-400)}
.select.is-open .select-trigger{border-color:var(--purple)}
.select-trigger:focus-visible{outline:none;border-color:var(--purple)}
.select-chevron{width:10px;height:10px;flex:none;color:var(--grey-400);transition:transform .25s var(--ease)}
.select.is-open .select-chevron{transform:rotate(180deg)}
.select-menu{
  position:absolute;
  top:calc(100% + .5rem);
  left:0;
  z-index:20;
  min-width:100%;
  max-height:280px;
  overflow-y:auto;
  margin:0;
  padding:.4rem;
  list-style:none;
  background:var(--white);
  border:1px solid var(--grey-200);
  border-radius:14px;
  box-shadow:0 16px 40px rgba(5,6,8,.14);
}
.select-option{
  padding:.6rem .9rem;
  border-radius:10px;
  font-family:var(--font-mono);
  font-size:.82rem;
  color:var(--ink);
  white-space:nowrap;
  cursor:pointer;
  transition:background .2s var(--ease),color .2s var(--ease);
}
.select-option:hover{background:var(--grey-100);color:var(--ink)}
.select-option.is-selected{background:var(--purple);color:var(--white)}
.catalog-view-toggle{display:flex;gap:.3rem;margin-left:auto}
.catalog-view-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border:1.5px solid var(--grey-200);
  border-radius:10px;
  color:var(--grey-400);
  transition:border-color .25s var(--ease),color .25s var(--ease),background .25s var(--ease);
}
.catalog-view-btn svg{width:15px;height:15px}
.catalog-view-btn:hover{border-color:var(--grey-400);color:var(--ink)}
.catalog-view-btn.is-active{background:var(--ink);border-color:var(--ink);color:var(--white)}

/* ---------- Grid view ---------- */
.catalog-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1.2rem 1.2rem;
}
.catalog-card{display:block}
/* Mockup renders come with their own studio-grey backdrop baked in, so the
   image fills the whole tile and that backdrop *is* the tile background —
   no padded icon-on-a-box, which would show the render as a darker square. */
.catalog-card-media{
  position:relative;
  aspect-ratio:1;
  background:var(--grey-100);
  border-radius:var(--radius-card);
  overflow:hidden;
}
.catalog-card-media img{width:100%;height:100%;object-fit:cover;transition:transform .4s var(--ease)}
.catalog-card:hover .catalog-card-media img{transform:scale(1.04)}
.catalog-card-title{font-size:1rem;font-weight:550;margin-top:1rem}
.catalog-card-meta{font-family:var(--font-mono);font-size:.72rem;color:var(--grey-400);margin-top:.25rem}
.catalog-card-qty{font-family:var(--font-mono);font-size:.72rem;color:var(--grey-400);margin-top:.1rem}
@media (max-width:1080px){.catalog-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:780px){.catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:480px){
  /* two-up stays two-up: a one-column grid of 335px renders is a wall */
  .catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:1.2rem .8rem}
  .catalog-card-title{font-size:.95rem;margin-top:.7rem;line-height:1.3}
}

/* ---------- Sheet view ---------- */
.catalog-sheet{overflow-x:auto;border:1px solid var(--grey-200);border-radius:var(--radius-card)}
.catalog-table{width:100%;border-collapse:collapse;font-size:.88rem;min-width:840px}
.catalog-table th{font-weight:400;
  font-family:var(--font-mono);
  font-size:.66rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  text-align:left;
  color:var(--grey-400);
  background:var(--grey-100);
  padding:.9rem 1.1rem;
  border-bottom:1px solid var(--grey-200);
}
.catalog-table td{
  padding:.85rem 1.1rem;
  border-bottom:1px solid var(--grey-200);
  color:var(--grey-700);
  vertical-align:top;
}
.catalog-table tbody tr:last-child td{border-bottom:0}
.catalog-table tbody tr:hover{background:var(--grey-100)}
.catalog-sheet-name a{font-weight:550;color:var(--ink)}
.catalog-sheet-name a:hover{color:var(--ink)}
/* Phone: the sheet becomes a list of record cards — no sideways table.
   The header row hides; each row is a two-column card with the product
   name across the top and every other cell labelled from its column
   heading (data-label, set in main.js). */
@media (max-width:640px){
  .catalog-sheet{overflow:visible;border:0;border-radius:0}
  .catalog-table{min-width:0;display:block}
  .catalog-table thead{display:none}
  .catalog-table tbody{display:flex;flex-direction:column;gap:.75rem}
  .catalog-table tr{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.7rem 1rem;
    padding:1.1rem 1.1rem 1.2rem;
    border:1px solid var(--grey-200);
    border-radius:var(--radius-card);
    background:var(--white);
  }
  .catalog-table tbody tr:hover{background:var(--white)}
  .catalog-table td{padding:0;border:0;font-size:.9rem;color:var(--ink)}
  .catalog-table td.catalog-sheet-name{grid-column:1/-1;font-size:1.05rem}
  .catalog-table td:not(.catalog-sheet-name)::before{
    content:attr(data-label);
    display:block;
    margin-bottom:.15rem;
    font-family:var(--font-mono);
    font-size:.62rem;
    letter-spacing:.12em;
    text-transform:uppercase;
    color:var(--grey-400);
  }
}

/* ---------- Empty & notes ---------- */
.catalog-empty{
  padding:3rem 0;
  text-align:center;
  color:var(--grey-700);
}
.catalog-empty a{color:var(--purple);text-decoration:underline}
.catalog-note{margin-top:1.8rem}

