/* ----------------------------------------------------
   SHOP (affiliazione) — isolamento totale
   ---------------------------------------------------- */

#shop-wrapper {
  width: min(1120px, 92%);
  margin: 0 auto;
  padding: 34px 0 80px;
}

#shop-wrapper .shop-hero {
  background: linear-gradient(180deg, #f7fbff, #eef6fb);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  padding: 26px 18px;
  box-shadow: var(--shadow);
}

#shop-wrapper .shop-hero h1 {
  margin: 0 0 8px;
  font-family: "Quicksand", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(26px, 4.8vw, 40px);
  color: var(--brand);
  letter-spacing: 0.01em;
}

#shop-wrapper .shop-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

#shop-wrapper .shop-disclosure {
  margin-top: 14px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  color: #415063;
  font-size: 0.95rem;
  line-height: 1.55;
}

#shop-wrapper .shop-disclosure strong {
  color: #0b1220;
}

#shop-wrapper .shop-section {
  margin-top: 28px;
}

/* Categorie: modalità compatta (sticky durante scroll prodotti) */

#shop-wrapper .shop-categories-section.is-compact {
  position: sticky;
  top: var(--shop-sticky-top, 72px); /* offset dinamico calcolato via JS */
  z-index: 80;
  margin-top: 18px;
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(2, 12, 27, 0.08);
}

#shop-wrapper .shop-categories-section.is-compact h2 {
  display: none;
}

#shop-wrapper .shop-categories-section.is-compact #shop-categories-hint {
  display: none;
}

#shop-wrapper .shop-categories-section.is-compact .shop-categories {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

#shop-wrapper .shop-categories-section.is-compact .shop-category-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

#shop-wrapper .shop-categories-section.is-compact .shop-category-card {
  width: auto;
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 999px;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
}

#shop-wrapper .shop-categories-section.is-compact .shop-category-card:hover {
  transform: none;
  box-shadow: none;
}

#shop-wrapper .shop-categories-section.is-compact .shop-category-card.is-selected,
#shop-wrapper .shop-categories-section.is-compact .shop-category-card[aria-pressed="true"] {
  border-color: rgba(13, 100, 133, 0.45);
  background: rgba(22, 151, 199, 0.1);
}

#shop-wrapper .shop-section h2 {
  margin: 0 0 10px;
  font-family: "Quicksand", system-ui, sans-serif;
  font-weight: 800;
  color: #0d6485;
  font-size: clamp(18px, 2.6vw, 22px);
}

#shop-wrapper .shop-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#shop-wrapper .shop-back {
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #0d6485;
  font-weight: 800;
  font-family: "Quicksand", system-ui, sans-serif;
  cursor: pointer;
}

#shop-wrapper .shop-back:hover {
  background: rgba(22, 151, 199, 0.1);
}

/* CATEGORIE */

#shop-wrapper .shop-categories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  #shop-wrapper .shop-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  #shop-wrapper .shop-categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#shop-wrapper .shop-category-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-family: "Quicksand", system-ui, sans-serif;
  font-weight: 800;
  color: #0b1220;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

#shop-wrapper .shop-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(2, 12, 27, 0.12);
}

#shop-wrapper .shop-category-card.is-selected,
#shop-wrapper .shop-category-card[aria-pressed="true"] {
  border-color: rgba(13, 100, 133, 0.45);
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}

#shop-wrapper .shop-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  #shop-wrapper .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1024px) {
  #shop-wrapper .shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#shop-wrapper .shop-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#shop-wrapper .shop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(2, 12, 27, 0.12);
}

#shop-wrapper .shop-card-media {
  height: 3px;
  background: transparent;
}

#shop-wrapper .shop-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

#shop-wrapper .shop-card-badge {
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  color: #0b1220;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

#shop-wrapper .shop-card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

#shop-wrapper .shop-card-title {
  margin: 0;
  font-family: "Quicksand", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.06rem;
  color: #0b1220;
  line-height: 1.25;
}

#shop-wrapper .shop-card-desc {
  margin: 0;
  color: #1c1f26;
  font-size: 0.98rem;
  line-height: 1.5;
}

#shop-wrapper .shop-card-notes {
  margin: 0;
  padding-left: 18px;
  color: #415063;
  font-size: 0.95rem;
  line-height: 1.45;
}

