:root{
  --primary:#cc0033;
  --dark:#222;
  --light:#fff;
  --gray:#f5f5f5;
  --card:#ffffff;
  --shadow:0 10px 30px rgba(0,0,0,.08);
  --shadow-hover:0 16px 44px rgba(0,0,0,.12);
}

/* Internal pages only (index remains unchanged) */
body.internal{
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(204,0,51,.08), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(204,0,51,.06), transparent 55%),
    var(--light);
}

/* Banner hero for internal pages */
body.internal .hero{
  padding: 0;
  background: none;
}

body.internal .hero img{
  width: 100%;
  height: clamp(120px, 18vw, 170px);
  object-fit: cover;
  object-position: left center;
  display: block;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

/* Slightly tighter sections on internal pages */
body.internal .section{
  padding: 3.5rem 2rem;
}

/* Modern content wrapper */
.panel{
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
  backdrop-filter: blur(6px);
}

.panel.accent{
  border-left: 6px solid var(--primary);
}

/* Subtle entrance animation */
@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

.fade-up{
  animation: fadeUp .45s ease-out both;
}

/* Cards / grids */
.grid{
  display: grid;
  gap: 18px;
}

.grid.cols-3{ grid-template-columns: repeat(3, 1fr); }
.grid.cols-2{ grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px){
  .grid.cols-3{ grid-template-columns: 1fr; }
  .grid.cols-2{ grid-template-columns: 1fr; }
}

.card{
  background: var(--card);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card .title{
  display:block;
  font-weight: 800;
  margin-top: 6px;
}

.muted{ opacity: .9; }

/* Contact grid */
.contact-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 18px;
}

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

.contact-item{
  text-align: center;
  padding: 18px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(245,245,245,.55);
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.contact-item::before{
  content: "";
  position:absolute;
  top:0;
  left:0;
  width: 6px;
  height: 100%;
  background: var(--primary);
}

.contact-item:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.9);
  box-shadow: 0 14px 34px rgba(0,0,0,.12);
}

.contact-item img{
  width: 34px;
  height: 34px;
  object-fit: contain;
  margin: 6px auto 10px;
}

.contact-item strong{ display:block; font-size: 16px; }
.contact-item p{ margin: 0; }

.contact-item a{
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.contact-item a:hover{ text-decoration: underline; }

/* Location page */
.locations{
  margin-top: 18px;
}

.location-card iframe{
  width: 100%;
  height: 320px;
  border: 0;
  border-radius: 14px;
}

.hours{
  line-height: 1.7;
}

/* Booking page */
.store-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

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

.store-card{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 150px;
}

.store-card img{
  max-width: min(170px, 80%);
  height: auto;
  display:block;
}

.web-book{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}

.web-book:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0,0,0,.12);
}

/* Logos grid */
.logo-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 900px){
  .logo-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px){
  .logo-grid{ grid-template-columns: 1fr; }
}

.logo-tile{
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 26px rgba(0,0,0,.07);
  transition: transform .2s ease, box-shadow .2s ease;
}

.logo-tile:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.logo-tile img{
  max-width: 200px;
  max-height: 110px;
  width: auto;
  height: auto;
}


/* --- Tweaks requested (Jan 2026) --- */
body.internal .hero{
  position: relative;
}
body.internal .hero::after{
  content:"";
  display:block;
  height: 14px; /* slightly more compact */
  background: var(--primary);
}

/* Reduce excess whitespace at the bottom of internal pages */
body.internal main:last-of-type,
body.internal .section:last-of-type{
  padding-bottom: 2.2rem;
}

/* Page specific overrides */
body.page-contatti .contact-item::before{
  display:none;
}

.app-icon{
  display:flex;
  justify-content:center;
  margin: 10px 0 18px;
}
.app-icon img{
  border-radius: 22px;
  box-shadow: var(--shadow);
}

