/*
 * Cartabianca — Product Page Stylesheet
 * Child theme: cartabianca
 * Path: wp-content/themes/cartabianca/css/product-page.css
 */

/* ── Wrapper generale ─────────────────────────────────────── */
.cb-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 40px;
  font-family: 'Open Sans', sans-serif;
  color: #1a1a1a;
}

/* ── Colonna sinistra: cover ──────────────────────────────── */
.cb-cover-wrap { margin-bottom: 12px; }
.cb-cover-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.cb-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
}
.cb-thumb-btn {
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  background: none;
}
.cb-thumb-btn.active,
.cb-thumb-btn:hover { border-color: #009b8d; }
.cb-thumb-img { width: 44px; height: 56px; object-fit: cover; border-radius: 2px; display: block; }

.cb-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #009b8d;
  text-decoration: none;
  margin-bottom: 20px;
}
.cb-preview-link:hover { text-decoration: underline; }

/* ── Scheda tecnica ───────────────────────────────────────── */
.cb-spec-block { margin-top: 4px; }

.cb-sec-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #777;
  margin: 0 0 10px;
}

.cb-spec-dl { margin: 0; }
.cb-spec-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 4px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
}
.cb-spec-row:last-child { border-bottom: none; }
.cb-spec-row dt {
  color: #888;
  font-weight: 400;
  margin: 0;
}
.cb-spec-row dd {
  color: #1a1a1a;
  font-weight: 500;
  margin: 0;
  word-break: break-word;
}

/* ── Colonna destra ───────────────────────────────────────── */
.cb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.cb-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f1f1f1;
  color: #555;
  text-decoration: none;
  letter-spacing: 0.04em;
}
.cb-pill:hover { background: #e4e4e4; color: #333; }

.cb-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
  margin: 0 0 6px;
}
.cb-subtitle {
  font-size: 15px;
  color: #666;
  margin: 0 0 10px;
}
.cb-author-line {
  font-size: 14px;
  color: #888;
  margin: 0 0 16px;
}
.cb-author-link {
  color: #009b8d;
  font-weight: 600;
  text-decoration: none;
}
.cb-author-link:hover { text-decoration: underline; }

.cb-stats-line {
  font-size: 13px;
  color: #666;
  margin: 0 0 20px;
}
.cb-stats-line strong { color: #1a1a1a; font-weight: 600; }

/* ── Tagline e sinossi ────────────────────────────────────── */
.cb-tagline {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  color: #1a1a1a;
  border-left: 3px solid #ffc838;
  padding: 2px 0 2px 14px;
  margin: 12px 0 14px;
}
.cb-synopsis-hero { margin: 0 0 18px; }
.cb-incipit { font-size: 14px; line-height: 1.72; color: #333; margin: 0; }
.cb-synopsis-full { font-size: 14px; line-height: 1.72; color: #333; margin-top: 10px; }
.cb-synopsis-full p { margin: 0 0 12px; }
.cb-synopsis-full p:last-child { margin-bottom: 0; }
.cb-read-more {
  background: none;
  border: none;
  padding: 4px 0 0;
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #009b8d;
  cursor: pointer;
}
.cb-read-more:hover { text-decoration: underline; }
.cb-info-mobile-top .cb-tagline { margin-bottom: 4px; }

/* ══════════════════════════════════════════════════════════
   SELECTOR WIDGET — box scelta formato e acquisto
   Palette allineata al sito: teal #009b8d / amber #ffc838
   (REINTEGRATO: questo blocco era andato perso)
═══════════════════════════════════════════════════════════ */
#cb-selector-root .sel-wrap {
  background: #fcfcfc; border: 1px solid #009b8d;
  border-radius: 12px; overflow: hidden; margin-bottom: 0;
}
#cb-selector-root .sel-header {
  padding: 13px 16px 11px; border-bottom: 1px solid #009b8d;
}
#cb-selector-root .sel-header p {
  font-size: 14px; color: #1a1a1a; line-height: 1.55; margin: 0;
}
#cb-selector-root .sel-body { padding: 14px 16px; }
#cb-selector-root .opts-legend {
  display: block; font-size: 12px; color: #555;
  margin-bottom: 8px; font-weight: 600; letter-spacing: .02em;
}
#cb-selector-root .opts-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
#cb-selector-root .sel-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 14px 0 10px; border: 2px solid #ccc; border-radius: 999px;
  font-size: 13px; font-weight: 700; cursor: pointer; color: #888; background: #fff;
  transition: background .15s, border-color .15s, color .15s;
  font-family: 'Open Sans', sans-serif; min-height: 44px; min-width: 44px; line-height: 1;
}
#cb-selector-root .sel-opt svg { display: block; flex-shrink: 0; }
#cb-selector-root .sel-opt:focus-visible { outline: 3px solid #009b8d; outline-offset: 2px; }
#cb-selector-root .detail-card {
  border: 2px solid #009b8d; border-radius: 12px; padding: 14px 16px;
  background: #e5f5f4; transition: background .15s, border-color .15s;
}
#cb-selector-root .detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 6px; gap: 8px; flex-wrap: wrap;
}
#cb-selector-root .detail-name { font-size: 15px; font-weight: 600; color: #1a1a1a; margin: 0; }
#cb-selector-root .savings-badge {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: transparent; color: #c07a00;
  border: 1.5px solid #c07a00;
  visibility: hidden; /* default nascosto ma con ingombro; JS lo rende visibile */
}
#cb-selector-root .state-badge-reprint {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: transparent; color: #9a6200;
  border: 1px solid #e0b96a; margin-bottom: 10px;
}
#cb-selector-root .state-badge-coming {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: transparent; color: #006b60;
  border: 1px solid #8fccc5; margin-bottom: 10px;
}
#cb-selector-root .detail-desc {
  font-size: 13px; color: #444; line-height: 1.6; margin: 0 0 10px;
}
#cb-selector-root .chips {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; list-style: none; padding: 0;
}
#cb-selector-root .chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: transparent; color: #006b60; font-weight: 600; border: 1px solid #8fccc5;
}
#cb-detail-card.cb-fmt-cartaceo .chip { color: #9a6200; border-color: #e0b96a; }
#cb-selector-root .buy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#cb-selector-root .price {
  font-size: 26px; font-weight: 700; color: #1a1a1a; min-width: 90px; line-height: 1.1;
}
#cb-selector-root .btn-cart {
  flex: 1; min-width: 160px; padding: 11px 16px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; color: #fff; background: #009b8d;
  transition: filter .15s; font-family: 'Open Sans', sans-serif; min-height: 44px;
}
#cb-selector-root .btn-cart:hover { filter: brightness(1.12); }
#cb-selector-root .btn-cart:disabled { background: #aaa; cursor: not-allowed; filter: none; }
#cb-selector-root .btn-cart:focus-visible { outline: 3px solid #ffc838; outline-offset: 2px; }
#cb-selector-root .sel-footer { font-size: 11px; color: #888; margin: 8px 0 0; text-align: center; }

