html, body {
	height: 100%;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #FFECE4; 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.4s ease-out;
    animation: hidePreloader 2.7s ease-out forwards;
}

#preloader.hide {
    opacity: 0;
    pointer-events: none;
}

@keyframes hidePreloader {
    0% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        pointer-events: none;
    }
}

/* Burger layer */
.layer {
    position: absolute;
    left: 50%;
    width: 70%;
    height: auto;
    animation: 0.8s ease-out forwards;
	animation-fill-mode: both;
}

.layer.bun-top {
    width: 70%;
    height: auto;
    background: transparent;
    animation: slideInFromLeft 0.3s ease-out forwards;
    animation-delay: 0s;
    z-index: 7;
    --final-y: 60px;
    transform: translateX(-100vw) translateY(var(--final-y));
}

.layer.lattuga {
    width: 70%;
    height: auto;
    background: transparent;
    animation: slideInFromRight 0.3s ease-out forwards;
    animation-delay: 0.3s;
    z-index: 4;
    --final-y: 60px;
    transform: translateX(100vw) translateY(var(--final-y));
}


.layer.tomato {
    width: 70%;
    height: auto;
    background: transparent;
    animation: slideInFromLeft 0.3s ease-out forwards;
    animation-delay: 0.6s;
    z-index: 5;
    --final-y: 60px;
    transform: translateX(-100vw) translateY(var(--final-y));
}

.layer.cheese {
    width: 70%;
    height: auto;
    background: transparent;
    animation: slideInFromRight 0.3s ease-out forwards;
    animation-delay: 0.9s;
    z-index: 4;
    --final-y: 60px;
    transform: translateX(100vw) translateY(var(--final-y));
}

.layer.patty {
    width: 70%;
    height: auto;
    background: transparent;
    animation: slideInFromLeft 0.3s ease-out forwards;
    animation-delay: 1.2s;
    z-index: 3;
    --final-y: 60px;
    transform: translateX(-100vw) translateY(var(--final-y));
}

.layer.bun-bottom {
    width: 70%;
    height: auto;
    background: transparent;
    animation: slideInFromRight 0.3s ease-out forwards;
    animation-delay: 1.5s;
    z-index: 2;
    --final-y: 60px;
    transform: translateX(100vw) translateY(var(--final-y));
}

@media (min-width: 768px) {
    .layer {
        width: 50%;
    }
    
    .layer.bun-top, .layer.lattuga, .layer.tomato, .layer.cheese, .layer.patty, .layer.bun-bottom {
        width: 50%;
    }
}

@media (min-width: 1024px) {
    .layer {
        width: 35%;
    }
    
    .layer.bun-top, .layer.lattuga, .layer.tomato, .layer.cheese, .layer.patty, .layer.bun-bottom {
        width: 35%;
    }
}

/* Keyframe layers da sinistra */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100vw) translateY(var(--final-y));
    }
    to {
        transform: translateX(-50%) translateY(var(--final-y));
    }
}

/* Keyframe layers da destra */
@keyframes slideInFromRight {
    from {
        transform: translateX(100vw) translateY(var(--final-y));
    }
    to {
        transform: translateX(-50%) translateY(var(--final-y));
    }
}

@keyframes dropIn {
    to {
        transform: translateX(-50%) translateY(var(--final-y));
    }
}

/* ===== BEST SELLERS GRID - HOME PAGE ONLY ===== */
.best-sellers-grid {
	display: grid;
	gap: 40px;
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
	.best-sellers-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 30px;
	}
}

@media (max-width: 768px) {
	.best-sellers-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	
	.burger-card {
		width: 100%;
		max-width: 100%;
	}
	
	.burger-card-left,
	.burger-card-center,
	.burger-card-right {
		transform: none !important;
		z-index: 1 !important;
		scale: 1 !important;
	}
	
	.burger-image-container {
		height: 200px;
	}
}