/* Dove-siamo layout */
.where-layout{ display:flex; flex-direction:column; gap: 18px; }
.where-top{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: stretch;
}
.where-right{
  display:flex;
  flex-direction:column;
  gap: 18px;
}
.where-maps{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.map-card iframe{
  width:100%;
  height: 280px;
  border:0;
  border-radius: 14px;
}
@media (max-width: 900px){
  .where-top{ grid-template-columns: 1fr; }
  .where-maps{ grid-template-columns: 1fr; }
}


/* Dove-siamo fine tuning */
.where-top{
  align-items: stretch;
}

.where-top .panel{
  height: 100%;
}

.where-maps{
  margin-top: 10px;
}

.where-maps .map-card iframe{
  height: 300px;
}


/* --- Dove-siamo layout (refined) --- */
.where-layout{ display:flex; flex-direction:column; gap: 16px; }

.card.where-top{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: start;
  padding: 18px 18px;
}

.card.where-top .where-left{ padding-right: 6px; }

.card.where-top .where-right{
  border-left: 1px solid rgba(0,0,0,.08);
  padding-left: 18px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.card.where-top .where-box{
  padding: 0;
}

.card.where-top .where-box + .where-box{
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.where-maps{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.map-card iframe{
  width:100%;
  height: 280px;
  border:0;
  border-radius: 14px;
}

@media (max-width: 900px){
  .card.where-top{ grid-template-columns: 1fr; }
  .card.where-top .where-right{
    border-left: 0;
    padding-left: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(0,0,0,.08);
  }
  .where-maps{ grid-template-columns: 1fr; }
}

/* Prenota layout */
.prenota-layout{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.prenota-left,
.prenota-right{
  background: rgba(255,255,255,.9);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.prenota-left h3,
.prenota-right h3{
  margin-top:0;
}

.app-preview{
  display:flex;
  justify-content:center;
  margin: 16px 0 20px;
}

.app-preview img{
  width: 90px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.prenota-right{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
}

@media (max-width: 900px){
  .prenota-layout{
    grid-template-columns: 1fr;
  }
}


/* Center content in left Prenota card */
body.page-prenota .prenota-left{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

body.page-prenota .prenota-top{
  justify-content:center;
}

body.page-prenota .store-grid-2{
  justify-items:center;
}


/* --- Prenota fine-tuning --- */
body.page-prenota .prenota-left{
  padding-top: 22px;
  padding-bottom: 22px;
}

/* More breathing room between top icon and store cards */
body.page-prenota .prenota-top{
  margin-bottom: 22px;
}

body.page-prenota .store-grid-2{
  margin-top: 6px;
  gap: 18px;
}

/* Make left and right cards feel more symmetric */
body.page-prenota .prenota-left,
body.page-prenota .prenota-right{
  min-height: 420px;
}

body.page-prenota .prenota-right{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

body.page-prenota .prenota-right .prenotime-card{
  width: 100%;
  max-width: 320px;
}

/* Keep store cards aligned and consistent */
body.page-prenota .store-grid-2 .store-card{
  width: 100%;
  max-width: 320px;
}


/* Center Play Store & App Store icons */
body.page-prenota .store-grid-2{
  justify-items: center;
}

body.page-prenota .store-grid-2 .store-card{
  display:flex;
  align-items:center;
  justify-content:center;
}


/* --- Store cards final polish --- */
body.page-prenota .store-grid-2 .store-card{
  min-height: 130px; /* slightly tighter */
  transition: transform .2s ease, box-shadow .2s ease;
}

body.page-prenota .store-grid-2 .store-card:hover{
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 40px rgba(0,0,0,.14);
}


/* --- HARD center Play Store & App Store --- */
body.page-prenota .store-grid-2{
  display:grid;
  place-items:center;
}

body.page-prenota .store-grid-2 .store-card{
  width:100%;
  max-width:320px;
  display:flex;
  align-items:center;
  justify-content:center;
}

body.page-prenota .store-grid-2 .store-card img{
  display:block;
  margin:0 auto;
}


/* --- FINAL centering fix for store icons --- */
body.page-prenota .store-grid.store-grid-2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  justify-content: center;   /* centers the whole grid */
  justify-items: center;     /* centers items inside cells */
}

body.page-prenota .store-grid.store-grid-2 .store-card{
  margin: 0 auto;
}


/* --- Dove-siamo equal height alignment --- */
body.page-dove .card.where-top{
  align-items: stretch;
}

body.page-dove .card.where-top .where-left,
body.page-dove .card.where-top .where-right{
  height: 100%;
}

body.page-dove .card.where-top .where-left{
  display:flex;
  flex-direction:column;
}

body.page-dove .card.where-top .where-right{
  display:flex;
  flex-direction:column;
}

/* Push the second address box to the bottom so left/right columns end at same height */
body.page-dove .card.where-top .where-right .where-box:last-child{
  margin-top: auto;
}


/* --- Servizi: TecnoAti + loghi rivenditori --- */
.tecnoati-bar{
  width: 100%;
  background: rgba(245,245,245,.75);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 18px;
  padding: 22px 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 10px 0 22px;
}
.tecnoati-bar img{
  max-height: 96px;
  width: auto;
  height: auto;
}

.riv-logos{
  width:100%;
  display:grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 16px 14px;
  align-items: center;
  justify-items: center;
}
.riv-logos img{
  width: 100%;
  max-width: 140px; /* keeps them small */
  height: auto;
  max-height: 48px;
  object-fit: contain;
  display:block;
}

@media (max-width: 1100px){
  .riv-logos{ grid-template-columns: repeat(5, minmax(0,1fr)); }
}
@media (max-width: 800px){
  .riv-logos{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .riv-logos img{ max-width: 160px; }
}


/* --- Menu active page underline --- */
.nav a{
  position: relative;
}

.nav a.active::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 3px;
  background: var(--accent, #c4002f);
  border-radius: 2px;
}


/* --- Contact cards clickable --- */
.card-link{
  text-decoration: none;
  color: inherit;
  display: block;
}


/* --- Contatti: card cliccabile (Email/WhatsApp) --- */
.contact-link{
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.contact-link:hover{
  transform: translateY(-2px);
}

.contact-link:focus-visible{
  outline: 3px solid rgba(196,0,47,.35);
  outline-offset: 4px;
  border-radius: 14px;
}



/* --- Mobile fixes: banner readable + no double red stripe --- */
@media (max-width: 520px){
  /* Make banners taller on mobile so text is readable */
  body.internal .hero img{
    height: 200px;
    object-fit: cover;
    object-position: left center;
  }
  /* Remove extra CSS red strip under banner (SVG already has its own) */
  body.internal .hero::after{
    display:none !important;
    height:0 !important;
  }
}


/* Make images inside panels responsive */
body.internal .panel img{
  max-width: 100%;
  height: auto;
}

@media (max-width: 520px){
  body.internal .panel img{ max-height: 110px; }
}
