/* =========================================================
   Atlas Ighir — Responsive Styles (all devices)
   Breakpoints: XL ≥1200 | LG ≤1199 | MD ≤991 | SM ≤767 | XS ≤575
   ========================================================= */

/* ---------- Extra large / laptop fine-tuning ---------- */
@media (max-width: 1399.98px) {
  .navbar-atlas .nav-link {
    padding: 0.45rem 0.65rem !important;
    font-size: 0.88rem;
  }
}

@media (max-width: 1199.98px) {
  :root {
    --nav-height: 76px;
  }

  .navbar-atlas .nav-link {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.95rem;
  }

  .chef-content {
    padding: 3rem 2.25rem;
  }

  .chef-grid {
    min-height: 480px;
  }

  .section {
    padding: 4.5rem 0;
  }
}

/* ---------- Tablet & below (hamburger menu) ---------- */
@media (max-width: 1199.98px) {
  .navbar-atlas .navbar-collapse {
    background: rgba(250, 248, 244, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin-top: 0.75rem;
    padding: 0.75rem 1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: calc(100vh - var(--nav-height) - 1rem);
    overflow-y: auto;
  }

  .navbar-atlas .navbar-nav {
    gap: 0.15rem;
  }

  .navbar-atlas .nav-link {
    padding: 0.7rem 0.85rem !important;
    border-radius: 0.65rem;
  }

  .navbar-atlas .nav-link.active {
    background: rgba(196, 106, 40, 0.1);
  }

  .navbar-atlas .nav-link.active::after {
    display: none;
  }

  .nav-actions {
    margin-top: 0.85rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--border);
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-actions .btn-reserve {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (max-width: 991.98px) {
  :root {
    --nav-height: 72px;
  }

  /* Chef: stack image on top, text below */
  .chef-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .chef-image {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .chef-image img {
    position: absolute;
  }

  .chef-content {
    padding: 2.75rem 1.75rem;
    text-align: center;
    align-items: center;
  }

  .chef-content p {
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item.tall {
    grid-row: span 1;
    aspect-ratio: 1;
  }

  .about-image-accent {
    display: none;
  }

  .about-image-wrap img {
    min-height: 280px;
  }

  .map-wrap,
  .map-wrap iframe {
    min-height: 280px;
  }

  .reservation-wrap .row > [class*="col-"] {
    width: 100%;
    max-width: 100%;
  }

  .menu-category-title {
    font-size: 1.65rem;
    margin-top: 2.25rem;
  }

  .footer-about {
    max-width: 100%;
  }
}

/* ---------- Phones / small tablets ---------- */
@media (max-width: 767.98px) {
  :root {
    --nav-height: 68px;
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .section {
    padding: 3rem 0;
  }

  .brand-logo {
    max-height: 50px;
  }

  .navbar-atlas {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .navbar-atlas.scrolled {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .navbar-atlas.scrolled .brand-logo {
    max-height: 42px;
  }

  /* Hero */
  .hero {
    min-height: 100svh;
    min-height: 100dvh;
  }

  .hero-content {
    padding: calc(var(--nav-height) + 1.25rem) 1rem 3.25rem;
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 8.5vw, 2.45rem);
    word-wrap: break-word;
  }

  .hero .lead {
    font-size: 0.98rem;
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .scroll-indicator {
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  /* Sections */
  .section-header {
    margin-bottom: 2rem;
    padding: 0 0.25rem;
  }

  .section-header h2 {
    font-size: clamp(1.7rem, 7vw, 2.25rem);
  }

  .section-header p {
    font-size: 0.98rem;
  }

  /* About / counters */
  .counters {
    gap: 0.65rem;
    margin-top: 1.75rem;
  }

  .counter-card {
    padding: 0.95rem 0.65rem;
  }

  .counter-card .count {
    font-size: 1.55rem;
  }

  .counter-card .label {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  /* Menu */
  .menu-card-body {
    padding: 1rem;
  }

  .menu-card-body h3 {
    font-size: 1.15rem;
  }

  .menu-card-body p {
    font-size: 0.88rem;
  }

  .menu-price {
    font-size: 1.2rem;
  }

  .menu-card-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .menu-category-title {
    font-size: 1.4rem;
    margin: 2rem 0 1.15rem;
    flex-wrap: wrap;
  }

  /* Chef */
  .chef-image {
    aspect-ratio: 4 / 3;
  }

  .chef-content {
    padding: 2rem 1.15rem 2.35rem;
  }

  .chef-content h2 {
    font-size: clamp(1.65rem, 7vw, 2.15rem);
  }

  .chef-content .dish-name {
    font-size: 1.15rem;
  }

  /* Forms / reservation / contact */
  .reservation-form {
    padding: 1.35rem 1rem;
  }

  .reservation-side {
    padding: 1.5rem 1.15rem;
    min-height: 180px;
  }

  .reservation-side h3 {
    font-size: 1.55rem;
  }

  .form-control,
  .form-select {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 0.7rem 0.9rem;
  }

  .btn-lg {
    width: 100%;
    padding: 0.8rem 1.25rem;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  /* Page heroes */
  .page-hero {
    min-height: 32vh;
    padding: calc(var(--nav-height) + 1.75rem) 0 2rem;
  }

  .page-hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .page-hero p {
    font-size: 0.95rem;
  }

  /* Testimonials */
  .testimonial-card {
    padding: 1.6rem 1rem;
  }

  .testimonial-text {
    font-size: 1.05rem;
  }

  .swiper-testimonials .swiper-button-next,
  .swiper-testimonials .swiper-button-prev {
    display: none;
  }

  /* Contact */
  .contact-card {
    padding: 1.15rem;
  }

  .map-wrap,
  .map-wrap iframe {
    min-height: 240px;
  }

  /* Footer */
  .footer-top {
    padding: 2.75rem 0 2rem;
  }

  .footer-logo {
    max-height: 58px;
  }

  .footer-bottom {
    text-align: center;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  .footer-bottom .container {
    gap: 0.35rem;
  }

  .back-to-top {
    right: max(0.85rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
  }

  body.is-rtl .back-to-top {
    right: auto;
    left: max(0.85rem, env(safe-area-inset-left));
  }
}

/* ---------- Small phones ---------- */
@media (max-width: 575.98px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .menu-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .filter-btn {
    flex-shrink: 0;
    font-size: 0.82rem;
    padding: 0.4rem 0.9rem;
  }

  .brand-logo {
    max-height: 44px;
  }

  .btn-reserve {
    font-size: 0.8rem;
    padding: 0.5rem 0.9rem;
  }

  .chef-image {
    aspect-ratio: 1 / 1;
  }

  .counters {
    grid-template-columns: 1fr 1fr;
  }

  .newsletter-form .input-group {
    flex-direction: column;
  }

  .newsletter-form .form-control,
  .newsletter-form .btn {
    width: 100%;
    border-radius: 0.75rem !important;
  }

  .newsletter-form .btn {
    margin-top: 0.5rem;
  }

  .social-links a {
    width: 38px;
    height: 38px;
  }

  .hero-brand {
    max-width: min(200px, 62vw);
  }

  .page-hero {
    min-height: 28vh;
  }
}

/* ---------- Very small screens ---------- */
@media (max-width: 379.98px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .btn {
    padding: 0.65rem 1.15rem;
    font-size: 0.9rem;
  }

  .counter-card .count {
    font-size: 1.35rem;
  }

  .counter-card .label {
    font-size: 0.72rem;
  }
}

/* ---------- Landscape phones ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 4rem 0 3rem;
  }

  .hero-content {
    padding-top: calc(var(--nav-height) + 0.75rem);
    padding-bottom: 2rem;
  }

  .scroll-indicator {
    display: none;
  }

  .page-hero {
    min-height: 48vh;
  }

  .chef-image {
    aspect-ratio: 21 / 9;
  }
}

/* ---------- Prefer reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .menu-card:hover,
  .contact-card:hover,
  .counter-card:hover,
  .gallery-item:hover img,
  .menu-card:hover .menu-card-img img {
    transform: none;
  }
}

/* Hide swiper arrows on small screens (they cause sideways overflow) */
.swiper-testimonials .swiper-button-next,
.swiper-testimonials .swiper-button-prev {
  display: none;
}

@media (min-width: 768px) {
  .swiper-testimonials .swiper-button-next,
  .swiper-testimonials .swiper-button-prev {
    display: flex;
  }
}

/* Hard lock: never allow page-level horizontal scroll */
html,
body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

/* ---------- Print ---------- */
@media print {
  .site-loader,
  .navbar-atlas,
  .back-to-top,
  .scroll-indicator,
  .nav-actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .hero,
  .page-hero,
  .chef-section {
    min-height: auto;
    color: #000;
  }

  a[href]::after {
    content: none !important;
  }
}
