/* ============================================
   EMMEGIBI SRL – Stylesheet
   ============================================ */

:root {
  --primary: #4f93c4;
  --primary-dark: #1e9bd8;
  --body-color: #777a7e;
  --footer-bg: #1e9bd8;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--body-color);
  background: #fff;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  color: #333;
}

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

img { max-width: 100%; height: auto; display: block; }

p { margin: 0 0 6px; }

/* ---- Navbar ---- */
.navbar {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  height: 90px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar .nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar .logo img {
  height: 50px;
  width: auto;
}

.navbar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
}

.navbar nav ul li a {
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
  color: #333;
  padding: 0 12px;
  line-height: 90px;
  display: block;
  transition: color .25s;
}

.navbar nav ul li a:hover,
.navbar nav ul li a.active {
  color: var(--primary);
}

/* Burger mobile */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.burger span {
  display: block;
  width: 26px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: .3s;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  padding: 12px 0;
}
.mobile-menu a {
  padding: 10px 24px;
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
  color: #333;
  display: block;
  border-bottom: 1px solid #f0f0f0;
}
.mobile-menu a:hover { color: var(--primary); }
.mobile-menu.open {
  display: flex;
  position: fixed;
  top: 90px;
  left: 0;
  right: 0;
  z-index: 999;
}

/* ---- Section base ---- */
.section {
  padding: 36px 0 75px;
}
.section-sm { padding: 40px 0; }

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Badge titolo ---- */
.badge-title {
  display: inline-block;
  background: var(--primary-dark);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 14px;
  margin-bottom: 28px;
}

.badge-title.center {
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Service image cards (homepage) ---- */
.service-grid {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}

.service-card {
  flex: 1;
  min-width: 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.service-card a { display: block; }

.service-card img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  transition: transform .45s ease, filter .45s ease;
}

.service-card:hover img {
  transform: scale(1.06);
  filter: brightness(.82);
}

.service-card .card-label {
  position: absolute;
  bottom: 20px;
  left: 14px;
  z-index: 10;
  font-family: 'Righteous', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 1.6rem;
  color: #fff;
  -webkit-text-stroke: 2px #000;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  transition: color .3s, -webkit-text-stroke .3s;
  pointer-events: none;
}

/* ---- Chi siamo sezione (homepage) ---- */
.chisiamo-row {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 40px 0;
}

.chisiamo-row .text-col { flex: 1; }
.chisiamo-row .img-col { flex: 0 0 45%; }

.chisiamo-row .img-col img {
  border-radius: 20px;
  width: 100%;
  object-fit: cover;
}

/* ---- Servizi page ---- */
.serv-title-mobile {
  display: none;
  background: var(--primary-dark);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 14px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.servizio-row {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 48px;
  padding: 50px 0;
  border-bottom: 1px solid #f0f0f0;
}

.servizio-row:last-child { border-bottom: none; }

.servizio-row.reverse { flex-direction: row; }

.servizio-row .serv-img {
  flex: 0 0 41.66%;
}

.servizio-row .serv-img img {
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  aspect-ratio: 15/16;
}


/* ---- Carousel ---- */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

.carousel-track {
  display: flex;
  transition: transform .4s ease;
}

.carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  border-radius: 0;
  aspect-ratio: 15/16;
  object-fit: cover;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .2s;
}

.carousel-btn:hover { background: rgba(255,255,255,.92); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.servizio-row .serv-text { flex: 7; text-align: center; }

.serv-text h2 {
  display: inline-block;
  background: var(--primary-dark);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 14px;
  margin: 0 0 14px;
}

.serv-text p {
  font-size: 18px;
  text-align: justify;
  margin-bottom: 8px;
}

/* ---- Chi Siamo page ---- */
.chisiamo-page-text {
  font-size: 18px;
  text-align: justify;
  margin-bottom: 12px;
}

.chisiamo-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  list-style: none;
  padding: 0;
  margin: 18px 0 30px;
}

.chisiamo-list li {
  font-size: 18px;
  color: #555;
  padding-left: 18px;
  position: relative;
}

.chisiamo-list li::before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: 0;
  font-weight: 700;
}

.chisiamo-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 48px;
}

.chisiamo-photos img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
}

/* ---- Macchine page ---- */
.mach-title-mobile { display: none; }
.machine-row {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  padding: 50px 0;
  border-bottom: 1px solid #f0f0f0;
}

