﻿:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #14213d;
  --muted: #667085;
  --line: #e6e9f0;
  --brand: #155e75;
  --brand2: #0f766e;
  --soft: #eef7f5;
  --shadow: 0 18px 50px rgba(20, 33, 61, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, 92%); margin: auto; }

.topbar {
  background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.16), transparent 28%), linear-gradient(135deg, #082f49, #0f766e);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.topbar:before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 520px;
  height: 520px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  gap: 20px;
  position: relative;
  z-index: 2;
}
.brand { display: flex; flex-direction: column; }
.brand b { font-size: 1.15rem; letter-spacing: .2px; }
.brand small { opacity: .85; }
.nav a.home-link {
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}


/* Barra superiore della pagina dettaglio: stessa tinta dell'intestazione */
.detail-topbar {
  background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.16), transparent 28%), linear-gradient(135deg, #082f49, #0f766e);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.detail-topbar .nav a.home-link {
  background: #ffffff;
  color: #0f4d5a;
  border-color: #ffffff;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
  font-weight: 900;
}
.detail-topbar .nav a.home-link:hover {
  transform: translateY(-2px);
  background: #eef7f5;
}
.detail-topbar .brand small { opacity: .9; }

.hero { padding: 64px 0 76px; position: relative; z-index: 2; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 34px;
  align-items: center;
}
.kicker,
.section-kicker {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .86rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.kicker {
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.1);
  color: #fff;
}
.section-kicker {
  color: #0f766e;
  background: #e8f6f3;
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 4.2rem);
  line-height: 1.05;
  margin: 18px 0;
  max-width: 850px;
}
.hero p { font-size: 1.18rem; max-width: 720px; opacity: .92; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  border: 1px solid transparent;
  transition: .2s ease;
}
.btn.primary { background: #fff; color: #0f4d5a; }
.btn.ghost { border-color: rgba(255,255,255,.32); color: #fff; }
.btn:hover { transform: translateY(-2px); }

.hero-card {
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 28px;
  padding: 28px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.hero-message h2 {
  margin: 12px 0 10px;
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  line-height: 1.15;
}
.hero-message p { margin: 0 0 18px; font-size: 1rem; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: #0f4d5a;
  background: #fff;
  font-weight: 900;
  font-size: .84rem;
}
.hero-checks { list-style: none; padding: 0; margin: 18px 0 0; }
.hero-checks li {
  position: relative;
  padding: 11px 0 11px 34px;
  border-top: 1px solid rgba(255,255,255,.18);
  font-weight: 700;
}
.hero-checks li:before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 10px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.95);
  color: #0f766e;
  font-size: .85rem;
  font-weight: 900;
}

.why-section { padding: 22px 0 8px; }
.section-heading {
  text-align: center;
  max-width: 780px;
  margin: 38px auto 24px;
}
.section-heading span {
  display: inline-block;
  margin-bottom: 8px;
  color: #0f766e;
  font-weight: 900;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.section-heading h2 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  color: #102a4c;
  line-height: 1.18;
}
.section-heading p {
  margin: 0;
  color: #65748b;
  font-size: 1rem;
  line-height: 1.6;
}
.home-plus {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 26px 0 14px;
}
.plus-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 25px 20px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(20, 40, 80, .08);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.plus-card:hover {
  transform: translateY(-5px);
  border-color: #c8ddd9;
  box-shadow: 0 16px 34px rgba(20, 40, 80, .14);
}
.plus-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef7f5, #eef4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.plus-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #18345d;
}
.plus-card p {
  margin: 0;
  font-size: .94rem;
  line-height: 1.55;
  color: #5d6b82;
}

