/* ============================================
   GRAND GELATO — Responsive Styles v3
   Breakpoints: xl 1280 | lg 1024 | md 768 | sm 480 | xs 360
   ============================================ */

/* === GLOBAL — prevent horizontal scroll === */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* === Hide mobile-only CTA on desktop === */
.split-cta-mobile { display: none; }

/* =====================
   XL — 1280px
   ===================== */
@media (max-width: 1280px) {
  :root { --section-padding: 80px 0; }
  .container { padding: 0 1.75rem; }
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 2rem;
  }
}

/* =====================
   LG — 1024px
   ===================== */
@media (max-width: 1024px) {
  :root {
    --section-padding: 70px 0;
    --nav-height: 70px;
  }

  .nav-links { display: none; }
  .hamburger { display: flex; }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-grid > *:first-child { grid-column: 1 / -1; }

  .split-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .split-image { min-height: 320px; }
  .split-content { padding: 3rem 2rem; }
  .split-content-inner { max-width: 100%; }

  .wholesale-strip-grid {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  .wholesale-strip-grid > div {
    padding: 2.5rem 2rem !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(92,71,72,0.1);
  }
  .wholesale-strip-grid > div:last-child { border-bottom: none; }

  .stats-bar .grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

/* =====================
   MD — 768px (mobile)
   ===================== */
@media (max-width: 768px) {
  :root {
    --section-padding: 42px 0;
    --nav-height: 60px;
  }

  section { padding: 2.5rem 0 !important; }

  /* Typography */
  h1 { font-size: clamp(2rem, 9vw, 2.8rem); line-height: 1.05; }
  h2 { font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.15; }
  h3 { font-size: clamp(1.15rem, 4vw, 1.5rem); }
  .lead { font-size: 0.95rem; line-height: 1.65; }
  .display-italic { line-height: 1.1; }

  .section-header { margin-bottom: 2rem !important; }

  .container,
  .container-narrow { padding: 0 1.25rem; }

  .grid-2,
  .grid-3 { grid-template-columns: 1fr; gap: 1.5rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  /* === #1 PRELOADER — bigger logo === */
  .preloader-logo {
    height: 110px !important;
    width: auto !important;
  }

  /* === #3 HERO — no extra space, display:block ditches flex centering === */
  .hero,
  section.hero {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    display: block !important;
    position: relative !important;
  }
  .hero > .container {
    padding-top: 6rem !important;
    padding-bottom: 2.5rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    position: relative;
    z-index: 2;
  }
  .hero-content {
    padding: 0 !important;
    margin: 0 !important;
  }
  .hero-content h1 {
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
  }
  .hero-content .lead {
    margin-bottom: 1.25rem !important;
  }
  .hero-content .mt-4 {
    margin-top: 0 !important;
  }
  .hero-overlay {
    background: linear-gradient(
      to bottom,
      rgba(42,31,32,0.5) 0%,
      rgba(42,31,32,0.7) 60%,
      rgba(42,31,32,0.85) 100%
    ) !important;
  }
  .hero-content { padding: 0 0.25rem; }
  .hero-content .lead br { display: none; }
  .hero-content .btn { padding: 0.7rem 1.5rem; font-size: 0.7rem; }
  .hero-scroll { display: none !important; }

  /* Navbar */
  .navbar { padding: 0.5rem 0; }
  .nav-logo-img { height: 42px; }

  /* Stats bar */
  .stats-bar { padding: 2.5rem 0 !important; }
  .stats-bar .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem 0.5rem;
  }
  .stat-number { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .stat-label { font-size: 0.62rem; }

  /* Marquee — δεν σταματάει στο touch */
  .marquee-wrap { padding: 0.75rem 0 !important; }
  .marquee-item { font-size: 0.9rem; }
  .marquee-track,
  .marquee-track:hover {
    animation-play-state: running !important;
  }

  /* === #4 ABOUT TEASER — reorder: title → text → photo → button === */
  .split-section-about {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "content"
      "image"
      "cta" !important;
    gap: 0;
  }
  .split-section-about .split-image {
    grid-area: image !important;
    min-height: 260px;
    margin: 0 1.25rem;
    border-radius: 12px;
    overflow: hidden;
  }
  .split-section-about .split-content { grid-area: content !important; padding: 2rem 1.25rem 1.25rem !important; }
  .split-section-about .split-cta-mobile {
    grid-area: cta !important;
    display: block !important;
    text-align: center;
    padding: 1.5rem 1.25rem 0.5rem;
  }
  /* Hide desktop CTA inside content on mobile */
  .split-section-about .split-cta-desktop { display: none !important; }

  /* OTHER split sections (franchise) */
  .split-section:not(.split-section-about) .split-image { min-height: 240px; }
  .split-section:not(.split-section-about) .split-content { padding: 2.25rem 1.25rem !important; }
  .split-content h2 br,
  .wholesale-strip-grid h2 br { display: inline; }

  /* === #6 WHOLESALE — 2x2 SQUARE cards === */
  .wholesale-strip-grid h2 { margin-bottom: 0.5rem; }

  /* The right panel (with the 4 cards) becomes a 2x2 grid */
  .wholesale-strip-grid > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
    padding: 2rem 1.25rem !important;
  }
  /* Each card becomes a SQUARE with vertical centered layout */
  .wholesale-strip-grid .wholesale-card {
    aspect-ratio: 1 / 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 1rem 0.75rem !important;
    gap: 0.6rem !important;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(92,71,72,0.06);
  }
  .wholesale-strip-grid .wholesale-card > div:first-child {
    margin: 0 !important;
  }
  .wholesale-strip-grid .wholesale-card .wholesale-title {
    font-size: 0.82rem !important;
    margin: 0 !important;
    line-height: 1.2 !important;
  }
  .wholesale-strip-grid .wholesale-card .wholesale-sub {
    font-size: 0.68rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
  }

  /* === #5 FLAVORS — SPOTLIGHT SWIPE CAROUSEL (mobile) === */
  /* Disable desktop marquee animation entirely */
  .flavors-track {
    animation: none !important;
    transform: none !important;
    will-change: auto !important;
    display: flex !important;
    gap: 0 !important;
  }

  /* Make the outer a horizontal swipe container with snap */
  .flavors-track-outer {
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 1rem 0 !important;
    scroll-padding: 0;
  }
  .flavors-track-outer::-webkit-scrollbar { display: none; }

  /* Each slide: wider, snap to center, with opacity & scale effect */
  .flavors-slide {
    flex: 0 0 50vw !important;
    min-width: 50vw !important;
    max-width: 50vw !important;
    scroll-snap-align: center;
    padding: 0.5rem !important;
    text-align: center;
    opacity: 0.4;
    transform: scale(0.85);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  /* Active (centered) slide — full opacity + slightly larger */
  .flavors-slide.active {
    opacity: 1;
    transform: scale(1.0);
  }

  /* Bigger images on mobile spotlight */
  .flavors-slide-img {
    width: 140px !important;
    height: 140px !important;
    margin: 0 auto !important;
  }
  .flavors-slide-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0 auto;
  }
  .flavors-slide-name {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    margin-top: 1rem !important;
    text-align: center !important;
    letter-spacing: 0.02em;
  }

  /* === #7 TESTIMONIALS — carousel (auto-scroll handled in JS) === */
  .testimonials-grid {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem !important;
    padding: 0.5rem 1.25rem 1rem;
    margin: 0 -1.25rem;
    scrollbar-width: thin;
    scroll-behavior: smooth;
  }
  .testimonials-grid > .testimonial {
    flex: 0 0 88%;
    scroll-snap-align: center;
    padding: 1.5rem !important;
  }
  .testimonials-grid::-webkit-scrollbar { height: 3px; }
  .testimonials-grid::-webkit-scrollbar-thumb {
    background: var(--pink-orchid);
    border-radius: 2px;
  }
  .testimonial-text { font-size: 0.9rem; line-height: 1.6; }

  /* Cert row — 2x2 grid */
  .cert-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem 1rem !important;
    max-width: 320px;
    margin: 0 auto;
  }
  .cert-row > div {
    text-align: center;
    min-height: 110px;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .cert-row img { height: 56px !important; }
  .cert-row > div > div[style*="2.5rem"] { font-size: 2rem !important; }

  /* Newsletter form — input full width, button auto + centered */
  .newsletter-form-row {
    flex-direction: column !important;
    max-width: 340px !important;
    align-items: center !important;
  }
  .newsletter-form-row input {
    width: 100% !important;
  }
  .newsletter-form-row button {
    width: auto !important;
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
    align-self: center !important;
  }

  /* === #8 FOOTER — Σελίδες & Υπηρεσίες side-by-side === */
  .footer { padding: 2.5rem 0 1.5rem !important; }
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem 1.25rem !important;
  }
  /* Brand (col 1) — full width */
  .footer-grid > *:nth-child(1) {
    grid-column: 1 / -1 !important;
  }
  /* Σελίδες (col 2) + Υπηρεσίες (col 3) — side by side, auto */
  .footer-grid > *:nth-child(2),
  .footer-grid > *:nth-child(3) {
    grid-column: span 1 !important;
  }
  /* Επικοινωνία (col 4) — full width */
  .footer-grid > *:nth-child(4) {
    grid-column: 1 / -1 !important;
  }
  .footer-logo { height: 50px; margin-bottom: 0.75rem; }
  .footer-tagline { line-height: 1.6; margin-bottom: 0.75rem; }
  .footer-heading { margin-bottom: 0.6rem !important; font-size: 0.7rem; }
  .footer-links { gap: 0.45rem !important; }
  .footer-links a { font-size: 0.85rem; }
  .footer-contact-item { margin-bottom: 0.5rem !important; font-size: 0.85rem; }

  .footer-bottom {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    gap: 0.75rem !important;
    padding-top: 1.5rem !important;
    margin-top: 1.5rem !important;
  }
  .footer-bottom > * { width: 100%; text-align: center; }
  .footer-bottom .footer-copy { font-size: 0.72rem !important; }
  .footer-legal { justify-content: center; gap: 1rem !important; }
  .footer-legal a { font-size: 0.72rem; }

  /* Mobile menu */
  .mobile-menu {
    padding: 5rem 2rem 2rem !important;
    justify-content: flex-start !important;
    gap: 1.25rem !important;
    overflow-y: auto;
  }
  .mobile-menu a { font-size: 1.5rem !important; line-height: 1.1; }
  .mobile-menu .mobile-lang { margin-top: 1.5rem !important; }

  /* Cookie banner */
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.1rem 1.1rem 1.25rem;
    bottom: 1rem !important;
    max-width: calc(100% - 2rem);
    width: calc(100% - 2rem) !important;
  }
  .cookie-actions { width: 100%; gap: 0.5rem; }
  .cookie-accept,
  .cookie-decline { flex: 1; text-align: center; }

  .scroll-top { bottom: 1.25rem; right: 1.25rem; width: 40px; height: 40px; }

  .form-input,
  .form-textarea,
  .form-select { padding: 0.7rem 0.95rem; font-size: 0.9rem; }

  .filter-tabs { gap: 0.35rem; }
  .filter-tab { padding: 0.35rem 0.9rem; font-size: 0.65rem; }

  /* Hide ice cream cursor on touch */
  #ice-cursor { display: none !important; }
  * { cursor: auto !important; }

  /* === #3 CTA buttons — centered on mobile === */
  .split-section .split-content .mt-4,
  .split-section .split-content-inner .mt-4 {
    text-align: center !important;
  }
  .wholesale-strip-grid > div:first-child .mt-4 {
    text-align: center !important;
  }

  /* Welcome popup */
  #welcome-popup { padding: 1.75rem 1.25rem !important; max-width: 92vw !important; }
}

