/* Bottega Ink — scrittura milanese */

:root {
  --ink: #0f0f10;
  --paper: #efeade;
  --paper-dark: #e4dcc8;
  --accent: #b91c1c;
  --accent-soft: rgba(185, 28, 28, 0.12);
  --muted: #6b6560;
  --rule: rgba(15, 15, 16, 0.14);
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  border-bottom: 1px solid rgba(239, 234, 222, 0.08);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--paper);
}

.brand-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-tagline {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(239, 234, 222, 0.5);
  margin-top: 1px;
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(239, 234, 222, 0.7);
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--paper);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--paper);
  border: 1px solid rgba(239, 234, 222, 0.15);
  transition: border-color 0.2s;
}

.cart-trigger:hover {
  border-color: var(--accent);
}

.cart-trigger svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--paper);
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
}

.cart-badge.is-visible {
  display: flex;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  color: var(--paper);
  font-size: 1.25rem;
  border: 1px solid rgba(239, 234, 222, 0.15);
}

/* ── Hero split ── */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--header-h));
  max-height: 780px;
  border-bottom: 1px solid var(--rule);
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3rem 4rem max(1.5rem, calc((100vw - 1180px) / 2 + 1.5rem));
}

.hero-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-eyebrow::before {
  content: "— ";
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 38ch;
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.25s var(--ease);
  align-self: flex-start;
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.hero-notebook {
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.hero-notebook::before {
  content: "";
  position: absolute;
  inset: 2rem;
  border: 1px solid rgba(239, 234, 222, 0.1);
}

.notebook-block {
  width: min(320px, 80%);
  aspect-ratio: 3 / 4;
  background: var(--paper);
  padding: 2.5rem 2rem;
  position: relative;
  box-shadow: 12px 12px 0 rgba(185, 28, 28, 0.25);
}

.notebook-block::before {
  content: "";
  position: absolute;
  left: 2.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent);
  opacity: 0.4;
}

.notebook-rule {
  height: 1px;
  background: var(--rule);
  margin-bottom: 1.4rem;
}

.notebook-line {
  height: 6px;
  background: var(--ink);
  opacity: 0.12;
  margin-bottom: 0.9rem;
  border-radius: 1px;
}

.notebook-line:nth-child(2) { width: 85%; }
.notebook-line:nth-child(3) { width: 70%; }
.notebook-line:nth-child(4) { width: 90%; }
.notebook-line:nth-child(5) { width: 60%; }
.notebook-line:nth-child(6) { width: 75%; }

.notebook-caption {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: var(--serif);
  font-size: 0.75rem;
  font-style: italic;
  color: var(--accent);
}

/* ── Sections ── */

.section {
  padding: 5rem 1.5rem;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 400;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.section-intro {
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 3rem;
}

/* ── Motivi ── */

.motivi {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.motivi-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}

.motivo-item {
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.motivo-item:last-child {
  border-right: none;
}

.motivo-num {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
}

.motivo-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.motivo-text {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Products editorial list ── */

.products {
  background: var(--paper-dark);
}

.products-header {
  max-width: 900px;
  margin: 0 auto 2.5rem;
  padding: 0 0;
}

.product-list {
  max-width: 900px;
  margin: 0 auto;
  list-style: none;
}

.product-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.product-row:last-child {
  border-bottom: 1px solid var(--rule);
}

.product-thumb {
  width: 120px;
  height: 140px;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.product-thumb img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.product-info h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.product-info p {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 42ch;
  line-height: 1.55;
}

.product-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  min-width: 130px;
}

.product-price {
  font-family: var(--serif);
  font-size: 1.5rem;
  white-space: nowrap;
}

.product-price span {
  font-size: 0.85rem;
  color: var(--muted);
}

.btn-add {
  padding: 0.6rem 1.1rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── Steps ── */

.steps {
  border-bottom: 1px solid var(--rule);
}

.steps-flow {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  counter-reset: step;
}

.step-item {
  position: relative;
  padding-top: 3rem;
}

.step-item::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--serif);
  font-size: 2.5rem;
  color: var(--accent-soft);
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  line-height: 1;
}

.step-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.step-text {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Contact ── */

.contact {
  background: var(--ink);
  color: var(--paper);
}

.contact .section-label {
  color: rgba(185, 28, 28, 0.9);
}

.contact .section-title {
  color: var(--paper);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
  margin-top: 3px;
}

.contact-item strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(239, 234, 222, 0.5);
  margin-bottom: 0.25rem;
}

.contact-item a {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(185, 28, 28, 0.5);
}

.contact-item a:hover {
  text-decoration-color: var(--accent);
}

.contact-item span {
  color: rgba(239, 234, 222, 0.85);
}

.legal-block {
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(239, 234, 222, 0.65);
  padding: 1.5rem;
  border: 1px solid rgba(239, 234, 222, 0.1);
}

.legal-block strong {
  display: block;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* ── Footer colophon ── */

.site-footer {
  background: var(--ink);
  color: rgba(239, 234, 222, 0.45);
  border-top: 1px solid rgba(239, 234, 222, 0.06);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
}

.footer-colophon {
  text-align: center;
  font-family: var(--serif);
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.04em;
  color: rgba(239, 234, 222, 0.3);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(239, 234, 222, 0.06);
}

.footer-colophon::before,
.footer-colophon::after {
  content: "·";
  margin: 0 0.75rem;
  color: var(--accent);
  font-style: normal;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(239, 234, 222, 0.55);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--paper);
}

/* ── Cart drawer ── */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 16, 0.55);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--paper);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  border-left: 1px solid var(--rule);
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: var(--ink);
  color: var(--paper);
}

