@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
  margin:0;
  font-family: 'Inter', sans-serif;
  background: #fff5f0;
  color: #333;
}
/* Sticky container header + controls */
.header-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #ff5722, #ff8a50);
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  transition: box-shadow 0.3s ease;
}

.header-container.scrolled {
  box-shadow: 0 8px 20px rgba(0,0,0,0.25); /* syvempi shadow skrollatessa */
}

/* --- Moderni ja isompi header --- */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 55px 20px 45px 20px; /* enemmän tilaa ylös ja alas */
  background: transparent;
  color: white;
  text-align: center;
}

header .logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

header img {
  width: 110px;   /* aiempi 64px → nyt isompi */
  height: 110px;
  border-radius: 22px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

header img:hover {
  transform: rotate(-8deg) scale(1.07);
  filter: brightness(1.1);
}

header h1 {
  font-size: 3rem;   /* aiempi 2.4rem → enemmän “hero”-fiilistä */
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

header p {
  font-size: 1.25rem;
  font-weight: 500;
  opacity: 0.95;
  margin: 6px 0 0 0;
}



/* Controls modernimpi ja “nouseva” efekti */
#controls {
  background: #fff5f0;
  padding: 10px 20px 15px 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  transition: box-shadow 0.3s ease;
}

#controls.scrolled {
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
/* Modernit toggle-checkboxit */
.checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  position: relative;
  padding-left: 50px; /* tilaa custom togglelle */
  user-select: none;
  font-size: 1rem;
  color: #333;
}

/* Piilotetaan alkuperäinen checkbox */
.checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Pill-sliderin tausta */
.checkbox .slider {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 22px;
  background-color: #ccc;
  border-radius: 12px;
  transition: background 0.3s;
}

/* Sliderin nappi */
.checkbox .slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Kun checkbox valittu */
.checkbox input:checked + .slider {
  background-color: #ff5722;
}

.checkbox input:checked + .slider::before {
  transform: translateX(18px);
}


#map {
  height: 400px;
  margin: 0 20px 20px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#pizzeriaList {
  display: grid;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 20px 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}


@media(min-width: 600px) {
  #pizzeriaList {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(min-width: 900px) {
  #pizzeriaList {
    grid-template-columns: repeat(3, 1fr);
  }
}


.pizzeria {
  display: flex;
  align-items: flex-start;  /* content alkaa ylhäältä */
  justify-content: space-between;
  padding: 15px;            /* vähän enemmän tilaa */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  opacity: 0;
  transform: translateY(15px);
  transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.3s ease;
  position: relative;       /* tarvitaan .pizzeria-distance */
}

.pizzeria-main {
  flex: 1;
  margin-right: 10px;
  font-size: 0.95rem;  /* vähän pienempi fontti, että tekstit mahtuvat */
  line-height: 1.3;    /* tiheämpi riviväli */
}

.pizzeria.show {
  opacity: 1;
  transform: translateY(0);
}

.pizzeria:hover {
  background: #ffe0c2;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.pizzeria-distance {
  font-weight: 600;
  color: #ff5722;
  font-size: 0.8rem;        /* pienempi fontti */
  position: absolute;       /* absoluuttinen sijainti kortin sisällä */
  bottom: 8px;              /* vähän marginaalia alareunasta */
  right: 12px;              /* vähän marginaalia oikeasta reunasta */
  flex-shrink: 0;
}



