/* ==========================================================================
   ALBERTINI RESPONSIVE
   Questo file viene caricato solo su schermi <= 1024px
   (grazie alla media query nel tag link)
   Il CSS desktop (albertini.css) rimane intatto.
   ========================================================================== */

/* Box-sizing globale per calcoli piu prevedibili */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Immagini responsive */
img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   TABLET (768px - 1024px)
   ========================================================================== */

/* Container fluidi */
.center,
.wrapper {
  width: 100%;
  max-width: 860px;
  padding: 0 15px;
}

/* Nascondi form prenotazione su tablet */
.requestarea {
  display: none;
}

/* Header e slideshow con aspect-ratio */
.header {
  height: auto;
}

.slideshowbox {
  height: auto;
  aspect-ratio: 1279 / 486;
}

.headerimg {
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Rimuovi linea divisoria su tablet (non si adatta al layout fluido) */
.box {
  background-image: none;
}

/* Sidebar e Topic proporzionali */
.sidebar {
  width: 25%;
}

.topic {
  width: 73%;
}

/* Welcomebox impilati */
.welcomebox.left {
  width: 100%;
  height: auto;
  float: none;
  padding: 20px;
}

.welcomebox.right {
  width: 100%;
  height: auto;
  float: none;
  margin-top: 15px;
  aspect-ratio: 358 / 239;
  padding: 0;
}

/* Elementi interni: rimuovi position absolute, fai che riempiano il contenitore */
.welcomebox.right .img,
.welcomebox.right .mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.welcomebox.right .img img,
.welcomebox.right .mask img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   MOBILE (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
  /* Header compatto */
  .header {
    height: auto;
    border-bottom: none;
  }

  .bar {
    height: auto;
    padding: 60px 0 10px 0; /* spazio per hamburger */
    text-align: center;
  }

  .bar .logo {
    position: relative;
    top: auto;
    left: auto;
    display: block;
    margin: 0 auto;
  }

  .bar .logo img {
    max-width: 220px;
    height: auto;
  }

  /* Nascondi menu servizi e lingue nella bar (vanno nell'hamburger) */
  .menuservice,
  .mod-languages {
    display: none;
  }

  /* Slideshow piu basso su mobile */
  .slideshowbox {
    aspect-ratio: 16 / 9;
  }

  /* Rimuovi layout a 2 colonne */
  .sidebar {
    display: none;
  }

  .topic {
    float: none;
    width: 100%;
    padding: 0;
  }

  /* Nascondi promoimage su mobile */
  .promoimage {
    display: none;
  }

  /* Welcomebox */
  .welcomebox.left {
    padding: 15px;
  }

  .welcomebox.left h2 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  /* Footer responsive */
  .footer {
    height: auto;
    padding: 20px 15px;
    text-align: center;
    line-height: 1.6;
  }

  .footer .logo {
    float: none;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 2px solid #FFF;
    padding-bottom: 15px;
    margin-bottom: 15px;
  }

  .footer .logo img {
    margin: 0 auto;
  }

  .footer .desc {
    float: none;
    width: 100%;
    padding: 10px 0;
    line-height: 1.6;
  }

  .footer .social {
    float: none;
    margin: 15px 0;
  }

  .footer .mail {
    float: none;
    margin: 15px 0;
  }

  .footer .mail a {
    display: inline-block;
    text-align: left;
  }

  .menufooter {
    position: static;
    text-align: center;
    margin: 15px 0;
  }

  .menufooter li {
    float: none;
    display: inline-block;
    padding: 0 8px;
  }

  .footer .altea {
    float: none;
    position: static;
    margin: 15px 0;
  }

  .footer #backlink,
  .footer #miaaltabadia {
    position: static;
    display: block;
    margin: 10px auto;
  }

  /* Content */
  .content h1 {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 20px;
  }

  .content p {
    font-size: 15px;
  }

  /* Roompreview (se presente in altre pagine) */
  .roompreview {
    width: 100%;
    padding: 10px;
  }

  .room.left,
  .room.right {
    float: none;
    width: 100%;
  }

  .room.left {
    padding-right: 0;
  }
}

/* ==========================================================================
   HAMBURGER MENU
   ========================================================================== */

/* Bottone hamburger (nascosto di default) */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10001;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: #670a0a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: #fff;
  margin: 4px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* Stato aperto - animazione X */
.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Overlay scuro */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
}

.menu-overlay.active {
  display: block;
}

/* Drawer menu mobile */
.mobile-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: #fff;
  z-index: 10000;
  padding: 70px 20px 20px;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0,0,0,0.3);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-menu-drawer.open {
  transform: translateX(0);
}

/* Stili menu dentro il drawer */
.mobile-menu-drawer .menu-main-mobile {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-drawer .menu-main-mobile li {
  margin: 0;
}

.mobile-menu-drawer .menu-main-mobile li a {
  display: block;
  padding: 14px 0 14px 24px;
  font-size: 16px;
  color: #706f6f;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  background-image: url(../img/heaths.png);
  background-position: 0 10px;
  background-repeat: no-repeat;
}

.mobile-menu-drawer .menu-main-mobile li a:hover,
.mobile-menu-drawer .menu-main-mobile li.active a {
  color: #670a0a;
}

/* Selettore lingua nel drawer */
.mobile-menu-drawer .lang-switcher-mobile {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid #670a0a;
}

.mobile-menu-drawer .lang-switcher-mobile span {
  display: block;
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.mobile-menu-drawer .lang-switcher-mobile a {
  display: inline-block;
  padding: 8px 15px;
  margin-right: 8px;
  margin-bottom: 8px;
  border: 1px solid #670a0a;
  color: #670a0a;
  text-decoration: none;
  font-size: 14px;
  text-transform: uppercase;
}

.mobile-menu-drawer .lang-switcher-mobile a:hover {
  background: #670a0a;
  color: #fff;
}

/* Blocca scroll body quando menu aperto */
body.menu-is-open {
  overflow: hidden;
}

/* Mostra hamburger e drawer solo su mobile */
@media (max-width: 767px) {
  .hamburger-btn {
    display: block !important;
  }

  .mobile-menu-drawer {
    display: block !important;
  }

  .menu-overlay.active {
    display: block !important;
  }
}