/*
 * The merged Shop pages (/trh-store, /trk-store, /trt-store, /trp-store,
 * /trs-store) - the 🎓 Courses section at the top and the All / Courses /
 * Products filter chips underneath the hero.
 *
 * Deliberately brand-agnostic: one file for all five sites. The course CARDS
 * themselves are not styled here - each store page loads its own brand's
 * trX-courses.css (the stylesheet its old trX-courses page used) and reuses
 * that brand's real .trX-course-* card rules, so a Kid store shows Kid-pink
 * course cards and a Hub store shows Hub-purple ones, exactly as before the
 * merge. This file only adds what the merged page needs around them: the
 * section shell, the divider, the chips, and each brand's accent colour for
 * the chip that is switched on.
 *
 * Loaded after trX.css / trX-store.css / store.css / trX-courses.css in each
 * www/trX-store/index.html, hence the explicit overrides below.
 */

/* The two halves of the page - [data-shop-category] is what the chips
   toggle; .shop-hidden must beat a course grid's own display:grid, so it is
   qualified with the class every one of those sections carries. */
.shop-courses-section[class],
.trx-products-section[class],
[class*="-products-section"][class] {
  display: block;
}

.shop-hidden {
  display: none !important;
}

/* ---- 🎓 Courses ------------------------------------------------------ */

.shop-courses-section {
  border-top: 4px solid #00A19E;
  background: linear-gradient(135deg, #F2F8F8 0%, #FFFFFF 100%);
  border-radius: 20px;
  padding: 34px 24px 30px;
}

.shop-courses-section .trh-section-header,
.shop-courses-section .trk-section-header,
.shop-courses-section .trt-section-header,
.shop-courses-section .trp-section-header,
.shop-courses-section .trs-section-header {
  margin-bottom: 26px;
}

/* The 🎓 heading itself - the section's own accent, set per brand below. */
.shop-courses-heading {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 8px;
  color: #434B49;
}

.shop-courses-intro {
  font-size: 17px;
  line-height: 1.7;
  max-width: 780px;
  margin: 0;
}

/* Course cards on a store page used to live one level deeper than the page
   container (the course grid sat inside its own section padding); keep the
   merged page's three-up layout, which is what trX-courses.css' responsive
   rules already collapse down to. */
.shop-courses-section .trh-course-grid,
.shop-courses-section .trk-course-grid,
.shop-courses-section .trt-course-grid,
.shop-courses-section .trp-course-grid,
.shop-courses-section .trs-course-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* A course-backed Item's price is read from the store card (price), while a
   pure LMS Course carries course_price - both are shown by the same rule. */
.shop-course-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

/* ---- Filter chips ---------------------------------------------------- */

.shop-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.shop-filter-chip {
  font-family: 'Comfortaa', sans-serif !important;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid #C9D6D4;
  background: #FFFFFF;
  color: #434B49;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.shop-filter-chip:hover {
  border-color: #00A19E;
  color: #0B6E6C;
}

/* A brand with no courses at all still gets the chip (so the toggle never
   disappears mid-browse) - it just explains itself instead of emptying the
   page. The message is written by shop-filters.js and shown/hidden here,
   never in markup, so an un-JS'd visitor always sees both sections. */
.shop-empty--filters {
  display: none;
}

.shop-empty--filters.shop-shown {
  display: block;
}

/* ---- Per-brand accent ------------------------------------------------ */

.trh-store-page .shop-courses-heading,
.trh-store-page .shop-filter-chip.is-active {
  color: #FFFFFF;
}

.trh-store-page .shop-filter-chip.is-active {
  background: #582581;
  border-color: #582581;
}

.trk-store-page .shop-courses-heading {
  color: #AC455C;
}

.trk-store-page .shop-filter-chip:hover,
.trk-store-page .shop-filter-chip.is-active {
  background: #AC455C;
  border-color: #AC455C;
  color: #FFFFFF;
}

.trt-store-page .shop-courses-heading {
  color: #A9AD1E;
}

.trt-store-page .shop-filter-chip:hover,
.trt-store-page .shop-filter-chip.is-active {
  background: #D5DA39;
  border-color: #D5DA39;
  color: #434B49;
}

.trp-store-page .shop-courses-heading {
  color: #E2661B;
}

.trp-store-page .shop-filter-chip:hover,
.trp-store-page .shop-filter-chip.is-active {
  background: #FF8438;
  border-color: #FF8438;
  color: #FFFFFF;
}

.trs-store-page .shop-courses-heading {
  color: #2FA350;
}

.trs-store-page .shop-filter-chip:hover,
.trs-store-page .shop-filter-chip.is-active {
  background: #5FE07C;
  border-color: #5FE07C;
  color: #434B49;
}

/* Hub keeps its own purple heading white-on-white-safe: the accent is dark,
   so the active chip flips to white text while the heading stays purple. */
.trh-store-page .shop-courses-heading {
  color: #582581;
}

@media (max-width: 900px) {
  .shop-courses-section {
    padding: 26px 16px 22px;
  }

  .shop-courses-heading {
    font-size: 25px;
  }

  .shop-courses-section .trh-course-grid,
  .shop-courses-section .trk-course-grid,
  .shop-courses-section .trt-course-grid,
  .shop-courses-section .trp-course-grid,
  .shop-courses-section .trs-course-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .shop-filter-chip {
    flex: 1 1 auto;
    text-align: center;
  }
}