.logo {
  width: 50px;
  height: 50px;
  margin-right: 12px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.pizzeria-main {
  flex:1;
  margin-right: 10px;
}
.pizzeria-main b {
  font-size: 1.1rem;
  font-weight: 600;
}

.icon-group {
  display: flex;
  gap: 10px;
  align-items: center;
}
/* Ikonien hover bounce */
.icon-btn {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.icon-btn:hover {
  transform: scale(1.3) translateY(-2px);
  filter: brightness(1.2);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  overflow:auto;
  background-color: rgba(0,0,0,0.6);
  transition: opacity 0.3s ease;
}
.modal-content {
  background-color: #fff;
  margin: 6% auto;       /* hieman ylemmäs */
  padding: 35px;
  border-radius: 15px;
  width: 95%;            /* leveämpi */
  max-width: 1100px;      /* isompi */
  position: relative;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s ease;
}

.close {
  position:absolute;
  top:8px;               /* ylemmäs */
  right:12px;
  font-size: 28px;
  font-weight:bold;
  color:#333;
  cursor:pointer;
  transition: color 0.2s;
}
.close:hover {color: #ff5722;}

.modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-header {
  display:flex;
  justify-content: space-between;
  align-items:center;
  margin-bottom:12px;
  font-weight: 600;
}
.modal-icons {
  display:flex;
  gap:10px;
}
.menu-item {
  margin:6px 0;
  border-bottom:1px dashed #ff5722;
  padding-bottom:5px;
  font-weight: 500;
}

#searchContainer {
  display: flex;
  justify-content: center;
  margin: 20px;
}

#searchInput {
  width: 90%;
  max-width: 500px;
  padding: 12px 16px;
  border-radius: 25px;
  border: 2px solid #ff5722;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

#searchInput:focus {
  border-color: #ff8a50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
header {
  position: relative;
}

.business-link {
  position: absolute;
  right: 25px;
  top: 25px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 10px 18px;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.2s ease;
}

.business-link:hover {
  background: #fff;
  color: #ff5722;
  transform: translateY(-2px);
}
.lang-switch {
  position: absolute;
  left: 20px;
  top: 20px;
  display: flex;
  gap: 10px;
  z-index: 2000;
}

.lang-flag {
  width: 34px;
  height: 24px;
  cursor: pointer;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lang-flag:hover {
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

/* --- Moderni modal menu --- */
#modalMenu {
  margin-top: 20px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.modal-category {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px dashed #ff8a50;
}

.modal-category h4 {
  margin: 0 0 8px;
  color: #ff5722;
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-menu-item {
  background: #fff7f2;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #ffd5c2;
  margin-bottom: 8px;
}

.modal-menu-title {
  font-weight: 700;
  color: #ff5722;
  font-size: 1.05rem;
}

.modal-menu-ingredients {
  color: #555;
  font-size: 0.85rem;
}

.modal-menu-price {
  margin-top: 4px;
  font-weight: 700;
  display: inline-block;
  color: #222;
}
.modal-menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-vegan-icon {
  width: 22px;
  height: 22px;
}

/* --- WhatsApp icon unified with other icons --- */

.whatsapp-fab {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* match phone & route icon shape */
    background: #25D366;
    border-radius: 50%;

    /* remove shadow completely (others don't use shadow!) */
    box-shadow: none;

    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

/* same hover feel as .icon-btn */
.whatsapp-fab:hover {
    transform: scale(1.3) translateY(-2px);
    filter: brightness(1.15);
}

.wa-icon {
    width: 16px;   /* visually same size as phone icon */
    height: 16px;
    fill: #fff;
    pointer-events: none;
}

/* Tablet: 2 saraketta */
@media (min-width: 600px) {
  #modalMenu {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3 saraketta */
@media (min-width: 1000px) {
  #modalMenu {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Kategorioille full-width, itemit gridissä */
.modal-category {
  grid-column: 1 / -1;
}

/* ---------------------------
   FOOTER
----------------------------*/

.footer {
    text-align: center;
    padding: 25px 15px;
    margin-top: 40px;
    background: #ff5722;
    color: white;
    font-weight: 600;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.footer a {
    color: #fff;
    text-decoration: underline;
    font-weight: 700;
}

.footer a:hover {
    text-decoration: none;
    color: #ffe6d5;
}

.footer p {
    margin: 6px 0;
}

.modal-title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;   /* ← TÄRKEIN */
}

.modal-subtitle {
    margin-top: 2px;
    font-size: 1rem;
    font-weight: 600;
    color: #444;
}


/* --- MOBIILISSA: KARTTA PIILOSSA --- */
@media (max-width: 700px) {
  #map {
    display: none;
    height: 300px; /* pienempi kartta */
    margin: 10px;
  }

  .map-toggle-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 15px auto;
    padding: 14px;
    font-size: 1.1rem;
    background: #ff5722;
    color: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    font-weight: 600;
    text-align: center;
  }

  .map-toggle-btn.active {
    background: #d84315;
  }
}

/* --- DESKTOPISSA: PAINIKETTA EI TARVITA --- */
@media (min-width: 701px) {
  .map-toggle-btn {
    display: none;
  }
}
/* Ikonit kahdelle riville mobiilissa */
@media (max-width: 600px) {
  .icon-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 90px;  /* 3 ikonia per rivi (3×28px + gapit) */
  }
}
/* Korjaa modal-menun leveysongelmat mobiilissa */
@media (max-width: 600px) {
  .modal-content {
    width: 96%;
    padding: 18px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  #modalMenu {
    grid-template-columns: 1fr; /* pakotetaan 1 sarake */
  }

  .modal-menu-item {
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;  /* estää sisällön venymisen */
  }

  .modal-menu-top {
    flex-wrap: wrap; /* jos otsikko + hinta ylittää leveyden */
  }
}
/* --- ÄLYKÄS IKONILAYOUT MOBIILISSA --- */
@media (max-width: 600px) {

  /* Muutetaan ikonikontti gridiksi */
  .icon-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 per rivi */
    gap: 8px;
    width: 100%;
    max-width: 120px;
  }

  /* Perusikonien skaalautuminen */
  .icon-group img,
  .icon-btn,
  .whatsapp-fab {
    width: 24px !important;
    height: 24px !important;
  }

  /* Jos ikoneita on paljon → pienennä entisestään */
  .icon-group:has(img:nth-child(5)) img,
  .icon-group:has(img:nth-child(5)) .icon-btn,
  .icon-group:has(img:nth-child(5)) .whatsapp-fab {
    width: 22px !important;
    height: 22px !important;
  }
}
/* --- TÄYDELLINEN MOBIILI-SÄÄTÖ MODAL MENULLE --- */
@media (max-width: 600px) {

  .modal-content {
    width: calc(100% - 20px);
    margin: 10% auto;
    padding: 18px;
    border-radius: 12px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Yksi sarake kaikilla pienillä laitteilla */
  #modalMenu {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* Menu-itemin sisäinen pakotus */
  .modal-menu-item {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Rivitä otsikko + hinta joustavasti */
  .modal-menu-top {
    flex-wrap: wrap;
    gap: 4px;
  }

  .modal-menu-title {
    width: 100%;
  }

  .modal-menu-price {
    font-size: 1rem;
  }

  /* Kategorian otsikko rivittyy nätisti */
  .modal-category h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }
}

/* --- ULTRA-SMALL SCREEN SUPPORT (max 360px) --- */
@media (max-width: 360px) {
  .modal-menu-item {
    padding: 10px 12px;
  }

  .modal-category h4 {
    font-size: 1rem;
  }

  .modal-menu-title {
    font-size: 0.95rem;
  }

  .modal-menu-ingredients {
    font-size: 0.8rem;
  }
}
/* Estä kortin venyminen sivulle */
.pizzeria {
  overflow: hidden;
}

.pizzeria-main {
  overflow-wrap: break-word;
  word-break: break-word;
}