.section { padding: 48px 0; }
.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.section-title h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-title p { margin: 0; color: var(--muted); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.search {
  flex: 1;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 1rem;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20,33,61,.04);
}
.search:focus { outline: 3px solid rgba(15,118,110,.14); border-color: #0f766e; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.book-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(20,33,61,.07);
  display: flex;
  flex-direction: column;
  transition: .2s ease;
}
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.cover-wrap {
  background: linear-gradient(180deg, #eef7f5, #fff);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 330px;
}
.cover-wrap img {
  max-height: 285px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(15,23,42,.18);
}
.book-body { padding: 22px; display: flex; flex: 1; flex-direction: column; }
.book-body h3 { font-size: 1.18rem; line-height: 1.25; margin: 0 0 7px; }
.book-body h3 a:hover { color: var(--brand2); }
.subtitle { color: var(--brand); font-weight: 800; margin: 0 0 12px; }
.desc { color: var(--muted); font-size: .96rem; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.pill {
  font-size: .82rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef7f5;
  color: #0f766e;
}
.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
}
.price { font-size: 1.25rem; font-weight: 900; color: #111827; }
.book-card .btn.primary,
.sidebox .btn.primary,
.buy-panel .btn.primary { background: #0f766e; color: #fff; }
.book-card .btn.primary:hover,
.sidebox .btn.primary:hover,
.buy-panel .btn.primary:hover { background: #115e59; }

.detail-hero { background: linear-gradient(135deg, #082f49, #0f766e); color: #fff; padding: 36px 0 48px; }
.breadcrumb { font-size: .95rem; opacity: .9; margin-bottom: 22px; }
.detail-grid { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 38px; align-items: start; }
.detail-cover { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); border-radius: 30px; padding: 26px; box-shadow: var(--shadow); align-self: start; display: flex; align-items: center; justify-content: center; }
.detail-cover img { border-radius: 10px; box-shadow: 0 20px 42px rgba(0,0,0,.25); margin: auto; width: 100%; max-width: 350px; height: auto; object-fit: contain; }
.detail-info { min-width: 0; display: block; }
.detail-info h1 { font-size: clamp(1.95rem, 3.7vw, 3.2rem); line-height: 1.08; margin: 0 0 12px; }
.detail-info .lead { font-size: 1.6rem; opacity: .94; }
.buy-panel { background: #fff; color: var(--text); border-radius: 26px; padding: 22px; margin-top: 24px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.buy-panel .price { font-size: 1.8rem; }
.content-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 30px; align-items: start; }
.prose { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 34px; box-shadow: 0 10px 30px rgba(20,33,61,.06); }
.prose h2 { margin-top: 0; }
.prose p { margin: 0 0 1rem; }
.prose ul { padding-left: 1.2rem; }
.sidebox { position: sticky; top: 18px; }
.info-box,
.cartadocente { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 22px; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(20,33,61,.06); }
.info-row { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row strong { text-align: right; }
.cartadocente img { max-width: 220px; margin: auto; }
.ad-box { border: 1px dashed #94a3b8; background: #fff; border-radius: 24px; padding: 22px; text-align: center; color: #475569; margin: 28px auto; box-shadow: 0 6px 24px rgba(20,33,61,.05); }
.ad-box span { display: inline-block; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; color: #0f766e; margin-bottom: 8px; }
.ad-box strong { display: block; }
.footer { background: #071a2d; color: #dbeafe; margin-top: 50px; padding: 36px 0; }
.footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.backtop { color: #fff; opacity: .8; }
.empty { display: none; background: #fff; border-radius: 20px; padding: 25px; border: 1px solid var(--line); color: var(--muted); }
.muted { color: var(--muted); font-size: .95rem; }
.extra-info h3,
.cartadocente h3,
.info-box h3 { margin-top: 0; }
.cartadocente p,
.extra-info p { color: var(--muted); }

@media (max-width: 980px) {
  .hero-grid,
  .detail-grid,
  .content-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .home-plus { grid-template-columns: repeat(2, 1fr); }
  .sidebox { position: static; }
  .detail-cover { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); border-radius: 30px; padding: 26px; box-shadow: var(--shadow); align-self: start; display: flex; align-items: center; justify-content: center; }
  .buy-panel { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 52px; }
}

@media (max-width: 640px) {
  .nav { align-items: flex-start; flex-direction: column; }
  .grid,
  .home-plus { grid-template-columns: 1fr; }
  .cover-wrap { min-height: 280px; }
  .cover-wrap img { max-height: 245px; }
  .section-title { display: block; }
  .prose { padding: 24px; }
  .footer .container { display: block; }
  .detail-cover img { border-radius: 10px; box-shadow: 0 20px 42px rgba(0,0,0,.25); margin: auto; width: 100%; max-width: 350px; height: auto; object-fit: contain; }
  .hero-card { padding: 22px; }
}


/* Correzione stabile pagina dettaglio: intestazione sopra, copertina a sinistra, testo a destra */
.topbar,
.detail-hero {
  min-height: auto;
}

.detail-hero .breadcrumb {
  display: block;
  width: 100%;
  margin-bottom: 22px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 38px;
  align-items: start;
}

.detail-cover {
  grid-column: 1;
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 0;
}

.detail-info {
  grid-column: 2;
  min-width: 0;
  display: block;
}

.detail-cover img {
  width: 100%;
  max-width: 350px;
  height: auto;
  object-fit: contain;
}

@media (max-width: 980px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-cover,
  .detail-info {
    grid-column: auto;
  }
  .detail-cover {
    max-width: 420px;
    margin: 0 auto;
  }
}


/* Paginazione catalogo */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 34px 0 0;
}

.page-link,
.page-dots {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border: 1px solid var(--line);
  background: #fff;
  color: #18345d;
  box-shadow: 0 8px 22px rgba(20,33,61,.05);
}

.page-link:hover {
  transform: translateY(-2px);
  border-color: #0f766e;
  color: #0f766e;
}

.page-link.current {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  cursor: default;
}

.page-link.disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.page-prev,
.page-next {
  min-width: 118px;
}

.page-dots {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

@media (max-width: 640px) {
  .pagination {
    gap: 7px;
  }

  .page-link,
  .page-dots {
    min-width: 38px;
    height: 38px;
    padding: 0 11px;
    font-size: .92rem;
  }

  .page-prev,
  .page-next {
    min-width: auto;
  }
}

/* Uniforma la barra superiore della pagina dettaglio
   La nav del dettaglio usa un colore pieno per evitare lo stacco del gradiente dalla hero. */
.detail-topbar {
  background: #071a2d;
  color: #fff;
  position: relative;
  overflow: visible;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.detail-topbar .nav {
  padding: 20px 0;
}

.detail-topbar .brand b,
.detail-topbar .brand small {
  color: #fff;
}

.detail-topbar .nav a.home-link {
  background: #ffffff;
  color: #071a2d;
  border-color: #ffffff;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
  font-weight: 900;
}

.detail-topbar .nav a.home-link:hover {
  background: #eef7f5;
  color: #071a2d;
}
