/* ═══════════════════════════════════════════════════════════════════
   Shopia 1.1.0 — Frontend CSS
   Zero framework. Override theme variables:
   :root { --shp-color-primary: #yourcolor; }
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  --shp-color-primary:   #e05c00;
  --shp-color-primary-h: #c04e00;
  --shp-color-surface:   #ffffff;
  --shp-color-border:    #e2e8f0;
  --shp-color-text:      #1e293b;
  --shp-color-muted:     #64748b;
  --shp-color-price:     #b85c00;
  --shp-color-discount:  #dc2626;
  --shp-color-saving:    #16a34a;
  --shp-color-unavail:   #94a3b8;

  --shp-badge-best-bg:    #fef2f2;
  --shp-badge-best-color: #b91c1c;
  --shp-badge-sell-bg:    #fff7ed;
  --shp-badge-sell-color: #c2410c;
  --shp-badge-val-bg:     #f0fdf4;
  --shp-badge-val-color:  #15803d;

  --shp-radius:    8px;
  --shp-radius-lg: 12px;
  --shp-shadow:    0 2px 8px rgba(0,0,0,.08);
  --shp-shadow-lg: 0 4px 20px rgba(0,0,0,.12);
  --shp-trans:     .18s ease;

  --shp-grid-cols: 3;
  --shp-grid-gap:  20px;
}

/* ── Badges ────────────────────────────────────────────────────────── */
.shp-badges { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }

.shp-badge {
  display:inline-block;
  font-size:.72rem; font-weight:700; letter-spacing:.02em;
  padding:3px 10px; border-radius:99px; line-height:1.5;
}
.shp-badge--best   { background:var(--shp-badge-best-bg);  color:var(--shp-badge-best-color); }
.shp-badge--seller { background:var(--shp-badge-sell-bg);  color:var(--shp-badge-sell-color); }
.shp-badge--value  { background:var(--shp-badge-val-bg);   color:var(--shp-badge-val-color);  }

/* ── Price ─────────────────────────────────────────────────────────── */
.shp-price-wrap { margin:12px 0; }

.shp-price { display:inline-flex; flex-wrap:wrap; align-items:baseline; gap:6px; }

.shp-price__current {
  font-size:1.5rem; font-weight:700;
  color:var(--shp-color-price); font-variant-numeric:tabular-nums;
}
.shp-price__list  { font-size:.9rem; color:var(--shp-color-muted); text-decoration:line-through; }
.shp-price__saving {
  font-size:.75rem; font-weight:700;
  background:var(--shp-color-discount); color:#fff;
  padding:1px 6px; border-radius:4px;
}
.shp-price--unavailable { color:var(--shp-color-unavail); font-size:1rem; }
.shp-price__all-gateways { display:flex; flex-wrap:wrap; gap:10px; margin-top:8px; font-size:.82rem; }
.shp-price__gateway { background:var(--shp-color-border); border-radius:4px; padding:3px 8px; }
.shp-price__gateway-label { color:var(--shp-color-muted); margin-right:4px; }
.shp-price__gateway-price { font-weight:600; color:var(--shp-color-price); }

/* ── CTA Button ────────────────────────────────────────────────────── */
.shp-cta-button {
  display:inline-flex; align-items:center; gap:8px;
  background:var(--shp-color-primary); color:#fff !important;
  font-weight:600; font-size:.95rem;
  padding:12px 24px; border-radius:var(--shp-radius);
  text-decoration:none !important;
  transition:background var(--shp-trans), transform var(--shp-trans);
  cursor:pointer; border:none;
}
.shp-cta-button:hover,
.shp-cta-button:focus-visible {
  background:var(--shp-color-primary-h);
  transform:translateY(-1px); outline:none;
}
.shp-cta-button:active { transform:translateY(0); }
.shp-cta-button__icon  { font-size:1.1em; }

