/* ==========================================================================
   THE MANOR HOUSE - COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   Full cross-device responsiveness: 320px, 360px, 375px, 390px, 414px, 768px, 1024px, 1440px, 1920px+
   ========================================================================== */

/* Global Overflow & Sizing Guard */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* ==========================================================================
   1. Large Screens & 4K Displays (min-width: 1441px)
   ========================================================================== */
@media (min-width: 1441px) {
  .container {
    max-width: 1380px;
  }
  
  .menu-items-grid {
    gap: 32px 48px;
  }

  .menu-item-card {
    padding: 30px;
  }

  .item-name {
    font-size: 1.45rem;
  }

  .item-price {
    font-size: 1.55rem;
  }
}

/* ==========================================================================
   2. Standard Desktop & Laptops (1025px - 1440px)
   ========================================================================== */
@media (max-width: 1200px) {
  .menu-items-grid {
    gap: 24px 30px;
  }

  .footer-top-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 32px;
  }
}

/* ==========================================================================
   3. Tablet & iPad Landscape (769px - 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --header-height: 74px;
  }

  .desktop-nav {
    display: none;
  }

  .hamburger-toggle {
    display: flex;
  }

  .header-actions {
    gap: 10px;
  }

  .header-cta-btn {
    padding: 8px 14px;
    font-size: 0.74rem;
  }

  .menu-items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 24px;
  }

  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }

  .policies-card-container {
    padding: 32px 24px;
  }
}

/* ==========================================================================
   4. Tablet Portrait & Large Phones (577px - 768px)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 68px;
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .menu-hero {
    min-height: auto;
    padding: calc(var(--header-height) + 30px) 0 45px;
  }

  .hero-title {
    font-size: clamp(2.2rem, 7vw, 3.2rem);
    letter-spacing: 0.06em;
  }

  .hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: 20px;
  }

  .hero-timings-pills {
    gap: 8px;
  }

  .timing-pill {
    padding: 6px 14px;
    font-size: 0.78rem;
  }

  /* Single Column Editorial Menu */
  .menu-items-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .menu-item-card {
    padding: 22px 20px;
  }

  .item-name {
    font-size: 1.25rem;
  }

  .item-price {
    font-size: 1.3rem;
  }

  .sticky-category-nav {
    top: var(--header-height);
  }

  .site-header.scrolled + .menu-hero + .sticky-category-nav,
  body.has-scrolled .sticky-category-nav {
    top: 68px;
  }

  .category-section {
    scroll-margin-top: 135px;
    margin-bottom: 55px;
  }

  .category-header-banner {
    padding: 24px 18px 20px;
    margin-bottom: 24px;
  }

  .category-main-title {
    font-size: 2rem;
  }

  .quick-guide-trigger {
    display: none;
  }

  .icon-guide-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .floating-tray-bar {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .floating-tray-btn {
    width: 100%;
    justify-content: space-between;
    padding: 13px 20px;
  }
}

/* ==========================================================================
   5. Standard Mobile (376px - 576px)
   ========================================================================== */