/* =====================
   SM — 480px
   ===================== */
@media (max-width: 480px) {
  :root {
    --section-padding: 36px 0;
    --nav-height: 56px;
  }

  section { padding: 2rem 0 !important; }
  .container { padding: 0 1rem; }

  .preloader-logo { height: 95px !important; }

  .hero { min-height: 68dvh !important; }
  .hero-content h1 { font-size: clamp(1.9rem, 10vw, 2.5rem); }
  .hero-content .lead { font-size: 0.88rem; }
  .hero-content .flex { gap: 0.5rem; }

  .btn { padding: 0.7rem 1.4rem; font-size: 0.68rem; }

  .stats-bar .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem 0.5rem !important;
  }
  .stat-number { font-size: clamp(1.6rem, 6.5vw, 2rem); }

  .testimonial { padding: 1.25rem !important; }
  .testimonial-text { font-size: 0.88rem; }

  .split-image { min-height: 220px; }
  .split-content { padding: 1.75rem 1rem !important; }
  .split-section-about .split-content { padding: 1.5rem 1rem 1rem !important; }
  .split-section-about .split-image { min-height: 220px; }

  .wholesale-strip-grid > div { padding: 1.75rem 1rem !important; }

  .cert-row { gap: 1.5rem 0.75rem !important; }
  .cert-row img { height: 48px !important; }
  .cert-row > div > div[style*="2.5rem"] { font-size: 1.7rem !important; }

  .mobile-menu a { font-size: 1.35rem !important; }
  .mobile-menu { gap: 1rem !important; }

  .footer-logo { height: 46px; }
  .footer-socials { margin-top: 0.75rem; }

  .newsletter-form-row { max-width: 100% !important; }
  .card-body { padding: 1rem; }

  /* Flavors spotlight — smaller image on small phones */
  .flavors-slide-img { width: 120px !important; height: 120px !important; }
  .flavors-slide-name { font-size: 0.88rem !important; }
}