@media (max-width: 480px) {
	#preloader .layer {
		--final-y: -70px !important;
	}

	.best-sellers-grid {
		display: flex;
		flex-direction: column;
		gap: 15px;
		padding: 0;
	}
	
	.burger-card {
		width: 90%;
		max-width: 100%;
		border-radius: 12px;
	}
	
	.burger-card-left {
		transform: rotate(-2deg) !important;
		margin-left: 0;
		margin-right: auto;
	}
	
	.burger-card-center {
		transform: rotate(2deg) !important;
		margin-left: auto;
		margin-right: 0;
	}
	
	.burger-card-right {
		transform: rotate(-2deg) !important;
		margin-left: 0;
		margin-right: auto;
	}
	
	.burger-card-left,
	.burger-card-center,
	.burger-card-right {
		z-index: 1 !important;
		scale: 1 !important;
	}
	
	.burger-image-container {
		height: 180px;
	}
	
	.burger-details {
		padding: 12px;
		padding-bottom: 40px;
	}
	
	.burger-name {
		font-size: 1.1rem;
	}
	
	.burger-ingredients {
		font-size: 0.85rem;
	}
	
	.burger-price {
		bottom: 10px;
		right: 12px;
		font-size: 1rem;
	}
}

/* ===== sezione insta e busta di carta ===== */
.ig-paper {
  position: relative;
  margin: 0 auto;
  max-width: 1300px;
  height: 150vh;
  padding: 60px 40px;
  background: url("../images/paper_bag.png") center / cover no-repeat;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  /* justify-content: space-between; */
  align-items: center;
  overflow: hidden;
  margin-bottom: 10%;
}

.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
  justify-items: center;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

.ig-embed {
  width: 100%;
  max-width: 360px;
  max-height: 650px;
  aspect-ratio: 3 / 6;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.ig-embed:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 4px rgba(0,0,0,.25);
}

/* Media queries per ig-paper e ig-grid */
@media (max-width: 1024px) {
  .ig-grid {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .ig-grid::-webkit-scrollbar {
    display: none;
  }

  .ig-embed {
    flex: 0 0 clamp(240px, 36vw, 320px);
    max-width: clamp(240px, 36vw, 320px);
    scroll-snap-align: center;
  }
}

/* TABLET: 768px - 1024px */
@media (max-width: 1024px) and (min-width: 768px) {
  .ig-paper {
    height: auto;
    min-height: 70vh;
    max-height: 85vh;
    padding: 40px 30px;
    background-size: cover;
    background-repeat: no-repeat;
  }

  .ig-embed {
    flex: 0 0 clamp(220px, 35vw, 300px);
    max-width: clamp(220px, 35vw, 300px);
    max-height: 400px;
  }

  .section-header {
    margin-bottom: 25px;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }

  .section-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 800px) {
  .ig-paper {
    height: auto;
    min-height: 80vh;
    max-height: 90vh;
    padding: 30px 20px;
    background-size: contain;
    background-repeat: no-repeat;
  }

  .ig-embed {
    flex-basis: clamp(180px, 60vw, 240px);
    max-height: 400px;
  }
}

@media (max-width: 480px) {
  .ig-paper {
    padding: 10px 12px;
    min-height: 60vh;
    max-height: 70vh;
    background-size: 180%;
    background-position: center;
  }

  .ig-grid {
    gap: 12px;
    padding-bottom: 12px;
  }

  .ig-embed {
    flex-basis: clamp(160px, 70vw, 200px);
    max-height: 350px;
  }

  .section-header {
    margin-bottom: 15px;
  }

  .section-title {
    font-size: 1.2rem;
    margin-bottom: 5px;
  }

  .section-subtitle {
    font-size: 0.85rem;
  }
}

/* ====== INSTAGRAM: desktop vs mobile ====== */

/* di default: desktop attivo, mobile nascosto */
.ig-grid-desktop { display: grid; }
.ig-grid-mobile { display: none; }

/* SOLO MOBILE: attivo carosello orizzontale */
@media (max-width: 480px) {

  /* nascondo embed pesanti */
  .ig-grid-desktop { 
    display: none; 
  }
  

  /* mostro carosello */
  .ig-grid-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    z-index: 15;
    transform: translateY(0);
  }

  .ig-carousel-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
    min-height: 1000px;
    display: flex;
    justify-content: center;
  }

  .ig-carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    border-radius: 12px;
    width: 100%;
    height: ;
  }

  .ig-carousel-container::-webkit-scrollbar {
    display: none;
  }

  .ig-carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
    height: 900px;
    scroll-snap-align: center;
    display: flex;

    justify-content: center;
    overflow: hidden;
  }

  .ig-carousel-slide .instagram-media {
    max-width: 40% !important;
    width: 60% !important;
    height: auto !important;
    transform: scale(0.6);
    transform-origin: top center;
  }

  /* Indicatori punti */
  .ig-carousel-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
    padding: 0 12px;
  }

  .ig-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d0d0d0;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    padding: 0;
  }

  .ig-dot:hover {
    background-color: #b0b0b0;
  }

  .ig-dot.active {
    background-color: #FF7043;
    transform: scale(1.2);
  }
  .ig-paper {

  }
}