@media (max-width: 576px) {
  :root {
    --header-height: 64px;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Header Controls */
  .site-header.scrolled {
    height: 64px;
  }

  .header-brand-logo {
    height: 38px;
    max-width: 130px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-tray-btn {
    width: 36px;
    height: 36px;
  }

  .header-tray-btn svg {
    width: 16px;
    height: 16px;
  }

  .header-cta-btn {
    padding: 7px 11px;
    font-size: 0.72rem;
  }

  .header-cta-btn .cta-text-full {
    display: none;
  }

  .header-cta-btn .cta-text-short {
    display: inline;
  }

  .hamburger-toggle {
    width: 36px;
    height: 36px;
  }

  /* Hero Section */
  .menu-hero {
    padding: calc(var(--header-height) + 20px) 0 36px;
  }

  .hero-top-badge {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    padding: 4px 14px;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 2.75rem);
    letter-spacing: 0.05em;
    word-break: break-word;
  }

  .hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 16px;
  }

  .service-status-banner {
    font-size: 0.76rem;
    padding: 6px 14px;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    margin-bottom: 20px;
  }

  .hero-timings-pills {
    flex-direction: column;
    width: 100%;
    gap: 6px;
    margin-bottom: 22px;
  }

  .timing-pill {
    width: 100%;
    justify-content: center;
    font-size: 0.74rem;
    padding: 6px 10px;
    box-sizing: border-box;
  }

  /* Search & Filter Chips */
  .search-input-box {
    width: 100%;
  }

  .search-input {
    width: 100%;
    font-size: 0.86rem;
    padding: 12px 18px 12px 42px;
    box-sizing: border-box;
  }

  .filter-chips-wrap {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px;
    justify-content: flex-start;
    scrollbar-width: none;
    gap: 6px;
  }

  .filter-chips-wrap::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 13px;
    font-size: 0.74rem;
  }

  /* Category Sticky Bar */
  .sticky-category-nav {
    top: var(--header-height);
  }

  .site-header.scrolled + .menu-hero + .sticky-category-nav,
  body.has-scrolled .sticky-category-nav {
    top: 64px;
  }

  .category-nav-inner {
    padding: 6px 0;
  }

  .category-tabs-list {
    width: 100%;
    padding: 2px;
    gap: 6px;
  }

  .category-tab-btn {
    padding: 6px 13px;
    font-size: 0.76rem;
    flex-shrink: 0;
  }

  /* Category Header Banner */
  .category-section {
    scroll-margin-top: 120px;
    margin-bottom: 45px;
  }

  .category-header-banner {
    padding: 20px 14px 16px;
    margin-bottom: 20px;
  }

  .category-timing-pill {
    font-size: 0.72rem;
    padding: 3px 12px;
  }

  .category-main-title {
    font-size: 1.7rem;
    letter-spacing: 0.06em;
  }

  .category-banner-subtitle {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  /* Menu Items */
  .menu-items-grid {
    gap: 16px;
  }

  .menu-item-card {
    padding: 18px 16px;
  }

  .item-badge-ribbon {
    position: static;
    display: inline-flex;
    margin-bottom: 8px;
    font-size: 0.65rem;
    padding: 2px 9px;
  }

  .item-top-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .item-name-group {
    flex: 1 1 auto;
    max-width: calc(100% - 68px);
  }

  .item-name {
    font-size: 1.15rem;
    line-height: 1.3;
    word-break: break-word;
  }

  .item-dots-leader {
    display: none;
  }

  .item-price {
    font-size: 1.25rem;
    align-self: flex-start;
  }

  .item-description {
    font-size: 0.84rem;
    line-height: 1.5;
    margin-bottom: 10px;
  }

  .dietary-icon-pill {
    font-size: 0.68rem;
    padding: 2px 7px;
  }

  .item-variants-box {
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .variant-choice-btn {
    font-size: 0.74rem;
    padding: 4px 10px;
    min-height: 32px;
  }

  .item-card-bottom {
    width: 100%;
    padding-top: 10px;
  }

  .item-action-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.76rem;
    min-height: 44px;
  }

  .item-qty-control {
    width: 100%;
    justify-content: space-between;
    padding: 4px 12px;
    min-height: 44px;
  }

  .qty-btn {
    width: 32px;
    height: 32px;
  }

  /* Subgroup Header */
  .subgroup-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 0 6px;
  }

  .subgroup-title {
    font-size: 1.25rem;
  }

  .subgroup-line {
    width: 100%;
  }

  /* Icon Guide & Policies */
  .icon-guide-section {
    padding: 50px 0;
  }

  .icon-guide-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .icon-guide-card {
    padding: 12px 14px;
  }

  .dining-policies-section {
    padding: 50px 0;
  }

  .policies-card-container {
    padding: 22px 16px;
  }

  .policies-title {
    font-size: 1.35rem;
  }

  .policy-item {
    font-size: 0.82rem;
    gap: 10px;
  }

  /* Footer */
  .site-footer {
    padding: 50px 0 24px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-logo {
    height: 48px;
    max-width: 160px;
  }

  .footer-col-title {
    font-size: 1.18rem;
    margin-bottom: 12px;
  }

  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    font-size: 0.74rem;
  }

  /* Floating Tray Bar */
  .floating-tray-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .floating-tray-btn {
    width: 100%;
    padding: 12px 16px;
    justify-content: space-between;
    font-size: 0.8rem;
    min-height: 48px;
  }

  .tray-drawer {
    width: 100vw;
  }

  .tray-drawer-header,
  .tray-drawer-body,
  .tray-drawer-footer {
    padding: 16px 18px;
  }
}

/* ==========================================================================
   6. Small Mobile Screens (320px - 375px)
   ========================================================================== */
@media (max-width: 375px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .header-brand-logo {
    height: 34px;
    max-width: 110px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-tray-btn {
    width: 34px;
    height: 34px;
  }

  .header-cta-btn {
    padding: 7px 9px;
  }

  .header-cta-btn .cta-text-short {
    display: none; /* Icon only for perfect fit on 320px */
  }

  .hamburger-toggle {
    width: 34px;
    height: 34px;
  }

  .hero-title {
    font-size: 1.85rem;
    letter-spacing: 0.03em;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .category-tab-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .category-main-title {
    font-size: 1.5rem;
  }

  .item-name {
    font-size: 1.08rem;
  }

  .item-price {
    font-size: 1.18rem;
  }

  .variant-choice-btn {
    width: 100%;
    justify-content: center;
  }

  .policies-title {
    font-size: 1.25rem;
  }
}
