/**
 * Shop + category pages (child theme) — see archive-ux.php.
 */

/* ── Header: title + short intro (full text lives in "عن القسم" below the products) ── */
/* The parent hides the shop header (it had no content); ours is real, so show it. */
body.stedrino-main-shop .stedrino-collection__header--shop {
  display: block;
}
.stedrino-collection__header {
  margin-block: 0.25rem 1rem;
  text-align: start;
}
.stedrino-collection__title {
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.9rem);
  font-weight: 800;
  color: var(--st-text, #1a2d42);
  margin: 0 0 0.3rem;
  line-height: 1.3;
}
.stedrino-collection__desc {
  max-width: 64ch;
}
.stedrino-collection__desc p {
  color: var(--st-muted, #5a6d82);
  font-size: 0.92rem;
  line-height: 1.75;
  margin: 0;
}
/* Intro: two lines max; the rest is one tap away. */
.stedrino-collection__desc p:first-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stedrino-collection__desc p + p {
  margin-top: 0.25rem;
}
.stedrino-collection__more {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--st-navy, #0d3973);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.stedrino-collection__more:hover {
  color: var(--st-pink, #d92387);
}

/* ── "تسوقوا حسب السن": its own panel, clearly apart from the products ── */
/* Grid/flex items default to min-width:auto, so the swipeable row would widen the page. */
.stedrino-shop-layout__main {
  min-width: 0;
}
.stedrino-cat-nav {
  min-width: 0;
  overflow: hidden;
  /* RTL: the swipe row's off-screen cards sit to the left; without paint containment
     mobile browsers zoom the whole page out to include them. */
  contain: paint;
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 0.75rem;
  border-radius: var(--st-radius, 16px);
  background: linear-gradient(180deg, var(--st-surface, #fff) 0%, #fbf5f9 100%);
  border: 1px solid var(--st-border, #dde5ee);
}
.stedrino-cat-nav__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.stedrino-cat-nav__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--st-navy, #0d3973);
}
.stedrino-cat-nav__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stedrino-cat-nav__list > li {
  margin: 0;
}
.stedrino-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  height: 100%;
  padding: 0.6rem 0.4rem 0.7rem;
  border-radius: var(--st-radius-sm, 12px);
  border: 1.5px solid transparent;
  color: var(--st-text, #1a2d42);
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.stedrino-cat-card:hover {
  background: var(--st-surface, #fff);
  border-color: var(--st-border, #dde5ee);
  transform: translateY(-2px);
}
.stedrino-cat-card:focus-visible {
  outline: 3px solid var(--st-sky, #3098d9);
  outline-offset: 2px;
}
.stedrino-cat-card__media {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background: var(--st-surface, #fff);
  box-shadow: 0 0 0 3px #fff, 0 4px 14px rgba(13, 57, 115, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--st-navy, #0d3973);
}
.stedrino-cat-card__media img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.stedrino-cat-card__count {
  position: absolute;
  inset-block-start: -2px;
  inset-inline-end: -4px;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--st-navy, #0d3973);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.6rem;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.stedrino-cat-card__name {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.3;
}
.stedrino-cat-card__sub {
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--st-muted, #5a6d82);
}
.stedrino-cat-card.is-active {
  background: var(--st-surface, #fff);
  border-color: var(--st-pink, #d92387);
}
.stedrino-cat-card.is-active .stedrino-cat-card__media {
  box-shadow: 0 0 0 3px var(--st-pink, #d92387), 0 4px 14px rgba(217, 35, 135, 0.25);
}
.stedrino-cat-card.is-active .stedrino-cat-card__count {
  background: var(--st-pink, #d92387);
}
.stedrino-cat-card.is-active .stedrino-cat-card__name {
  color: var(--st-pink-dark, #b81d72);
}
.stedrino-cat-card--all .stedrino-cat-card__media {
  background: var(--st-navy-soft, rgba(13, 57, 115, 0.08));
}

/* Phones: one swipeable row of cards. */
@media (max-width: 768px) {
  .stedrino-cat-nav {
    margin-inline: -16px;
    border-radius: 0;
    border-inline: 0;
    padding: 0.9rem 0 0.6rem;
  }
  .stedrino-cat-nav__head {
    padding-inline: 16px;
    margin-bottom: 0.5rem;
  }
  .stedrino-cat-nav__list {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 4px 16px 6px;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .stedrino-cat-nav__list::-webkit-scrollbar {
    display: none;
  }
  .stedrino-cat-nav__list > li {
    flex: 0 0 104px;
    scroll-snap-align: start;
  }
  .stedrino-cat-card {
    padding: 0.4rem 0.2rem 0.5rem;
  }
  .stedrino-cat-card__media {
    width: 72px;
    height: 72px;
  }
  .stedrino-cat-card__name {
    font-size: 0.88rem;
  }
  .stedrino-cat-card__sub {
    font-size: 0.7rem;
  }
}

/* ── Toolbar: stays reachable while scrolling on phones ── */
@media (max-width: 768px) {
  .stedrino-shop-layout__main #stedrinoShopToolbar {
    position: sticky;
    top: calc(var(--stedrino-header-h, 66px) - 1px);
    z-index: 30;
    background: var(--st-surface, #fff);
    box-shadow: 0 8px 16px -14px rgba(13, 57, 115, 0.45);
  }
}

/* WooCommerce sub-category tiles inside the product grid are replaced by the section above. */
.stedrino-shop-layout__main li.product-category {
  display: none;
}

/* ── "عن القسم" under the products ── */
.stedrino-collection-about {
  margin: 2.5rem auto 1rem;
  padding: 1.25rem 1.25rem 1rem;
  max-width: 900px;
  border: 1px solid var(--st-border, #dde5ee);
  border-radius: var(--st-radius, 16px);
  background: var(--st-surface, #fff);
  scroll-margin-top: 90px;
}
.stedrino-collection-about__title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.6rem;
  color: var(--st-navy, #0d3973);
}
.stedrino-collection-about__text p {
  margin: 0 0 0.75rem;
  line-height: 1.85;
  color: var(--st-text, #1a2d42);
}
.stedrino-collection-about__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
  padding: 0;
  list-style: none;
}
.stedrino-collection-about__facts li {
  position: relative;
  margin: 0;
  padding: 0.55rem 0.75rem;
  padding-inline-start: 2rem;
  border-radius: var(--st-radius-xs, 8px);
  background: var(--st-bg, #f5f8fb);
  font-size: 0.88rem;
  line-height: 1.5;
}
.stedrino-collection-about__facts li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0.75rem;
  top: 0.55rem;
  color: var(--st-pink, #d92387);
  font-weight: 800;
}
.stedrino-collection-about__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 0;
}
.stedrino-collection-about__links a {
  font-weight: 700;
  color: var(--st-navy, #0d3973);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
@media (max-width: 768px) {
  .stedrino-collection-about {
    padding: 1rem;
    margin-top: 2rem;
  }
}