.cart-header h2 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
}

.cart-close {
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.cart-close:hover {
  opacity: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-style: italic;
}

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.cart-item-image {
  width: 56px;
  height: 64px;
  object-fit: contain;
  background: var(--paper-dark);
  border: 1px solid var(--rule);
  padding: 4px;
}

.cart-item-info h3 {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--rule);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.qty-btn:hover {
  border-color: var(--ink);
}

.qty-value {
  font-size: 0.85rem;
  min-width: 1.5rem;
  text-align: center;
}

.cart-item-remove {
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: 0.35rem;
}

.cart-item-total {
  font-family: var(--serif);
  font-size: 0.95rem;
  white-space: nowrap;
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--rule);
  background: var(--paper-dark);
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.btn-checkout {
  width: 100%;
  padding: 0.9rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.btn-checkout:hover:not(:disabled) {
  background: var(--accent);
}

.btn-checkout:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Checkout modal ── */

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.checkout-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 16, 0.6);
}

.checkout-panel {
  position: relative;
  width: min(440px, calc(100vw - 2rem));
  background: var(--paper);
  padding: 2.5rem 2rem;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 48px rgba(15, 15, 16, 0.2);
}

.checkout-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  font-size: 1.4rem;
  color: var(--muted);
}

.checkout-form h2,
.success-message h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.checkout-form p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.checkout-form label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.checkout-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}

.checkout-form input:focus {
  outline: none;
  border-color: var(--ink);
}

.checkout-actions .btn-primary {
  width: 100%;
  justify-content: center;
}

.success-message {
  text-align: center;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.5;
}

.success-message p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--rule);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--ink);
}

/* ── Cookie banner ── */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--ink);
  color: var(--paper);
  padding: 1.25rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.4s var(--ease);
  border-top: 2px solid var(--accent);
}

.cookie-banner.is-visible {
  transform: translateY(0);
}

.cookie-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-text {
  font-size: 0.88rem;
  color: rgba(239, 234, 222, 0.75);
  max-width: 60ch;
}

.cookie-text a {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-cookie-accept,
.btn-cookie-decline {
  padding: 0.6rem 1.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-cookie-accept {
  background: var(--accent);
  color: var(--paper);
}

.btn-cookie-decline {
  border: 1px solid rgba(239, 234, 222, 0.25);
  color: rgba(239, 234, 222, 0.7);
}

/* ── Legal pages ── */

.legal-page {
  padding: 3rem 1.5rem 5rem;
  min-height: calc(100vh - var(--header-h));
}

.legal-content {
  max-width: 680px;
  margin: 0 auto;
}

.legal-back {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}

.legal-content h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.legal-updated {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2rem;
  font-style: italic;
}

.legal-content h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin: 2rem 0 0.75rem;
}

.legal-content p,
.legal-content li {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.legal-content ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .hero-text {
    padding: 3rem 1.5rem;
    order: 1;
  }

  .hero-notebook {
    min-height: 320px;
    order: 0;
  }

  .motivi-grid {
    grid-template-columns: 1fr;
  }

  .motivo-item {
    border-right: none;
  }

  .product-row {
    grid-template-columns: 100px 1fr;
    gap: 1.25rem;
  }

  .product-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .steps-flow {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid rgba(239, 234, 222, 0.08);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
  }

  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .product-thumb {
    width: 90px;
    height: 110px;
  }

  .cookie-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