#shop-wrapper .shop-card-notes li {
  margin: 6px 0;
}

#shop-wrapper .shop-card-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#shop-wrapper .shop-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-family: "Quicksand", system-ui, sans-serif;
  border: 2px solid #0d6485;
  transition:
    transform 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
  cursor: pointer;
}

#shop-wrapper .shop-cta-primary {
  background: #0d6485;
  color: #ffffff;
  border-color: #0d6485;
}

#shop-wrapper .shop-cta-primary:hover {
  background: #0a5066;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(13, 100, 133, 0.25);
}

#shop-wrapper .shop-cta-secondary {
  background: #ffffff;
  color: #0d6485;
}

#shop-wrapper .shop-cta-secondary:hover {
  background: rgba(22, 151, 199, 0.1);
  transform: translateY(-1px);
}

#shop-wrapper .shop-cta-tertiary {
  background: #ffffff;
  color: #0b1220;
  border-color: rgba(15, 23, 42, 0.18);
}

#shop-wrapper .shop-cta-tertiary:hover {
  background: rgba(15, 23, 42, 0.04);
  transform: translateY(-1px);
}

#shop-wrapper .shop-meta {
  font-size: 0.88rem;
  color: #5b677a;
}

#shop-wrapper .shop-meta a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#shop-wrapper .shop-meta a:hover {
  color: #0d6485;
}

/* DRAWER */

.shop-no-scroll {
  overflow: hidden;
}

#shop-wrapper .shop-drawer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  justify-content: flex-end;
}

/* Rispetta l'attributo HTML `hidden` (evita overlay che blocca i click) */
#shop-wrapper .shop-drawer[hidden] {
  display: none !important;
}

#shop-wrapper .shop-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 12, 27, 0.55);
  opacity: 0;
  transition: opacity 200ms ease;
}

#shop-wrapper .shop-drawer-panel {
  position: relative;
  height: 100%;
  width: min(460px, 92vw);
  background: #ffffff;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 80px rgba(2, 12, 27, 0.35);
  transform: translateX(100%);
  transition: transform 220ms ease;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 18px;
  overflow: hidden;
}

#shop-wrapper .shop-drawer[data-open="true"] .shop-drawer-overlay {
  opacity: 1;
}

#shop-wrapper .shop-drawer[data-open="true"] .shop-drawer-panel {
  transform: translateX(0);
}

#shop-wrapper .shop-drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

#shop-wrapper .shop-drawer-close:focus-visible {
  outline: 3px solid #1697c7;
  outline-offset: 2px;
}

#shop-wrapper .shop-drawer-head {
  padding-right: 46px;
}

#shop-wrapper .shop-drawer-title {
  margin: 0;
  font-family: "Quicksand", system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  color: #0b1220;
  line-height: 1.2;
}

#shop-wrapper .shop-drawer-subtitle {
  margin: 10px 0 0;
  color: #415063;
  line-height: 1.5;
}

#shop-wrapper .shop-drawer-body {
  margin-top: 14px;
  padding-right: 2px;
  overflow: auto;
}

#shop-wrapper .shop-drawer-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

#shop-wrapper .shop-drawer-section h3 {
  margin: 0 0 8px;
  font-family: "Quicksand", system-ui, sans-serif;
  font-weight: 900;
  color: #0d6485;
  font-size: 1.02rem;
}

#shop-wrapper .shop-drawer-section p {
  margin: 0 0 10px;
  line-height: 1.6;
  color: #0b1220;
}

#shop-wrapper .shop-drawer-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#shop-wrapper .shop-drawer-similar {
  margin: 0;
  padding-left: 18px;
  color: #415063;
  line-height: 1.5;
}

#shop-wrapper .shop-similar-btn {
  background: transparent;
  border: 0;
  padding: 2px 0;
  color: #0d6485;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 800;
  font-family: "Quicksand", system-ui, sans-serif;
}

#shop-wrapper .shop-similar-btn:hover {
  color: #0a5066;
}

#shop-wrapper .shop-similar-link {
  color: #0d6485;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  #shop-wrapper .shop-drawer-overlay,
  #shop-wrapper .shop-drawer-panel,
  #shop-wrapper .shop-card,
  #shop-wrapper .shop-category-card,
  #shop-wrapper .shop-cta {
    transition: none !important;
  }
}
