/* =========================================================================
   El Safty Storefront Tools — component styling.

   These are this plugin's own components, so their styling ships with the
   plugin: deactivating it leaves no orphan CSS in the theme, and switching
   theme leaves the widgets styled. Every colour reads a design token from the
   active theme with a literal fallback, so the components stay presentable on
   a theme that does not define the tokens.

   Sizes here are only the defaults. Columns, gaps, icon size, padding and
   font sizes are all Elementor controls and override these.
   ========================================================================= */

.els-deps,
.els-grades,
.els-brands,
.els-guides {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------------------------------------------------------------- departments */

.els-deps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
@media (min-width: 768px) {
  .els-deps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.els-dep > a {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 14px 24px;
  min-height: 172px;
  text-align: center;
  background: var(--bg, #fff);
  border: 1px solid var(--line, #E3E8F0);
  border-radius: var(--r-lg, 18px);
  box-shadow: var(--sh-1, 0 1px 3px rgba(22, 32, 46, .07));
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.els-dep > a:hover {
  border-color: var(--brand, #D42027);
  box-shadow: var(--sh-2, 0 4px 14px rgba(22, 32, 46, .08));
  transform: translateY(-2px);
}
.els-dep__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: var(--brand-tint, #FDECEC);
  color: var(--brand, #D42027);
}
.els-dep__icon svg,
.els-dep__icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.els-dep__label {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink, #16202E);
}
.els-dep__count {
  font-size: 13.5px;
  color: var(--muted, #93A0B5);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
  .els-dep > a { min-height: 150px; padding: 22px 10px 20px; gap: 10px; }
  .els-dep__icon { width: 60px; height: 60px; }
  .els-dep__icon svg, .els-dep__icon img { width: 30px; height: 30px; }
  .els-dep__label { font-size: 15px; }
}

/* --------------------------------------------------------------- grade finder */

.els-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.els-tabs__radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.els-tabs__label {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding-inline: 30px;
  border: 1.5px solid var(--line, #E3E8F0);
  border-radius: 999px;
  background: var(--bg, #fff);
  color: var(--ink, #16202E);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.els-tabs__radio:checked + .els-tabs__label {
  background: var(--brand, #D42027);
  border-color: var(--brand, #D42027);
  color: #fff;
}
.els-tabs__radio:focus-visible + .els-tabs__label {
  outline: 3px solid var(--brand, #D42027);
  outline-offset: 2px;
}
.els-tabs__panel { display: none; width: 100%; margin-top: 22px; }
/* els_render_grade_finder loops an unbounded Elementor repeater; enumerate
   enough pairs that a fifth track cannot render a tab whose panel never shows. */
.els-tabs__radio:nth-of-type(1):checked ~ .els-tabs__panel:nth-of-type(1),
.els-tabs__radio:nth-of-type(2):checked ~ .els-tabs__panel:nth-of-type(2),
.els-tabs__radio:nth-of-type(3):checked ~ .els-tabs__panel:nth-of-type(3),
.els-tabs__radio:nth-of-type(4):checked ~ .els-tabs__panel:nth-of-type(4),
.els-tabs__radio:nth-of-type(5):checked ~ .els-tabs__panel:nth-of-type(5),
.els-tabs__radio:nth-of-type(6):checked ~ .els-tabs__panel:nth-of-type(6),
.els-tabs__radio:nth-of-type(7):checked ~ .els-tabs__panel:nth-of-type(7),
.els-tabs__radio:nth-of-type(8):checked ~ .els-tabs__panel:nth-of-type(8),
.els-tabs__radio:nth-of-type(9):checked ~ .els-tabs__panel:nth-of-type(9),
.els-tabs__radio:nth-of-type(10):checked ~ .els-tabs__panel:nth-of-type(10) { display: block; }

/* Stage grouping — the reason the finder stops reading as one dense cloud. */
.els-stage + .els-stage { margin-top: 26px; }
.els-stage__h {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--muted, #93A0B5);
  display: flex;
  align-items: center;
  gap: 12px;
}
.els-stage__h::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line, #E3E8F0);
}

.els-grades { display: flex; flex-wrap: wrap; gap: 12px; }

.els-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg, #fff);
  border: 1px solid var(--line, #E3E8F0);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink, #16202E);
  transition: border-color .15s, color .15s, background .15s;
}
.els-chip:hover {
  border-color: var(--brand, #D42027);
  color: var(--brand, #D42027);
  background: var(--brand-tint, #FDECEC);
}
.els-chip__n {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-alt, #F7F9FC);
  color: #7A8699;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ------------------------------------------------------------------- brands */

.els-brands { display: flex; flex-wrap: wrap; gap: 14px; }
.els-chip--brand { font-weight: 700; padding: 13px 28px; font-size: 17px; }

/* ------------------------------------------------------------------- guides */

.els-guides {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 768px) {
  .els-guides { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.els-guide {
  display: flex;
  flex-direction: column;
  background: var(--bg, #fff);
  border: 1px solid var(--line, #E3E8F0);
  border-radius: var(--r-lg, 18px);
  overflow: hidden;
  box-shadow: var(--sh-1, 0 1px 3px rgba(22, 32, 46, .07));
}
.els-guide__media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt, #F7F9FC);
  overflow: hidden;
}
.els-guide__media img { width: 100%; height: 100%; object-fit: cover; }
.els-guide__title {
  font-size: 17px;
  line-height: 1.5;
  padding: 16px 18px 0;
  margin: 0;
  color: var(--ink, #16202E);
}
.els-guide__link:hover .els-guide__title { color: var(--brand, #D42027); }
.els-guide__cat {
  margin: 14px 18px 18px;
  align-self: flex-start;
  color: var(--brand, #D42027);
  font-weight: 600;
  font-size: 15px;
}
.els-guide__cat:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .els-dep > a, .els-chip, .els-tabs__label { transition: none; }
}
