/* ===== Reset & base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #333;
  line-height: 1.5;
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Variables ===== */
:root {
  --color-teal: #2a7e8a;
  --color-teal-dark: #247078;
  --color-yellow: #ebb63c;
  --color-yellow-hero: #f2be3b;
  --color-dark: #333;
  --color-darker: #222;
  --color-text: #333;
  --color-text-muted: #666;
  --color-border: #e0e0e0;
  --max-width: 1200px;
  --sidebar-width: 200px;
  --header-height: 120px;
}

/* ===== Image placeholders ===== */
.image-placeholder {
  background: #ccc;
  background-image: linear-gradient(135deg, #b0b0b0 25%, transparent 25%),
    linear-gradient(225deg, #b0b0b0 25%, transparent 25%),
    linear-gradient(45deg, #b0b0b0 25%, transparent 25%),
    linear-gradient(315deg, #b0b0b0 25%, #d0d0d0 25%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.logo-placeholder {
  min-width: 40px;
  min-height: 24px;
}

.logo-main.image-placeholder {
  min-width: 120px;
  min-height: 36px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--color-teal);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-teal-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--color-teal);
  border: 2px solid #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.btn-primary-header {
  background: var(--color-teal);
  color: #fff;
  padding: 10px 20px;
  font-size: 0.8rem;
}

.btn-block {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 1rem;
}

/* ===== Desktop: Site header (≥1024px) ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 0 var(--color-border);
}

.top-bar {
  background: var(--color-dark);
  height: 36px;
}

.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
}

.main-header {
  padding: 12px 0 0;
}

.header-inner {

  margin: 0 auto;
  padding: 0 24px 12px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.nav-item {
  font-size: 0.75rem;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.nav-icon {
  font-size: 1rem;
}

.main-nav {
  border-top: 1px solid var(--color-border);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  gap: 24px;
}

.main-nav-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.main-nav-link.active {
  color: var(--color-teal);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Mobile header: hidden on desktop */
.mobile-header {
  display: none;
}

/* ===== Layout wrapper (sidebar + main) ===== */
.layout-wrapper {

  margin: 0 auto;
  display: flex;

}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;


  max-width: 100px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--color-text);
  border-radius: 4px;
}

.sidebar-link:hover {
  background: #f5f5f5;
}

.sidebar-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ===== Main content ===== */
.main-content {
  flex: 1;
  min-width: 0;

}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 0;
  min-height: 380px;
  margin-bottom: 48px;
  overflow: hidden;
  border-radius: 8px;
}

.hero-text {
  background: var(--color-yellow);
  padding: 0px 42px 32px 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-dark);
}

.hero-subtitle {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-dark);
  letter-spacing: 0.05em;
}

.hero-desc {
  margin: 0 0 24px;
  font-size: 0.95rem;
  color: var(--color-dark);
  max-width: 480px;
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  min-height: 380px;
  aspect-ratio: 4/3;
}

.hero-cta-mobile {
  display: none;
}

.hero-disclaimer {
  margin: 12px 0 0;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  display: none;
}

/* ===== Sections ===== */
.section {
  margin-bottom: 56px;
}

.section-inner {
  max-width: 100%;
}

.two-cols {
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 40px;
  align-items: center;
}

.section-title {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-dark);
}

.section-subtitle {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-dark);
}

.section-body {
  margin: 0 0 24px;
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
}

.section-images {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.prestito-img-1 {
  aspect-ratio: 4/3;
  grid-column: span 2;
  grid-row: span 1;
}

.prestito-img-2,
.prestito-img-3 {
  aspect-ratio: 1;
}

.section-image-wrap .care-placeholder {
  aspect-ratio: 4/3;
  width: 100%;
}

/* ===== CTA bar ===== */
.cta-bar {
  background: var(--color-teal);
  padding: 28px 24px;
  margin-bottom: 56px;
}

.cta-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cta-bar-text {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  flex: 1;
}

/* ===== Lo sapevi che ===== */
.section-heading {
  margin: 0 0 28px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark);
}

.section-subheading {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.cards-three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.card-img {
  aspect-ratio: 16/10;
  width: 100%;
}

.card-title {
  margin: 16px 16px 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
}

.card-desc {
  margin: 0 16px 16px;
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
}

.card-link {
  display: inline-block;
  margin: 0 16px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-teal);
  letter-spacing: 0.02em;
}

/* ===== Help cards ===== */
.help-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.help-card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 24px;
}

.help-icon {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.help-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-dark);
}

.help-desc {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--color-text);
}

.help-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-teal);
}

.help-card-mobile {
  display: none;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-dark);
  color: #ccc;
  padding: 40px 24px 24px;
  margin-top: 48px;
}

