:root {
  --navy: #2b2b2b;
  --navy-dark: #1a1a1a;
  --orange: #ff6a00;
  --orange-dark: #d95700;
  --red: #e0201a;
  --red-dark: #b8140f;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e7ebf3;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: Lora, Georgia, serif; margin: 0; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.site-header-inner { max-width: 1180px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 22px; font-weight: 800; color: var(--navy); }
.brand-accent { color: var(--orange); }
.header-nav a { color: var(--navy); font-weight: 600; }

/* Hero banner (homepage) */
.hero-banner { background: var(--navy); color: #fff; padding: 56px 20px; text-align: center; border-top: 3px solid var(--orange); border-bottom: 3px solid var(--orange); }
.hero-banner h1 { font-size: 2.4rem; line-height: 1.2; color: #fff; }
.hero-banner p { margin: 14px auto 0; max-width: 560px; color: rgba(255,255,255,0.82); font-size: 1.05rem; }

.page-wrap { max-width: 1180px; margin: 0 auto; padding: 40px 20px 60px; }

.section-title { text-align: center; font-size: 1.8rem; color: var(--navy); margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 32px; }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 380px)); justify-content: center; gap: 24px; }
.category-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.category-card-head { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.category-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.category-icon img { width: 100%; height: 100%; object-fit: cover; }
.category-icon i { color: var(--navy); font-size: 18px; }
.category-card-head h2 { font-size: 1.05rem; color: var(--navy); }
.subcategory-list { display: flex; flex-direction: column; }
.subcategory-row { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--text); }
.subcategory-row:last-child { border-bottom: none; }
.subcategory-row:hover { background: var(--bg); color: var(--orange); }
.subcategory-row i.fa-ranking-star { color: var(--orange); font-size: 13px; }
.subcategory-chevron { margin-left: auto; color: var(--muted); font-size: 12px; }
.subcategory-empty { padding: 14px 20px; color: var(--muted); font-size: 0.9rem; font-style: italic; }

/* Classifica page */
.classifica-header { background: var(--navy); color: #fff; padding: 44px 20px; text-align: center; border-top: 3px solid var(--orange); border-bottom: 3px solid var(--orange); }
.classifica-header .eyebrow { color: var(--orange); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.85rem; }
.classifica-header h1 { font-size: 2.2rem; color: #fff; margin-top: 6px; }
.classifica-header .subtitle { color: rgba(255,255,255,0.85); margin-top: 8px; font-size: 1.05rem; }
.classifica-header .updated { color: rgba(255,255,255,0.6); margin-top: 6px; font-size: 0.85rem; }

.disclaimer-box { display: flex; gap: 10px; align-items: flex-start; background: #fff7ec; border: 1px solid #f2d9b8; color: #8a5a12; border-radius: 12px; padding: 14px 18px; font-size: 0.88rem; margin: 24px auto; max-width: 780px; }
.disclaimer-box i { margin-top: 2px; }

.product-list { display: flex; flex-direction: column; gap: 20px; max-width: 900px; margin: 0 auto; }
.product-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.product-rank-tag { background: #eef1f6; color: var(--navy); font-weight: 700; font-size: 0.8rem; padding: 8px 20px; display: flex; align-items: center; gap: 6px; }
.product-card.is-winner .product-rank-tag { background: var(--orange); color: #fff; }
.product-card-body { display: grid; grid-template-columns: 140px 1fr 180px; gap: 20px; padding: 20px; align-items: center; }
.product-image-wrap { width: 140px; height: 140px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 12px; overflow: hidden; }
.product-image-wrap img { width: 100%; height: 100%; object-fit: contain; }
.product-brand { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.product-tier { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #eef1f6; color: var(--navy); }
.product-tier.tier-alta { background: #1f2430; color: #fff; }
.product-tier.tier-media-alta { background: #3b4252; color: #fff; }
.product-tier.tier-economica { background: #e7f4ea; color: #1f6b35; }
.product-title { font-size: 1.1rem; color: var(--navy); margin-top: 4px; }
.discount-badge { display: inline-block; margin-top: 10px; background: var(--red); color: #fff; font-weight: 700; font-size: 0.78rem; padding: 4px 10px; border-radius: 8px; }
.product-more { margin-top: 10px; font-size: 0.9rem; }
.product-more summary { cursor: pointer; color: var(--navy); font-weight: 600; list-style: none; }
.product-more summary::-webkit-details-marker { display: none; }
.product-more-body { margin-top: 8px; color: var(--text); line-height: 1.5; }
.price-badge { display: inline-block; margin-top: 10px; background: var(--orange); color: #fff; font-weight: 800; font-size: 0.95rem; padding: 6px 14px; border-radius: 999px; text-decoration: none; }
.price-badge:hover { background: var(--orange-dark); }
.product-cta { display: flex; justify-content: flex-end; }
.btn-amazon { background: var(--navy); color: #fff; font-weight: 700; padding: 12px 22px; border-radius: 999px; text-align: center; white-space: nowrap; }
.btn-amazon:hover { background: var(--navy-dark); }
.btn-amazon-primary { background: var(--orange); }
.btn-amazon-primary:hover { background: var(--orange-dark); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer-inner { max-width: 1180px; margin: 0 auto; padding: 24px 20px; color: var(--muted); font-size: 0.85rem; }
.footer-disclaimer { margin-top: 6px; }

/* Admin */
.admin-page { background: var(--bg); }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 30px 20px; }
.admin-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.admin-section-title { font-weight: 700; color: var(--navy); margin: 20px 0 10px; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.04em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 0.95rem; }
.textarea { min-height: 90px; resize: vertical; }
label { font-size: 0.82rem; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; background: #eef1f6; color: var(--navy); font-weight: 600; border: none; cursor: pointer; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.danger { background: #fdeaea; color: #b42318; }
.error { background: #fdeaea; color: #b42318; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
table.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
.quota-ok { color: #15803d; font-weight: 700; }
.quota-low { color: #b45309; font-weight: 700; }

/* Responsive */
@media (max-width: 900px) {
  .category-grid { grid-template-columns: 1fr; }
  .product-card-body { grid-template-columns: 100px 1fr; gap: 14px; }
  .product-image-wrap { width: 100px; height: 100px; }
  .product-copy { min-width: 0; }
  .product-cta { grid-column: 1 / -1; justify-content: stretch; }
  .btn-amazon { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Guida alla scelta sotto la classifica (16/10/2026) */
.guide-html { max-width: 900px; margin: 48px auto 0; line-height: 1.7; color: var(--text, #2b2b2b); }
.guide-html h2 { font-family: 'Lora', serif; font-size: 1.6rem; margin: 40px 0 14px; }
.guide-html h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.guide-html p { margin: 0 0 14px; }
.guide-html .table-wrap { overflow-x: auto; margin: 18px 0 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.guide-html table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
.guide-html th, .guide-html td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.guide-html th { background: var(--bg); font-weight: 700; }
.guide-html .note { font-size: .85rem; color: var(--muted); }
.guide-html details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
.guide-html summary { cursor: pointer; font-weight: 600; }
.product-more-body ul { margin: 6px 0 10px 18px; }
.product-more-body p { margin: 6px 0; }

.intro-html { max-width: 900px; margin: 0 auto 24px; line-height: 1.7; }
.intro-html a, .guide-html a, .product-more-body a { color: var(--orange-dark); text-decoration: underline; }
@media (max-width: 900px) {
  .product-card-body { align-items: start; }
  .product-more[open] .product-more-body { margin-left: -114px; margin-top: 8px; }
  .product-more-body ul { margin-left: 0; padding-left: 18px; }
}
