/* Modern responsive overrides — loaded after style.css */

/* ——— Desktop / mobile blocks ——— */
.m {
  display: none;
}

@media (max-width: 850px) {
  .d {
    display: none !important;
  }
  .m {
    display: block !important;
  }
}

/* ——— Columns & text clipping ——— */
@media (max-width: 850px) {
  .lb_80,
  .lb_60,
  .lb_50,
  .lb_40,
  .lb_20 {
    float: none;
    width: 100% !important;
    height: auto !important;
  }

  #wrap_filosofia .location_block,
  #wrap_elementi .orto_block,
  #wrap_elementi .orto_block.first {
    height: auto !important;
    min-height: 0;
    overflow: visible !important;
  }

  #wrap_filosofia .location_block .half_text,
  #wrap_elementi .orto_block .half_text,
  #wrap_elementi .ob2 .half_text {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    -ms-transform: none !important;
    -webkit-transform: none !important;
    padding: 32px 28px !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .h1_main,
  .h2_main,
  .h3_main {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .h1_main {
    font-size: clamp(1.75rem, 7vw, 2.75rem);
  }

  .h2_main {
    font-size: clamp(1.35rem, 5vw, 2rem);
  }

  .h3_main {
    font-size: clamp(0.95rem, 3.5vw, 1.15rem);
    line-height: 1.45;
    width: 90% !important;
    margin-left: auto;
    margin-right: auto;
  }

  .t_main {
    font-size: 15px;
    line-height: 1.55;
  }

  .blocco_testo {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  .visore .text_visore {
    padding: 0 20px;
    box-sizing: border-box;
  }

  .visore .text_visore .h1_main,
  .visore .text_visore .h3_main {
    width: 100% !important;
  }

  #wrap_elementi .img_orto,
  .img_orto {
    width: 90% !important;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  #wrap_elementi .bg_orto,
  #wrap_elementi .bg_orto_t2 {
    display: none;
  }

  /* Static cover blocks */
  #wrap_filosofia .sliderlocation .bgcover,
  .sliderlocation > .bgcover,
  .sliderlocation .embla__slide > .bgcover {
    width: 100% !important;
    height: min(70vw, 420px) !important;
    min-height: 280px !important;
  }

  #wrap_elementi .lb_60 .sliderlocation {
    min-height: 240px;
    height: auto;
  }

  #wrap_contact .cont_half {
    width: 100%;
  }

  #wrap_contact .container {
    min-height: 0;
  }

  #wrap_contact .text {
    font-size: 16px;
    line-height: 25px;
  }

  #wrap_news .news_container,
  #wrap_news .box_1_2 {
    width: 100%;
  }

  #wrap_elementi .blocco_testo p {
    width: 90%;
  }
}

@media (max-width: 480px) {
  .h3_main {
    width: 100% !important;
  }

  #wrap_filosofia .location_block .half_text,
  #wrap_elementi .orto_block .half_text {
    padding: 24px 18px !important;
  }

  .blocco_testo {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ——— Header CTAs (gerarchia: Prenota > Carta > Vini) ——— */
#header .right-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  float: none;
  max-width: min(62vw, 560px);
  padding-right: 4px;
}

#header .right-head .cta-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}

#header .right-head .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
  font-family: 'Roboto', sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

/* 1. Prenota — primario */
#header .right-head .cta--primary {
  height: 36px;
  padding: 0 18px;
  background: #fff;
  color: #362516 !important;
  border: 1px solid #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

#header .right-head .cta--primary:hover,
#header .right-head .cta--primary:focus-visible {
  background: transparent;
  color: #fff !important;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* 2. Carta + Carta dei vini — stesso stile secondario */
#header .right-head .cta--secondary {
  height: 36px;
  padding: 0 14px;
  background: transparent;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.85);
  font-size: 13px;
}

#header .right-head .cta--secondary:hover,
#header .right-head .cta--secondary:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#header .right-head .lang-wrap {
  float: none;
  margin: 0;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
}

#header .right-head .lang a {
  color: #fff;
}

#header #menu-btn {
  z-index: 1001;
  cursor: pointer;
}

#header .menu {
  z-index: 2000;
  top: 0;
  bottom: 0;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: #362516;
  background-image: url(../images/menu_visore.jpg);
  background-position: center center;
  background-size: cover;
}

/* Sticky compact */
#header.is-scrolled {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  height: 88px;
  background: rgba(54, 37, 22, 0.96);
  z-index: 1100;
  transition: background 0.25s ease, height 0.25s ease;
  display: flex;
  align-items: center;
}

#header.is-scrolled .logo {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
}

#header.is-scrolled .logo .img_logo {
  width: 110px;
  height: auto;
}

#header.is-scrolled .right-head {
  top: 50%;
  transform: translateY(-50%);
}

#header.is-scrolled #menu-btn {
  top: 50%;
  transform: translateY(-50%);
}

#header.is-scrolled #menu-btn button.burger {
  margin-top: 0;
  margin-bottom: 4px;
}