/* ── Stars ─────────────────────────────────────────────────────────── */
.shp-stars { display:inline-flex; align-items:center; gap:2px; font-size:1.1rem; }
.shp-star--full  { color:#f59e0b; }
.shp-star--half  { color:#f59e0b; opacity:.6; }
.shp-star--empty { color:#d1d5db; }
.shp-stars__val  { font-size:.82rem; font-weight:600; color:var(--shp-color-muted); margin-left:6px; }

/* ── Gallery ───────────────────────────────────────────────────────── */
.shp-gallery { display:flex; flex-direction:column; gap:10px; }

.shp-gallery__main {
  position:relative;
  background:var(--shp-color-surface);
  border:1px solid var(--shp-color-border);
  border-radius:var(--shp-radius);
  overflow:hidden; aspect-ratio:4/3;
  display:flex; align-items:center; justify-content:center;
}
.shp-gallery__main-img {
  max-width:100%; max-height:100%; object-fit:contain;
  cursor:zoom-in; transition:transform var(--shp-trans);
}
.shp-gallery__main-img:hover { transform:scale(1.03); }

.shp-gallery__thumbs { display:flex; flex-wrap:wrap; gap:8px; }
.shp-gallery__thumb {
  border:2px solid transparent; border-radius:var(--shp-radius);
  padding:0; cursor:pointer; background:none; overflow:hidden;
  transition:border-color var(--shp-trans);
}
.shp-gallery__thumb:hover,
.shp-gallery__thumb--active { border-color:var(--shp-color-primary); }
.shp-gallery__thumb img { display:block; width:72px; height:54px; object-fit:contain; }

/* ── Features / Specs ──────────────────────────────────────────────── */
.shp-features { margin:24px 0; }
.shp-features__title {
  font-size:1rem; font-weight:700; margin-bottom:12px;
  padding-bottom:6px; border-bottom:2px solid var(--shp-color-primary);
}
.shp-specs__list {
  display:grid; grid-template-columns:1fr;
  border:1px solid var(--shp-color-border);
  border-radius:var(--shp-radius); overflow:hidden;
}
.shp-specs__row {
  display:grid; grid-template-columns:40% 60%;
  border-bottom:1px solid var(--shp-color-border);
}
.shp-specs__row:last-child { border-bottom:none; }
.shp-specs__label,
.shp-specs__value { padding:8px 14px; font-size:.88rem; margin:0; line-height:1.5; }
.shp-specs__label { background:#f8fafc; font-weight:600; }

.shp-features__list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:6px; }
.shp-features__item {
  padding-left:22px; position:relative;
  font-size:.9rem; line-height:1.5;
}
.shp-features__item::before {
  content:'✓'; position:absolute; left:0;
  color:var(--shp-color-saving); font-weight:700;
}

/* ── Pros / Cons ───────────────────────────────────────────────────── */
.shp-pros-cons { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin:24px 0; }
.shp-pros-cons__col { border-radius:var(--shp-radius); padding:16px 20px; }
.shp-pros-cons__col--pros { background:#f0fdf4; }
.shp-pros-cons__col--cons { background:#fef2f2; }
.shp-pros-cons__title { font-size:.95rem; font-weight:700; margin:0 0 10px; display:flex; align-items:center; gap:6px; }
.shp-pros-cons__list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:6px; }
.shp-pros-cons__list li { font-size:.88rem; padding-left:16px; position:relative; line-height:1.5; }
.shp-pros-cons__col--pros li::before { content:'+'; position:absolute; left:0; color:var(--shp-color-saving); font-weight:700; }
.shp-pros-cons__col--cons li::before { content:'–'; position:absolute; left:0; color:var(--shp-color-discount); font-weight:700; }

/* ── Unavailable ───────────────────────────────────────────────────── */
.shp-unavailable { margin:20px 0; }
.shp-unavailable__box {
  display:flex; align-items:center; gap:12px;
  padding:16px 20px; background:#fff7ed;
  border:1px solid #fed7aa; border-radius:var(--shp-radius); margin-bottom:20px;
}
.shp-unavailable__msg { margin:0; font-size:.92rem; }
.shp-unavailable__alt-title { font-size:1rem; font-weight:700; margin:0 0 14px; }

/* ── Product Card ──────────────────────────────────────────────────── */
.shp-product-card {
  container-type:inline-size;
  background:var(--shp-color-surface);
  border:1px solid var(--shp-color-border);
  border-radius:var(--shp-radius-lg);
  box-shadow:var(--shp-shadow);
  overflow:hidden;
  display:flex; flex-direction:column;
  transition:box-shadow var(--shp-trans), transform var(--shp-trans);
}
.shp-product-card:hover { box-shadow:var(--shp-shadow-lg); transform:translateY(-2px); }
.shp-product-card > .shp-badges { padding:10px 14px 0; }

.shp-product-card__img-link { display:block; aspect-ratio:4/3; overflow:hidden; background:#f8fafc; }
.shp-product-card__img { width:100%; height:100%; object-fit:contain; transition:transform var(--shp-trans); }
.shp-product-card:hover .shp-product-card__img { transform:scale(1.04); }
.shp-product-card__no-img { width:100%; height:100%; display:grid; place-items:center; font-size:2.5rem; color:var(--shp-color-border); }

.shp-product-card__body { padding:14px; flex:1; display:flex; flex-direction:column; gap:6px; }
.shp-product-card__brand { font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--shp-color-muted); margin:0; }
.shp-product-card__title { font-size:.92rem; font-weight:600; margin:0; line-height:1.4; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.shp-product-card__title a { color:var(--shp-color-text); text-decoration:none; }
.shp-product-card__title a:hover { color:var(--shp-color-primary); }
.shp-product-card .shp-price__current { font-size:1.25rem; }

.shp-product-card__footer { padding:10px 14px 14px; display:flex; gap:8px; align-items:center; border-top:1px solid var(--shp-color-border); }
.shp-product-card__footer .shp-cta-button { flex:1; justify-content:center; padding:9px 14px; font-size:.85rem; }
.shp-product-card__more { font-size:.8rem; color:var(--shp-color-muted); text-decoration:none; white-space:nowrap; }
.shp-product-card__more:hover { color:var(--shp-color-primary); }

/* ── Product Row ───────────────────────────────────────────────────── */
.shp-product-row {
  display:grid; grid-template-columns:140px 1fr auto;
  gap:16px; align-items:start;
  background:var(--shp-color-surface);
  border:1px solid var(--shp-color-border);
  border-radius:var(--shp-radius-lg);
  box-shadow:var(--shp-shadow); padding:16px;
  transition:box-shadow var(--shp-trans);
}
.shp-product-row:hover { box-shadow:var(--shp-shadow-lg); }
.shp-product-row__img-link { display:block; aspect-ratio:4/3; background:#f8fafc; border-radius:var(--shp-radius); overflow:hidden; }
.shp-product-row__img { width:100%; height:100%; object-fit:contain; }
.shp-product-row__top { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.shp-product-row__brand { font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--shp-color-muted); }
.shp-product-row__title { font-size:.95rem; font-weight:600; margin:6px 0 8px; line-height:1.4; }
.shp-product-row__title a { color:var(--shp-color-text); text-decoration:none; }
.shp-product-row__title a:hover { color:var(--shp-color-primary); }
.shp-product-row__features { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:4px; }
.shp-product-row__features li { font-size:.82rem; color:var(--shp-color-muted); padding-left:14px; position:relative; }
.shp-product-row__features li::before { content:'·'; position:absolute; left:0; }
.shp-product-row__aside { display:flex; flex-direction:column; align-items:flex-end; gap:10px; min-width:140px; }
.shp-product-row__aside .shp-cta-button { font-size:.85rem; padding:9px 16px; }

/* ── Single product page ───────────────────────────────────────────── */
.shp-product-single { max-width:1100px; margin:0 auto; padding:24px 16px; }
.shp-product-single__container { display:grid; grid-template-columns:1fr 1fr; gap:40px; margin-bottom:40px; }
.shp-product-single__brand { font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color:var(--shp-color-muted); margin:0 0 6px; }
.shp-product-single__title { font-size:1.5rem; font-weight:700; line-height:1.3; margin:0 0 8px; }
.shp-product-single__subtitle { font-size:.95rem; color:var(--shp-color-muted); margin:0 0 12px; }
.shp-product-single .shp-price__current { font-size:1.8rem; }
.shp-product-single__cta { margin-top:20px; }
.shp-product-single__cta .shp-cta-button { padding:14px 32px; font-size:1rem; }
.shp-product-single__excerpt { font-size:1rem; color:var(--shp-color-muted); line-height:1.7; margin-bottom:24px; }
.shp-product-single__content { line-height:1.7; margin:24px 0; }
.shp-product-single__video-wrap { position:relative; aspect-ratio:16/9; margin:20px 0; border-radius:var(--shp-radius); overflow:hidden; }
.shp-product-single__video-wrap iframe { position:absolute; inset:0; width:100%; height:100%; border:none; }

/* ── Sticky CTA ────────────────────────────────────────────────────── */
.shp-sticky-cta {
  position:fixed; bottom:0; left:0; right:0; z-index:9999;
  background:var(--shp-color-surface);
  border-top:1px solid var(--shp-color-border);
  box-shadow:0 -4px 20px rgba(0,0,0,.1);
  transform:translateY(100%);
  transition:transform .3s ease;
}
.shp-sticky-cta--visible { transform:translateY(0); }
.shp-sticky-cta__inner { max-width:1200px; margin:0 auto; padding:10px 20px; display:flex; align-items:center; gap:16px; }
.shp-sticky-cta__img { flex-shrink:0; }
.shp-sticky-cta__img img { width:48px; height:48px; object-fit:contain; border-radius:4px; }
.shp-sticky-cta__info { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.shp-sticky-cta__title { font-size:.88rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--shp-color-text); }
.shp-sticky-cta__price { font-size:1rem; font-weight:700; color:var(--shp-color-price); }
.shp-sticky-cta__btn { white-space:nowrap; }
.shp-sticky-cta__close { flex-shrink:0; background:none; border:none; cursor:pointer; color:var(--shp-color-muted); font-size:1.1rem; padding:4px 8px; border-radius:4px; line-height:1; transition:background var(--shp-trans); }
.shp-sticky-cta__close:hover { background:var(--shp-color-border); }

/* ── Review inline ─────────────────────────────────────────────────── */
.shp-review-inline { margin:32px 0; padding:24px; background:#fafafa; border:1px solid var(--shp-color-border); border-radius:var(--shp-radius-lg); }
.shp-review-inline__header { margin-bottom:16px; }
.shp-review-inline__title { font-size:1.1rem; font-weight:700; margin:0 0 10px; }
.shp-review-inline__verdict { font-size:.9rem; color:var(--shp-color-muted); font-style:italic; margin:10px 0 0; }
.shp-review-inline__content { line-height:1.7; font-size:.93rem; }

/* ── Shortcode containers ───────────────────────────────────────────── */
.shp-grid { display:grid; grid-template-columns:repeat(var(--shp-grid-cols,3),1fr); gap:var(--shp-grid-gap,20px); }
.shp-list { display:flex; flex-direction:column; gap:14px; }

/* ── Lightbox ───────────────────────────────────────────────────────── */
.shp-lightbox {
  position:fixed; inset:0; z-index:99999;
  background:rgba(0,0,0,.9);
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none;
  transition:opacity .22s ease;
}
.shp-lightbox--open { opacity:1; pointer-events:auto; }
.shp-lightbox__img-wrap { position:relative; max-width:90vw; max-height:90vh; display:flex; align-items:center; justify-content:center; }
.shp-lightbox__img { max-width:90vw; max-height:90vh; object-fit:contain; border-radius:4px; user-select:none; }
.shp-lightbox__close,
.shp-lightbox__prev,
.shp-lightbox__next {
  position:fixed;
  background:rgba(255,255,255,.15); border:none; color:#fff;
  cursor:pointer; border-radius:50%;
  width:44px; height:44px; font-size:1.2rem;
  display:flex; align-items:center; justify-content:center;
  transition:background .15s; z-index:100000;
}
.shp-lightbox__close { top:16px; right:16px; }
.shp-lightbox__prev  { left:16px; top:50%; transform:translateY(-50%); }
.shp-lightbox__next  { right:16px; top:50%; transform:translateY(-50%); }
.shp-lightbox__close:hover,
.shp-lightbox__prev:hover,
.shp-lightbox__next:hover { background:rgba(255,255,255,.3); }
.shp-lightbox__counter { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); color:rgba(255,255,255,.7); font-size:.85rem; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width:900px) {
  .shp-product-single__container { grid-template-columns:1fr; }
  .shp-grid { --shp-grid-cols:2; }
  .shp-pros-cons { grid-template-columns:1fr; }
}

@media (max-width:600px) {
  .shp-grid { --shp-grid-cols:1; }
  .shp-product-row { grid-template-columns:90px 1fr; grid-template-rows:auto auto; }
  .shp-product-row__aside { grid-column:1/-1; flex-direction:row; align-items:center; justify-content:space-between; }
  .shp-sticky-cta__img,
  .shp-sticky-cta__title { display:none; }
  .shp-sticky-cta__btn { flex:1; justify-content:center; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Shopia 2.0 — dati normalizzati, punteggio, opinioni, confronto
   ══════════════════════════════════════════════════════════════════════════ */

.shp-product-card__media,
.shp-product-row__media { display: block; }
.shp-product-card__no-img,
.shp-product-row__no-img { background: #f1f5f9; aspect-ratio: 4 / 3; border-radius: var(--shp-radius); }

/* Score */
.shp-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 8px 0 12px; }
.shp-score__value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.shp-score__max { color: var(--shp-color-muted); font-weight: 600; }
.shp-score__label { flex-basis: 100%; font-size: .85rem; color: var(--shp-color-muted); }
.shp-score--high .shp-score__value { color: #15803d; }
.shp-score--mid  .shp-score__value { color: #b45309; }
.shp-score--low  .shp-score__value { color: #b91c1c; }
.shp-score--compact { margin: 4px 0 8px; }
.shp-score--compact .shp-score__value { font-size: 1.15rem; }
.shp-score--none { font-size: .9rem; color: var(--shp-color-muted); }

/* Price freshness */
.shp-price__updated { display: block; font-size: .75rem; color: var(--shp-color-muted); margin-top: 2px; }
.shp-price__info { cursor: help; margin-left: 2px; }

/* Verdict */
.shp-verdict { border-left: 4px solid var(--shp-color-primary); background: #fffaf5; padding: 12px 16px; border-radius: 0 var(--shp-radius) var(--shp-radius) 0; margin: 0 0 24px; }
.shp-verdict__label { font-weight: 700; margin: 0 0 4px; }
.shp-verdict__text { margin: 0; }

/* Data table */
.shp-data { margin: 32px 0; }
.shp-data__table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.shp-data__table th, .shp-data__table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--shp-color-border); vertical-align: top; }
.shp-data__table th { width: 40%; font-weight: 600; }
.shp-data__source { font-size: .75rem; color: var(--shp-color-muted); white-space: nowrap; }

/* Opinions */
.shp-opinions { margin: 32px 0; }
.shp-opinions__list { list-style: none; margin: 0; padding: 0; }
.shp-opinions__item { padding: 10px 0 10px 14px; border-left: 3px solid var(--shp-color-border); margin-bottom: 8px; }
.shp-opinions__item--positiva { border-left-color: #16a34a; }
.shp-opinions__item--negativa { border-left-color: #dc2626; }
.shp-opinions__item--mista    { border-left-color: #d97706; }
.shp-opinions__meta { display: block; font-size: .85rem; color: var(--shp-color-muted); }
.shp-opinions__summary { display: block; }
.shp-opinions__note, .shp-opinions__ratings { font-size: .85rem; color: var(--shp-color-muted); }

/* FAQ */
.shp-faq { margin: 32px 0; }
.shp-faq__item { border-bottom: 1px solid var(--shp-color-border); padding: 10px 0; }
.shp-faq__q { cursor: pointer; font-weight: 600; }
.shp-faq__a { margin: 8px 0 0; }

/* Method note */
.shp-method-note { margin: 32px 0 0; padding: 14px 16px; background: #f8fafc; border: 1px solid var(--shp-color-border); border-radius: var(--shp-radius); font-size: .85rem; color: var(--shp-color-muted); }
.shp-method-note p { margin: 0; }

/* Compare */
.shp-compare { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
.shp-compare__table { border-collapse: collapse; min-width: 560px; width: 100%; font-size: .9rem; }
.shp-compare__table th, .shp-compare__table td { border-bottom: 1px solid var(--shp-color-border); padding: 8px; text-align: center; vertical-align: middle; }
.shp-compare__table tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.shp-compare__table thead img { display: block; margin: 0 auto 6px; max-width: 96px; height: auto; }
.shp-compare__name { display: block; font-weight: 600; }
.shp-compare__score td { font-weight: 700; }
.shp-compare__note { font-size: .8rem; color: var(--shp-color-muted); }
.shp-compare .shp-cta-button { padding: 8px 12px; font-size: .85rem; }

/* Notice visible only to editors */
.shp-notice-editor { border: 1px dashed #d97706; background: #fffbeb; color: #92400e; padding: 8px 12px; border-radius: var(--shp-radius); font-size: .85rem; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