.machine-row:last-child { border-bottom: none; }
.machine-row { flex-direction: row-reverse; }
.machine-row.reverse { flex-direction: row; }

.machine-row .mach-img {
  flex: 0 0 41.66%;
  cursor: pointer;
}

.machine-row .mach-img img,
.machine-row .mach-img video {
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  aspect-ratio: 15/16;
  pointer-events: none;
}

.machine-row .carousel-track img {
  aspect-ratio: 15/16;
  height: auto;
  border-radius: 0;
  pointer-events: none;
}

.machine-row .mach-text { flex: 7; }

.mach-text h2 {
  display: inline-block;
  background: var(--primary-dark);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 14px;
  margin: 0 0 14px;
}

.mach-text ul {
  list-style: none;
  padding: 0;
  margin: 0;
}


.mach-text ul li {
  font-size: 18px;
  color: var(--body-color);
  padding: 4px 0 4px 20px;
  position: relative;
}

.mach-text ul li::before {
  content: "›";
  color: var(--primary);
  position: absolute;
  left: 4px;
  font-weight: 700;
  font-size: 18px;
}

.mach-text p {
  font-size: 18px;
  text-align: justify;
}

/* ---- Contatti page ---- */
.contact-section {
  display: flex;
  min-height: 500px;
}

.contact-map {
  flex: 1 1 55%;
  overflow: hidden;
}
.contact-map .leaflet-control-attribution { display: none; }

.contact-map iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
  display: block;
}

.contact-panel {
  flex: 0 0 45%;
  background: linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.72)),
              url('../images/bg-contatti.jpg') center/cover no-repeat;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}

.contact-panel-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #999;
  margin: 0;
}

.contact-panel-address {
  font-size: 18px;
  color: #444;
  line-height: 1.6;
  margin: 0 0 8px;
}

.contact-panel-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  color: #444;
}

.contact-panel-item a { color: #444; }
.contact-panel-item a:hover { color: var(--primary); }

.cp-ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  color: #fff;
}

/* ---- Footer ---- */
footer {
  background: var(--footer-bg);
  color: rgba(255,255,255,.75);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

footer h3 {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 18px;
  letter-spacing: .5px;
}

footer p, footer a {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  line-height: 1.8;
}

footer a:hover { color: var(--primary); }

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.footer-contact-item i {
  color: var(--primary);
  width: 18px;
  flex-shrink: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 22px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.4);
}

