/* Breakpoints for sections and overlays (1024 / 640 / 390 px) */
@media (max-width: 1024px) {
  section {
    padding: 80px 40px;
  }

  nav {
    padding: 16px 30px;
  }

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

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

  .step::after {
    display: none;
  }

  #about {
    grid-template-columns: 1fr;
  }

  .about-imgs {
    height: 600px;
    overflow: hidden;
  }

  .fan-card {
    width: 220px !important;
    height: 220px !important;
    transform: none !important;
    transform-origin: unset !important;
  }

  .fan-card:nth-child(1) {
    top: 0 !important;
    left: 0 !important;
    transform: rotate(-8deg) !important;
  }

  .fan-card:nth-child(2) {
    top: 0 !important;
    left: 200px !important;
    transform: rotate(8deg) !important;
  }

  .fan-card:nth-child(3) {
    top: 240px !important;
    left: 90px !important;
    transform: rotate(3deg) !important;
  }

  .fan-dot {
    top: 220px !important;
    left: 196px !important;
    width: 58px !important;
    height: 58px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .catering-grid,
  .chef-menu-grid,
  .catering-form-grid,
  .menu-select-grid {
    grid-template-columns: 1fr 1fr;
  }

  .overlay-content {
    padding: 40px;
  }

  .reviews-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  nav ul {
    display: none;
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  .btn-pay {
    padding: 20px;
    font-size: 0.9rem;
    min-height: 56px;
  }

  .hero-btns {
    flex-direction: column;
    align-items: center;
  }

  footer {
    padding: 40px 24px 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
  }

  .overlay-header {
    padding: 16px 20px;
  }

  .overlay-content {
    padding: 16px 16px 40px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .catering-grid,
  .chef-menu-grid,
  .catering-form-grid,
  .menu-select-grid {
    grid-template-columns: 1fr;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .gallery-strip img,
  .gallery-strip video {
    height: 160px;
  }

  #gallery section,
  .gallery-rows {
    padding: 0;
  }

  body {
    -webkit-overflow-scrolling: touch;
  }

  nav {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    background: rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  nav.scrolled {
    background: rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
  }

  .about-imgs {
    height: auto !important;
    overflow: hidden !important;
    padding-bottom: 20px;
  }

  .photo-fan {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: static !important;
  }

  .fan-card {
    position: static !important;
    width: 85vw !important;
    height: 85vw !important;
    max-width: 320px !important;
    max-height: 320px !important;
    transform: none !important;
    transform-origin: unset !important;
  }

  .fan-card:nth-child(1) {
    transform: rotate(-3deg) !important;
  }

  .fan-card:nth-child(2) {
    transform: rotate(3deg) !important;
  }

  .fan-card:nth-child(3) {
    transform: rotate(-2deg) !important;
  }

  .fan-dot {
    position: static !important;
    margin: 8px auto;
    width: 64px !important;
    height: 64px !important;
  }

  #about {
    padding: 60px 24px;
  }

  section {
    padding: 60px 24px;
  }

  .hero-title {
    font-size: clamp(2.2rem, 10vw, 4rem);
  }

  .logo-img-link img {
    height: 60px !important;
  }

  .cart-layout {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .cart-panel {
    position: static !important;
    width: 100%;
    box-sizing: border-box;
    padding: 24px 20px;
  }

  #cart-page .form-section div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column;
    gap: 0;
  }

  .receipt-table {
    table-layout: fixed;
    width: 100%;
  }

  .receipt-table td {
    font-size: 0.8rem;
    word-break: break-word;
  }

  #tutaPopup {
    align-items: flex-end;
    justify-content: center;
  }

  #tutaWrap {
    padding: 0 0 0 0;
    align-items: center;
    width: 100%;
    max-width: 100vw;
  }

  #tutaBubble {
    max-width: calc(100vw - 32px);
    width: 100%;
    padding: 16px 18px;
    box-sizing: border-box;
  }

  #tutaBubble::before {
    right: 50%;
    transform: translateX(50%);
  }

  #tutaBubble::after {
    right: 50%;
    transform: translateX(50%);
  }

  #tutaImg {
    width: 120px;
    margin-right: 0;
  }
}

@media (max-width: 390px) {
  .overlay-content {
    padding: 12px 12px 40px;
  }

  .overlay-header {
    padding: 12px 14px;
  }

  .cart-panel {
    padding: 18px 12px;
  }

  .fg input,
  .fg select,
  .fg textarea {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .btn-pay {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    padding: 16px;
  }

  #tutaBubble {
    padding: 14px 14px;
  }

  #tutaImg {
    width: 100px;
  }
}