/**
 * @file responsive.css
 * @description قواعد التجاوب الشامل وتجربة الموبايل (Mobile-First & Responsive Breakpoints)
 * مستهدف لشاشات الهواتف في مصر (360x800, 390x844, 414x896) والتابلت والديسكتوب
 */

/* === شاشات اللابتوب الصغير والتابلت الأفقي (أقل من 1024px) === */
@media (max-width: 1024px) {
  .main-nav,
  .desktop-navigation {
    display: none !important;
  }

  .mobile-menu-btn,
  .btn-mobile-toggle {
    display: flex !important;
  }

  .hero-grid,
  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--space-8, 2rem);
    text-align: center;
  }

  .hero-subtitle,
  .hero-description {
    margin-inline: auto;
  }

  .hero-cta-group,
  .hero-actions-group {
    justify-content: center;
  }

  .hero-quick-stats,
  .hero-stats-row {
    justify-content: center;
  }

  .hero-visual-card,
  .hero-media-wrapper {
    max-width: 460px;
    margin-inline: auto;
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4, 1rem);
  }

  .offers-grid,
  .featured-offers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .categories-showcase-grid,
  .quick-categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .menu-grid,
  .menu-items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .story-grid,
  .about-grid,
  .branches-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .story-content .section-title,
  .about-content .section-title {
    text-align: center;
  }

  .story-content,
  .about-content {
    text-align: center;
  }

  .about-features-list {
    text-align: start;
  }

  .footer-grid,
  .footer-content-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* === شاشات التابلت والهواتف الكبيرة (أقل من 768px) === */
@media (max-width: 768px) {
  :root {
    --header-height: 68px;
  }

  .section-padding {
    padding-block: var(--space-12, 3rem);
  }

  .top-announcement-inner,
  .top-bar-content {
    justify-content: center;
    text-align: center;
  }

  .top-announcement-links,
  .top-bar-end {
    display: none;
  }

  .hotline-pill span.hotline-label,
  .btn-hotline-header {
    display: none;
  }

  .cart-total-preview {
    display: none;
  }

  /* تحويل عروض اليوم إلى كاروسيل أفقي سهل السحب بالإبهام */
  .offers-grid,
  .featured-offers-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.25rem;
    padding-bottom: 1rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .offers-grid::-webkit-scrollbar,
  .featured-offers-grid::-webkit-scrollbar {
    display: none;
  }

  .offer-card {
    flex: 0 0 85%;
    min-width: 280px;
    scroll-snap-align: center;
  }

  .categories-showcase-grid,
  .quick-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

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

  .lightbox-nav,
  .lightbox-nav-btn {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .lightbox-prev,
  .lightbox-nav-btn.prev {
    inset-inline-start: 10px;
  }

  .lightbox-next,
  .lightbox-nav-btn.next {
    inset-inline-end: 10px;
  }

  /* رفع أزرار العائم عند ظهور شريط السلة السفلي للموبايل */
  .whatsapp-fab,
  .whatsapp-fab-button {
    bottom: 85px !important;
  }

  body.has-cart-items .site-footer {
    padding-bottom: 6.5rem;
  }
}

/* === شاشات الهواتف الذكية القياسية والصغيرة (أقل من 540px) === */
@media (max-width: 540px) {
  .brand-logo-img {
    width: 44px;
    height: 44px;
  }

  .logo-mark,
  .brand-title {
    font-size: 1.15rem;
  }

  .hero-section {
    padding-block: var(--space-8, 2rem);
    min-height: auto;
  }

  .hero-cta-group,
  .hero-actions-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn,
  .hero-actions-group .btn-primary-royal,
  .hero-actions-group .btn-secondary-royal {
    width: 100%;
  }

  .hero-floating-card.top-left {
    top: 10px;
    inset-inline-start: 10px;
    padding: 0.5rem 0.85rem;
  }

  .hero-floating-card.bottom-right {
    bottom: 10px;
    inset-inline-end: 10px;
    padding: 0.5rem 0.85rem;
  }

  .hero-featured-image {
    height: 320px;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .categories-showcase-grid,
  .quick-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .menu-grid,
  .menu-items-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .bestsellers-carousel .menu-card,
  .best-sellers-carousel-track .best-seller-card {
    flex: 0 0 85%;
    min-width: 260px;
  }

  .story-pillars,
  .about-detailed-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid,
  .footer-content-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  /* نافذة تخصيص الوجبة تأخذ شكل Bottom Sheet على الموبايل */
  .modal-dialog-content {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    margin-top: auto;
  }

  .product-customizer-modal {
    align-items: flex-end;
    padding: 0;
  }

  .whatsapp-fab,
  .whatsapp-fab-button {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    bottom: 85px;
    inset-inline-start: 14px;
  }

  .fab-tooltip {
    display: none;
  }
}

/* إخفاء شريط السلة السفلي على الشاشات الكبيرة لأن زر السلة في الهيدر ظاهر بوضوح */
@media (min-width: 769px) {
  .mobile-cart-bar,
  .mobile-sticky-cart-bar {
    display: none !important;
  }
}
