/**
 * Shared premium icon sidebar — used on Home, Category, PDP, Corporate Gifting, RM, Photo Frames.
 * Icons only (no thumbnails). Matches home ethereal rail.
 */

:root {
  --cg-rail-ink: var(--cg-navy, #1a2b48);
  --cg-rail-rose: var(--cg-teal-deep, #1e8e84);
  --cg-rail-blush: var(--cg-mint-soft, #d8f3ef);
  --cg-rail-lavender: var(--cg-mint, #7dd3c7);
  --cg-rail-shadow: var(--cg-shadow, 0 18px 48px rgba(26, 43, 72, 0.12));
}

/* ---- Catalog rail (home + guest) ---- */
.home-category-rail--icons,
.home-category-rail.home-category-rail--icons {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  box-shadow: var(--cg-rail-shadow);
  padding: 1.15rem 0.75rem 1.15rem;
}

.home-category-rail--icons .home-category-rail__label,
.home-category-rail--icons.home-category-rail .home-category-rail__label {
  color: rgba(26, 26, 64, 0.4);
  letter-spacing: 0.16em;
  font-size: 0.62rem;
  font-weight: 700;
  margin: 0 0.55rem 0.85rem;
  text-transform: uppercase;
}

.home-category-rail--icons .category-grid--rail {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.15rem;
  overflow-x: hidden;
  min-width: 0;
}

.home-category-rail--icons .category-pill,
.home-category-rail--icons .category-pill--rail,
body.guest-site .guest-page-category-rail.home-category-rail--icons .category-pill--rail {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 14px;
  color: var(--cg-rail-ink);
  box-shadow: none;
  padding: 0.72rem 0.55rem 0.72rem 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  opacity: 1;
  transform: none;
}

.home-category-rail--icons .category-pill::before,
.home-category-rail--icons .category-pill--rail::before,
body.guest-site .guest-page-category-rail.home-category-rail--icons .category-pill--rail::before {
  display: none !important;
  content: none !important;
}

.home-category-rail--icons .category-pill img,
.home-category-rail--icons .category-pill--rail img,
body.guest-site .guest-page-category-rail .category-pill--rail img {
  display: none !important;
}

.category-pill__icon {
  flex: 0 0 1.55rem;
  width: 1.55rem;
  height: 1.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-pill__icon svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.category-pill__label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
  color: var(--cg-rail-ink);
}

.category-pill__chev {
  flex: 0 0 auto;
  color: rgba(26, 26, 64, 0.28);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
  margin-left: 0.15rem;
}

.home-category-rail--icons .category-pill:hover,
.home-category-rail--icons .category-pill:focus-visible,
.home-category-rail--icons .category-pill--rail:hover,
.home-category-rail--icons .category-pill--rail:focus-visible,
body.guest-site .guest-page-category-rail.home-category-rail--icons .category-pill--rail:hover,
body.guest-site .guest-page-category-rail.home-category-rail--icons .category-pill--rail:focus-visible {
  background: rgba(216, 243, 239, 0.22);
  color: var(--cg-rail-ink);
  transform: none;
  outline: none;
  box-shadow: none;
  border-color: transparent;
}

.home-category-rail--icons .category-pill:hover .category-pill__chev,
.home-category-rail--icons .category-pill--rail:hover .category-pill__chev {
  color: var(--cg-rail-rose);
}

.home-category-rail--icons .category-pill.is-active,
.home-category-rail--icons .category-pill--rail.is-active,
body.guest-site .guest-page-category-rail.home-category-rail--icons .category-pill--rail.is-active {
  background: linear-gradient(135deg, rgba(216, 243, 239, 0.38), rgba(125, 211, 199, 0.22));
  color: var(--cg-rail-ink);
  box-shadow: none;
  border-color: transparent;
}

@media (max-width: 959px) {
  .home-category-rail--icons .category-grid--rail,
  body.guest-site .guest-page-category-rail.home-category-rail--icons .category-grid--rail {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.45rem;
    -webkit-overflow-scrolling: touch;
  }

  .home-category-rail--icons .category-pill--rail,
  body.guest-site .guest-page-category-rail.home-category-rail--icons .category-pill--rail {
    flex: 0 0 auto;
    width: auto;
    min-width: 12.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(26, 26, 64, 0.06);
    box-shadow: 0 6px 18px rgba(100, 120, 160, 0.08);
  }
}

/* ---- RM / Photo Frame flat rails (match Home shop-by-category) ---- */
.rm-shop-layout .rm-category-rail {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  max-height: calc(100vh - 6.25rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.rm-shop-layout .rm-category-rail .category-grid--rail {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

@media (max-width: 900px) {
  .rm-shop-layout .rm-category-rail {
    position: static;
    max-height: min(42vh, 20rem);
  }
}

/* ---- RM / Photo Frame tree (legacy PDP): SVG icons, hide thumbnails ---- */
.rm-nav-tree__ico img {
  display: none !important;
}

.rm-nav-tree__ico.rm-nav-tree__ico--svg,
.rm-nav-tree__ico--svg {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  border-radius: 0;
  background: transparent !important;
  overflow: visible;
  box-shadow: none !important;
  border: none !important;
}

.rm-nav-tree__ico--svg svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.rm-nav-tree__ico--ph:not(.rm-nav-tree__ico--svg) {
  background: linear-gradient(135deg, rgba(216, 243, 239, 0.35), rgba(158, 201, 232, 0.35));
}

.rm-nav-tree-wrap {
  border-radius: 22px;
}

.rm-nav-tree__link {
  gap: 0.7rem;
}

.rm-nav-tree__link:hover {
  background: rgba(216, 243, 239, 0.22);
}

.rm-nav-tree__link.is-active {
  background: linear-gradient(135deg, rgba(216, 243, 239, 0.38), rgba(125, 211, 199, 0.22));
}