/* Menu aperto */
#header.is-menu-open {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  z-index: 2100;
  height: 115px !important;
  background: transparent !important;
}

#header.is-menu-open .right-head {
  display: none !important;
}

#header.is-menu-open #menu-btn {
  z-index: 2102;
  position: absolute;
}

#header.is-menu-open .logo {
  z-index: 2102;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  position: absolute;
}

#header.is-menu-open .menu.open {
  left: 0 !important;
  z-index: 2100;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

@media (max-width: 1100px) {
  #header .right-head {
    gap: 10px;
  }

  #header .right-head .cta--secondary {
    padding: 0 10px;
    font-size: 12px;
  }
}

@media (max-width: 850px) {
  #header {
    height: 128px;
    min-height: 128px;
    padding-bottom: 0;
  }

  #header .menu {
    display: block !important;
  }

  #header .menu .containmm {
    width: 100%;
  }

  #header .logo {
    top: 10px;
    width: 78px;
  }

  #header .logo .img_logo {
    max-width: 78px;
    height: auto;
  }

  /* CTA + lingua con margine dal bordo inferiore */
  #header .right-head {
    position: absolute;
    top: 58px;
    bottom: auto;
    left: 16px;
    right: 16px;
    max-width: none;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding-bottom: 12px;
  }

  #header .right-head .cta-group {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  #header .right-head .cta--primary,
  #header .right-head .cta--secondary {
    flex: 0 1 auto;
    min-width: 0;
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  #header .right-head .lang-wrap {
    order: 2;
    padding: 4px 8px 2px;
  }

  #header.is-scrolled {
    height: 118px;
    display: block;
  }

  #header.is-scrolled .logo {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
  }

  #header.is-scrolled .logo .img_logo {
    width: 78px;
  }

  #header.is-scrolled .right-head {
    top: 52px;
    transform: none;
    padding-bottom: 10px;
  }

  #header.is-scrolled #menu-btn {
    top: 8px;
    transform: none;
  }

  #header.is-scrolled #menu-btn button.burger {
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  #header {
    height: 132px;
    min-height: 132px;
  }

  #header .right-head {
    top: 56px;
    left: 14px;
    right: 14px;
    gap: 10px;
    padding-bottom: 14px;
  }

  #header .right-head .cta-group {
    gap: 6px;
  }

  #header .right-head .cta--primary {
    padding: 0 14px;
  }

  #header .right-head .cta--secondary {
    padding: 0 10px;
    font-size: 11px;
  }

  #header .menu .mn {
    font-size: 26px !important;
  }

  #header.is-scrolled {
    height: 122px;
  }

  #header.is-scrolled .right-head {
    top: 50px;
    padding-bottom: 12px;
  }
}

/* ——— Embla slider ——— */
.sliderlocation {
  position: relative;
  overflow: hidden;
}

/* Non forzare 100%: .sliderlocation.lb_60 deve restare al 60% (filosofia/osteria) */
.sliderlocation:not(.lb_60):not(.lb_40):not(.lb_50):not(.lb_80) {
  width: 100%;
}

.sliderlocation.is-embla .embla__viewport {
  overflow: hidden;
  width: 100%;
}

.sliderlocation.is-embla .embla__container {
  display: flex;
  touch-action: pan-y pinch-zoom;
}

.sliderlocation.is-embla .embla__slide {
  flex: 0 0 100%;
  min-width: 0;
  position: relative;
}

.sliderlocation.is-embla .embla__slide img,
.sliderlocation .img_orto {
  display: block !important;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

.sliderlocation > .bgcover {
  width: 100%;
  height: 600px;
  min-height: 600px;
  background-size: cover;
  background-position: center;
}

.embla__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(54, 37, 22, 0.35);
  background: rgba(255, 255, 255, 0.85);
  color: #362516;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.embla__btn:hover,
.embla__btn:focus-visible {
  background: #fff;
  outline: 2px solid #362516;
  outline-offset: 2px;
}

.embla__btn--prev {
  left: 16px;
}

.embla__btn--next {
  right: 16px;
}

.embla__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 650px) {
  .embla__btn {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .embla__btn--prev {
    left: 8px;
  }

  .embla__btn--next {
    right: 8px;
  }
}

/* ——— Menu overlay polish (keeps legacy left: -100% → 0) ——— */
#header .menu {
  transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#header .menu .mn {
  transition: opacity 0.25s ease;
}

/* ——— Scroll reveal ——— */
.reveal {
  opacity: 0;
  transition: opacity 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
}

/* Evitare translate su blocchi float (rompe 60/40) */
.reveal.reveal--motion {
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.reveal--motion.is-visible {
  transform: none;
}

.visore .text_visore {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease 0.35s, transform 0.6s ease 0.35s;
}

.visore.is-ready .text_visore {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  #header .menu,
  .reveal,
  .visore .text_visore,
  .span_effect,
  .embla__btn {
    transition: none !important;
  }

  .reveal,
  .visore .text_visore {
    opacity: 1;
    transform: none;
  }
}

/* ——— Cookie popup ——— */
#nspopup {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#nspopup.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