/* ============================================
   SCRITTA SCORREVOLE CON 4 CLONI PER LOOP PERFETTO
   ============================================ */

.scrolling-banner {
  background-color: #323031;
  width: 100%;
  padding: 40px 0;
  overflow: hidden;
  position: relative;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  display: flex;
  align-items: center;
}

.scrolling-text {
  display: flex;
  white-space: nowrap;
  animation: scroll-left-perfect 10s linear infinite; /* Aumentato il tempo per 4 cloni */
  align-items: center;
}

.text-group {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
  padding: 0 0px; /* Aggiunto padding per distanza dai bordi */
}

.scrolling-text span {
  font-size: 4.2rem;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-shadow: 0 3px 8px rgba(0,0,0,0.25);
  line-height: 1;
  flex-shrink: 0;
}

/* Colori delle parole */
.eat { color: #177E89; }
.enjoy { color: #DB3A34; }
.repeat { color: #FF7043; }
.separator { 
  color: #ffffff;
  opacity: 0.7;
  margin-right: 20px;
}

@keyframes scroll-left-perfect {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-25%); /* -25% perché ora ho 4 gruppi identici */
  }
}

/* MASCHERA PER NASCONDERE QUALSIASI RESIDUA IMPERFEZIONE */
.scrolling-banner::before,
.scrolling-banner::after {
  content: '';
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px; /* Aumentata la maschera */
  z-index: 2;
  pointer-events: none;
}

.scrolling-banner::before {
  left: 0;
  background: linear-gradient(to right, #323031 60%, transparent 100%);
}

.scrolling-banner::after {
  right: 0;
  background: linear-gradient(to left, #323031 60%, transparent 100%);
}

/* Responsive */
@media (max-width: 800px) {
  .scrolling-banner { 
    padding: 20px 0; 
  }
  .scrolling-text span { 
    font-size: clamp(1.8rem, 5vw, 2.5rem); 
  }
  .text-group { 
    gap: 12px; 
    padding: 0 15px;
  }
  .scrolling-banner::before,
  .scrolling-banner::after {
    width: 80px;
  }
}

@media (max-width: 480px) {
  .scrolling-banner { 
    padding: 15px 0; 
  }
  .scrolling-text span { 
    font-size: clamp(1.5rem, 4.5vw, 2rem); 
  }
  .text-group { 
    gap: 8px; 
    padding: 0 10px;
  }
  .scrolling-banner::before,
  .scrolling-banner::after {
    width: 20px;
  }
}

/* ============================================
   SEZIONE IMMAGINE-TESTO CON SOVRAPPOSIZIONE ESTERNA
   ============================================ */

.image-text-section {
    padding: 80px 0;
    background: #f8f8f800;
}

.image-text-overlap {
    max-width: 1200px;
    margin: 0 auto;
}

.content-wrapper {
    position: relative;
}

/* Container immagine */
.image-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border: 3px solid #000;
    height: 500px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Testo sovrapposto che esce dall'immagine */
.text-overlay {
    position: absolute;
    bottom: -40px;
    right: -30px;
    width: 350px;
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border: 3px solid #000;
    z-index: 10;
}

.text-content {
    text-align: left;
}

.text-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #E65100;
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.text-description {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
}

.text-button {
    display: inline-block;
    padding: 10px 25px;
    background: #E65100;
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    border: 2px solid #000;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    box-shadow: 3px 3px 0 #000;
}

.text-button:hover {
    background: #FF7043;
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #000;
    text-decoration: none;
}

/* Versione con angolo decorativo */
.text-overlay::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 40px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    transform: rotate(45deg);
    border-left: 3px solid #000;
    border-top: 3px solid #000;
}

/* MOBILE - Unica card */
@media (max-width: 768px) {
    .image-text-section {
        padding: 60px 20px;
    }
    
    .content-wrapper {
        background: #ffffff;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.15);
        border: 3px solid #000;
        overflow: hidden;
    }
    
    .image-container {
        height: 300px;
        border-radius: 0;
        border: none;
        box-shadow: none;
        margin-bottom: 0;
    }
    
    .text-overlay {
        position: relative;
        width: 100%;
        right: 0;
        bottom: 0;
        padding: 30px;
        border-radius: 0;
        border: none;
        border-top: 3px solid #000;
        box-shadow: none;
    }
    
    .text-overlay::before {
        display: none;
    }
    
    .text-title {
        font-size: 1.6rem;
        margin-bottom: 15px;
    }
    
    .text-description {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .text-button {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* Mobile piccolo */
@media (max-width: 480px) {
    .image-text-section {
        padding: 40px 15px;
    }
    
    .content-wrapper {
        border-radius: 15px;
    }
    
    .image-container {
        height: 250px;
    }
    
    .text-overlay {
        padding: 25px 20px;
    }
    
    .text-title {
        font-size: 1.4rem;
    }
    
    .text-description {
        font-size: 0.9rem;
    }
    
    .text-button {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

/* Tablet - mantiene la sovrapposizione */
@media (min-width: 769px) and (max-width: 1024px) {
    .image-container {
        height: 450px;
    }
    
    .text-overlay {
        width: 320px;
        right: -20px;
        bottom: -30px;
        padding: 25px;
    }
    
    .text-title {
        font-size: 1.6rem;
    }
}

/* ============================================
   SEZIONE PARALLASSE
   ============================================ */

.parallax-section {
  position: relative;
  height: 60vh;
  min-height: 400px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 80px 0;
  border-top: 8px solid #000000;
  border-bottom: 8px solid #000000;

}

.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  background-image: url('../images/varie/Fabù_27.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 1;
}

.parallax-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.parallax-content {
  position: relative;
  z-index: 3;
  text-align: center;
  color: white;
  padding: 60px 40px;
}

.parallax-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  margin-bottom: 20px;
  text-shadow: 
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     0 4px 20px rgba(0, 0, 0, 0.5);
  font-family: 'Poppins', sans-serif;
  color: #E65100;
  text-transform: uppercase;
}

.parallax-text {
  font-size: clamp(0.8rem, 2.5vw, 1.5rem);
  line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

@media (max-width: 768px) {
  .parallax-section {
    height: 50vh;
    min-height: 350px;
    margin: 60px 0;
  }

  .parallax-bg {
    background-attachment: scroll;
  }

  .parallax-content {
    padding: 30px 15px;
  }
}

@media (max-width: 480px) {
  .parallax-section {
    height: 40vh;
    min-height: 400px;
    margin: 40px 0;
  }

  .parallax-content {
    padding: 20px 12px;
  }
}