/* =====================
   XS — 360px
   ===================== */
@media (max-width: 360px) {
  .container { padding: 0 0.875rem; }
  .btn { padding: 0.65rem 1.1rem; font-size: 0.65rem; }
  .nav-logo-img { height: 36px; }

  .stats-bar .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem 0.5rem !important;
  }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }

  .mobile-menu a { font-size: 1.2rem !important; }
  .cookie-banner { padding: 0.9rem; }

  .flavors-slide-img { width: 100px !important; height: 100px !important; }
  .flavors-slide-name { font-size: 0.82rem !important; }

  .cert-row { gap: 1.25rem 0.5rem !important; }
  .cert-row img { height: 44px !important; }
}

/* =====================
   Landscape mobile
   ===================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 100vw; }
  .mobile-menu {
    justify-content: flex-start;
    padding: 4.5rem 2rem 2rem;
    overflow-y: auto;
    gap: 0.75rem;
  }
  .mobile-menu a { font-size: 1.3rem !important; }
}

/* =====================
   Print
   ===================== */
@media print {
  .navbar,
  .scroll-top,
  .cookie-banner,
  .preloader,
  .mobile-menu,
  #ice-cursor,
  #scroll-progress,
  #welcome-popup-overlay { display: none !important; }

  body { background: #fff; color: #000; }
  .hero { height: auto; min-height: auto; padding: 2rem 0; }
  .hero-overlay { display: none; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.75rem; color: #666; }
}