.footer-privacy a {
  display: inline-block;
  background: #fff;
  color: #333;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  margin: 4px 6px 0 0;
  text-decoration: none;
}
.footer-privacy a:hover { background: #f0f0f0; color: #000; }

.footer-insta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 14px;
  padding: 6px 14px 6px 10px;
  border-radius: 100px;
  text-decoration: none;
  transition: background .25s;
}
.footer-insta-link:hover { background: rgba(255,255,255,.28); color: #fff; }

/* ---- Page header (banner interno) ---- */
.page-header {
  background: linear-gradient(135deg, #1a2030 0%, #2a3a54 100%);
  padding: 60px 0 50px;
  text-align: center;
}

.page-header h1 {
  color: #fff;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.page-header p {
  color: rgba(255,255,255,.65);
  font-size: 18px;
}

/* ---- Lightbox mobile servizi ---- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: #1e9bd8;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: none;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,.32); }

.lightbox-inner {
  width: 100%;
  max-width: 680px;
  position: relative;
}

.lightbox-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.lightbox-track {
  display: flex;
  transition: transform .4s ease;
}

.lightbox-track img {
  flex: 0 0 100%;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}

.lightbox-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.lightbox-btn:hover { background: rgba(255,255,255,.42); }

.lightbox-counter {
  color: rgba(255,255,255,.75);
  font-size: 15px;
  z-index: 2001;
}

.mobile-only { display: none; }

/* ---- AOS override ---- */
[data-aos] { will-change: transform, opacity; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .service-grid { flex-wrap: wrap; }
  .service-card { flex: 0 0 calc(33% - 8px); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar nav { display: none; }
  .burger { display: flex; }

  .contact-section { flex-direction: column; min-height: unset; }
  .contact-panel { order: 1; flex: none; padding: 32px 20px; }
  .contact-map { order: 2; flex: none; height: 300px; }

  .mobile-only { display: block; }

  /* ---- Font ridotti su mobile (-4px rispetto desktop) ---- */
  body { font-size: 14px; }
  .service-card .card-label { font-size: 1.35rem; }
  .serv-title-mobile { font-size: 1.15rem; }
  .serv-text h2 { font-size: 1.15rem; }
  .serv-text p { font-size: 14px; }
  .chisiamo-page-text { font-size: 14px; }
  .chisiamo-list li { font-size: 14px; }
  .mach-text h2 { font-size: 1.15rem; }
  .mach-text ul li { font-size: 14px; }
  .mach-text ul li::before { font-size: 14px; }
  .mach-text p { font-size: 14px; }
  .serv-text p { text-align: left; }
  .contact-panel-label { font-size: 11px; }
  .contact-panel-address { font-size: 14px; }
  .contact-panel-item { font-size: 14px; }
  .cp-ico { font-size: 14px; }
  .page-header h1 { font-size: 2.15rem; }
  .page-header p { font-size: 14px; }

  .service-card { flex: 0 0 calc(50% - 6px); }
  .service-card img { height: 240px; }
  .card-label { font-size: 1.138rem !important; }
  .service-card .card-label { -webkit-text-stroke: 0.7px #333; }

  .chisiamo-row { flex-direction: column; }
  .chisiamo-row .img-col { flex: none; width: 100%; }

  /* Mobile servizi: float layout */
  .servizio-row,
  .servizio-row.reverse {
    display: block;
    overflow: hidden;
  }

  /* Titolo mobile (prima del float) */
  .serv-title-mobile {
    display: block;
    margin-bottom: 10px;
  }

  /* Nascondi h2 dentro serv-text su mobile */
  .servizio-row .serv-text h2 {
    display: none;
  }

  .servizio-row .serv-img {
    flex: none;
    width: 44%;
    float: right;
    margin: 0 0 12px 14px;
    cursor: pointer;
    position: relative;
  }

  .servizio-row.reverse .serv-img {
    float: right;
    margin: 0 0 12px 14px;
  }

  /* Lens overlay */
  .servizio-row .serv-img::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background-color: rgba(255,255,255,.18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 36px;
    pointer-events: none;
  }

  /* Nascondi i bottoni carousel nella thumbnail */
  .servizio-row .carousel-btn { display: none; }

  .machine-row, .machine-row.reverse {
    display: block;
    overflow: hidden;
    padding: 24px 0;
  }

  .mach-title-mobile {
    display: block;
    background: var(--primary-dark);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 14px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    margin-bottom: 10px;
  }

  .machine-row .mach-img {
    flex: none;
    width: 44%;
    float: right;
    margin: 0 0 12px 14px;
    position: relative;
    z-index: 1;
    cursor: pointer;
  }

  .machine-row.reverse .mach-img {
    float: right;
    margin: 0 0 12px 14px;
  }

  /* Lens overlay */
  .machine-row .mach-img::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background-color: rgba(255,255,255,.18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 36px;
    pointer-events: none;
  }

  /* Nascondi bottoni carousel e h2 nome macchina su mobile */
  .machine-row .carousel-btn { display: none; }
  .mach-text > h2:first-child { display: none; }

  /* Bullet con hanging indent — funziona con strong inline e con float */
  .mach-text ul li {
    display: block;
    padding-left: 0.5em;
    text-indent: -0.5em;
    text-align: left;
  }
  .mach-text ul li::before {
    position: static;
    display: inline;
    margin-right: 3px;
  }

  /* Titolo secondario (es. Attrezzature) centrato e piena larghezza */
  .mach-text h2:not(:first-child) {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    margin-top: 20px;
  }

  .contact-wrapper { flex-direction: column; }
  .contact-wrapper .info-col { flex: none; width: 100%; }

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

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

  .section { padding: 24px 0; }

  .servizio-row { padding: 24px 0; }

  .badge-title { font-size: 1.55rem; padding: 10px 20px; }
}

@media (max-width: 480px) {
  .service-card { flex: 0 0 calc(50% - 6px); }
  .footer-grid { grid-template-columns: 1fr; }
  .chisiamo-photos { grid-template-columns: 1fr 1fr; }
  .chisiamo-list { grid-template-columns: 1fr; }
}