.footer-top {
  max-width: var(--max-width);
  margin: 0 auto 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-social {
  display: flex;
  gap: 16px;
}

.social-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #444;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
}

.footer-legal {
  display: flex;
  gap: 20px;
  font-size: 0.75rem;
}

.footer-legal a {
  color: #aaa;
}

.footer-columns {
  max-width: var(--max-width);
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-title {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
}

.footer-col a {
  font-size: 0.8rem;
  color: #aaa;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid #444;
}

.copyright {
  margin: 0;
  font-size: 0.75rem;
  color: #888;
}

/* ===== Mobile-only section (hidden on desktop) ===== */
.section-mobile-only {
  display: none;
}

.pagination-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
}

.dot.active {
  background: var(--color-teal);
}

.cards-two {
  display: none;
}

/* =============================================
   MEDIA: Tablet (769px – 1023px): like desktop
   ============================================= */
@media (max-width: 1023px) {
  .layout-wrapper {
    max-width: 100%;
  }

  .sidebar {
    width: 160px;
    padding-right: 20px;
  }

  .main-content {
    padding-left: 20px;
  }

  .hero {
    grid-template-columns: 55% 45%;
  }

  .two-cols {
    grid-template-columns: 1fr 1fr;
  }

  .footer-columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================
   MEDIA: Mobile (≤768px)
   ============================================= */
@media (max-width: 768px) {
  .site-header {
    display: none;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
  }

  .mobile-header .logo-placeholder {
    min-width: 100px;
    min-height: 28px;
  }

  .mobile-header-actions {
    display: flex;
    gap: 12px;
  }

  .icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
  }

  .layout-wrapper {
    flex-direction: column;
    padding: 0 16px 24px;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding-left: 0;
  }

  /* Hero: stacked — image on top, then yellow block */
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: auto;
    margin-bottom: 24px;
  }

  .hero .hero-image {
    order: 0;
    min-height: 220px;
    aspect-ratio: 16/9;
  }

  .hero .hero-text {
    order: 1;
    padding: 24px 20px;
  }

  .hero-cta-desktop {
    display: none;
  }

  .hero-cta-mobile {
    display: inline;
  }

  .hero-disclaimer {
    display: block;
  }

  .hero-title {
    font-size: 1.35rem;
  }

  .hero-subtitle {
    font-size: 0.8rem;
  }

  .hero-desc {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .hero-placeholder {
    min-height: 220px;
  }

  /* Hide Prestito section on mobile (or keep and stack) — keep and stack */
  .section-prestito .two-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .section-prestito .section-images {
    grid-template-columns: 1fr;
  }

  .prestito-img-1 {
    grid-column: span 1;
    aspect-ratio: 16/9;
  }

  .prestito-img-2,
  .prestito-img-3 {
    aspect-ratio: 16/9;
  }

  /* CTA bar: stacked on mobile */
  .cta-bar-inner {
    flex-direction: column;
    text-align: center;
  }

  .cta-bar-text {
    font-size: 1.1rem;
  }

  .cta-bar {
    padding: 24px 16px;
    margin-bottom: 32px;
  }

  /* My Care: stacked */
  .section-care .two-cols {
    grid-template-columns: 1fr;
  }

  .section-care .care-placeholder {
    aspect-ratio: 16/9;
  }

  /* Lo sapevi: show 2 cards on mobile, hide third with CSS or show all stacked */
  .cards-three {
    grid-template-columns: 1fr;
  }

  .section-sapevi {
    margin-bottom: 32px;
  }

  /* Promozioni: show on mobile */
  .section-mobile-only {
    display: block;
    margin-bottom: 32px;
  }

  .section-promo .section-heading {
    font-size: 1.25rem;
  }

  .section-promo .cards-two {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
  }

  .section-promo .card-img {
    aspect-ratio: 16/10;
  }

  /* Help cards: 3 in a column */
  .help-cards {
    grid-template-columns: 1fr;
  }

  .help-card-mobile {
    display: block;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-col-title {
    margin-top: 8px;
  }

  /* Section spacing */
  .section {
    margin-bottom: 32px;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .section-heading {
    font-size: 1.25rem;
    margin-bottom: 20px;
  }
}

/* =============================================
   MEDIA: Desktop (≥1024px) — ensure desktop layout
   ============================================= */
@media (min-width: 1024px) {
  .site-header {
    display: block;
  }

  .mobile-header {
    display: none;
  }

  .section-mobile-only {
    display: none;
  }

  .cards-two {
    display: none;
  }

  .help-card-mobile {
    display: none;
  }
}