/* ── Trust strip ──────────────────────────────────────────── */
.cb-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  background: #f7f7f7;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 14px;
  font-size: 12px;
  color: #666;
}
.cb-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Sezioni generali ─────────────────────────────────────── */
.cb-section {
  border-top: 1px solid #efefef;
  padding-top: 28px;
  margin-top: 28px;
}

/* ── Gallery pagine interne ───────────────────────────────── */
.cb-gallery-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cb-gallery-img {
  height: 180px;
  width: auto;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
}
.cb-gallery-img:hover { opacity: .85; }

/* Gallery inline nella colonna destra */
.cb-inline-gallery { margin-top: 4px; }
.cb-inline-gallery .cb-gallery-strip { flex-wrap: wrap; gap: 8px; overflow-x: visible; }
.cb-inline-gallery .cb-gallery-img   { max-width: 120px; height: 160px; }

/* ── Body grid: gallery sx + press dx ────────────────────── */
.cb-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Rassegna stampa ──────────────────────────────────────── */
.cb-press-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.cb-press-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid #efefef;
  border-radius: 8px;
  background: #fafafa;
}
.cb-press-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}
.cb-press-logo-ph {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%;
  background: #e4e4e4; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #888;
}
.cb-press-name { font-size: 13px; font-weight: 600; color: #1a1a1a; margin: 0 0 4px; }
.cb-press-link { font-size: 12px; color: #009b8d; text-decoration: none; }
.cb-press-link:hover { text-decoration: underline; }

/* ── Press strip: card di larghezza fissa per allineamento colonne ──
   Il critical CSS inline di cb-single-product.php applica
   `.cb-press-card { flex: 0 1 auto }` che produce packing irregolare
   con card di larghezza variabile (dipende dalla lunghezza del nome
   della testata). Forzando una larghezza fissa di 300px:
   • le immagini si allineano sempre sulle stesse colonne;
   • i nomi corti come "JP4" lasciano whitespace innocuo a destra;
   • i nomi lunghi come "Istituto Nazionale di Astrofisica" o
     "La Stampa - Laboratorio TuttoScienze" vanno automaticamente
     su 2 righe (il browser fa il wrap quando il testo supera i
     178px disponibili = 300 - 110 immagine - 12 gap);
   • la card resta sempre alta 78px (dominata dall'immagine),
     quindi anche con nome a 2 righe l'altezza delle righe
     della strip è uniforme.
   Specificità (0,2,0) + !important vince sul critical CSS inline. */
.cb-press-strip .cb-press-card {
  flex: 1 1 240px !important;
  max-width: 360px !important;
}

/* ── Autore ───────────────────────────────────────────────── */
.cb-author-block { display: flex; gap: 18px; align-items: flex-start; }
.cb-author-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: #fff8e1; border: 2px solid #ffc838;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #7a5000; flex-shrink: 0;
}
.cb-author-avatar--photo {
  display: block; width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden; border: 2px solid #ffc838; flex-shrink: 0; cursor: pointer;
}
.cb-author-avatar--photo img {
  width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s;
}
.cb-author-avatar--photo:hover img { opacity: .85; }
.cb-author-name { font-size: 15px; font-weight: 700; color: #1a1a1a; margin: 0 0 8px; }
.cb-author-bio { font-size: 13px; line-height: 1.78; color: #333; margin-bottom: 12px; }
.cb-author-bio p { margin: 0 0 10px; }
.cb-author-bio p:last-child { margin-bottom: 0; }
.cb-author-books-label {
  font-size: 12px; font-weight: 500; color: #aaa;
  text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 8px;
}
.cb-author-books { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-author-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: #f1f1f1; color: #555; text-decoration: none;
  transition: background .15s, color .15s;
}
.cb-author-tag:hover { background: #ffc838 !important; color: #1a1a1a !important; }

/* ── Prodotti correlati ───────────────────────────────────── */
.cb-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cb-related-card {
  border: none;
  border-radius: 0;
  overflow: visible;
  background: none;
  text-decoration: none;
  display: block;
  text-align: left;
}
.cb-related-card:hover .cb-related-name { color: #009b8d; }
.cb-related-img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  object-position: left top;
  display: block;
  margin-bottom: 8px;
}
.cb-related-img-ph { width: 100%; height: 220px; background: #f3f3f3; }
.cb-related-info { padding: 0; }
.cb-related-name { font-size: 13px; font-weight: 600; color: #1a1a1a; margin: 0 0 4px; }
.cb-related-price { font-size: 13px; color: #009b8d; font-weight: 600; }

/* ── Condivisione (riga scheda tecnica) ───────────────────── */
.cb-share-row { align-items: center; }
.cb-share-row dt { color: #888; font-weight: 400; }
.cb-share-row dd { display: flex; align-items: center; gap: 14px; }
.cb-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #f3f3f3;
  color: #666;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.cb-share-btn:hover { background: #009b8d; color: #fff; }

/* ── Recensioni (template WooCommerce nativo, armonizzato) ── */
.cb-reviews-wrap { font-size: 14px; }

/* Nasconde l'h2 nativo "Recensioni" — usiamo già il cb-sec-label sopra */
.cb-reviews-wrap #reviews #comments > h2:first-child { display: none; }

.cb-reviews-wrap .commentlist {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 14px;
}

/* ─ Link verdi: "effettuare l'accesso" e Akismet privacy ─── */
.cb-reviews-wrap a,
.cb-reviews-wrap #respond a,
.cb-reviews-wrap p.must-log-in a,
.cb-reviews-wrap .comment-notes a {
  color: #009b8d;
  text-decoration: none;
}
.cb-reviews-wrap a:hover,
.cb-reviews-wrap #respond a:hover,
.cb-reviews-wrap p.must-log-in a:hover,
.cb-reviews-wrap .comment-notes a:hover {
  color: #007a6d;
  text-decoration: underline;
}

/* ─ Box singoli commenti: piena larghezza, sfondo mint, bordo grigio chiaro */
.cb-reviews-wrap .commentlist li.review,
.cb-reviews-wrap .commentlist li.comment {
  border: 1px solid #c8c8c8 !important;
  border-radius: 10px;
  padding: 14px 16px;
  background: #cde7e4 !important;
  margin-left: 0 !important;
}
.cb-reviews-wrap .comment-text,
.cb-reviews-wrap .comment_container {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.cb-reviews-wrap .meta { font-size: 13px; color: #666; margin-bottom: 6px; }
.cb-reviews-wrap .meta strong { color: #1a1a1a; }
.cb-reviews-wrap .star-rating { font-size: 13px; margin-bottom: 6px; color: #ffb800; }
.cb-reviews-wrap .description p { line-height: 1.7; color: #333; margin: 0; }
.cb-reviews-wrap p.no-comments {
  padding: 16px; background: #f7f7f7; border-radius: 8px;
  color: #888; text-align: center; font-size: 13px;
}

/* ─ Form recensione ──────────────────────────────────────── */
.cb-reviews-wrap #review_form_wrapper { margin-top: 8px; }
.cb-reviews-wrap #reply-title { font-size: 15px; font-weight: 700; color: #1a1a1a; margin-bottom: 8px; }
.cb-reviews-wrap #respond textarea,
.cb-reviews-wrap #respond input[type="text"],
.cb-reviews-wrap #respond input[type="email"] {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  margin-bottom: 10px;
}
.cb-reviews-wrap #respond .form-submit input,
.cb-reviews-wrap #respond button {
  background: #009b8d;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
}
.cb-reviews-wrap #respond .form-submit input:hover { filter: brightness(1.1); }
.cb-reviews-wrap .comment-form-rating label { display: block; margin-bottom: 4px; font-size: 13px; color: #555; }
.cb-reviews-wrap .stars a { color: #ffb800; }

/* ── Responsive — Tablet ──────────────────────────────────── */
@media (max-width: 768px) {
  .cb-body-grid   { grid-template-columns: 1fr; }
  .cb-related-grid { grid-template-columns: repeat(2, 1fr); }
  .cb-press-grid  { grid-template-columns: 1fr; }
}

/* ── Responsive — Mobile ──────────────────────────────────── */
@media (max-width: 480px) {
  .cb-cover-wrap { max-width: 160px; }
  .cb-related-grid { grid-template-columns: 1fr; }
}
