/* ==========================================================================
   Phones Arcade — Mobile / Responsive polish
   Loaded LAST so it overrides page-level inline styles.
   ========================================================================== */

/* Never allow sideways scrolling on small screens */
html,
body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
}

/* ---------- Tablets & below ---------- */
@media (max-width: 1024px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ---------- Phones ---------- */
@media (max-width: 768px) {
  /* Top info bar: tighter, readable, no overflow */
  .header-top {
    font-size: 0.72rem;
    padding: 0.4rem 0;
  }

  .header-top .container > .flex {
    gap: 0.5rem;
  }

  .header-top .flex .gap-3 {
    gap: 0.6rem;
  }

  /* Header becomes a two-row layout:
     row 1 = logo + cart + menu, row 2 = full-width search */
  .header-main {
    padding: 0.6rem 0 !important;
  }

  .header-main .container > .flex {
    flex-wrap: wrap;
    row-gap: 0.6rem;
    column-gap: 0.5rem;
  }

  .site-logo-link {
    margin-right: auto;
  }

  .search-container {
    order: 5;
    flex: 1 1 100%;
    max-width: 100%;
  }

  .search-input {
    padding: 0.75rem 3.25rem 0.75rem 1rem;
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }

  /* Comfortable tap targets */
  .icon-btn {
    padding: 0.6rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Logo: compact but clearly visible */
  .site-logo {
    height: 58px !important;
    max-width: min(220px, 58vw) !important;
  }

  /* Section spacing */
  .footer {
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
  }

  .footer-grid {
    gap: 2rem;
    margin-bottom: 2rem;
  }

  /* Product cards: two neat columns */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }
}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .header-top {
    font-size: 0.68rem;
  }

  /* Only keep the essentials in the top bar so it never wraps ugly */
  .header-top .flex.items-center.justify-between > .flex:last-child {
    display: none;
  }

  .header-top .flex.items-center.justify-between {
    justify-content: center;
  }

  .site-logo {
    height: 52px !important;
    max-width: min(190px, 56vw) !important;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.7rem !important;
  }

  .product-image-container {
    height: 160px !important;
    padding: 0.75rem !important;
  }

  .product-info {
    padding: 0.75rem !important;
  }

  .product-name {
    font-size: 0.85rem !important;
  }

  .product-price {
    font-size: 1.05rem !important;
  }

  .section-title {
    font-size: 1.3rem !important;
  }

  /* Footer centered & airy on tiny screens */
  .footer-section {
    text-align: center;
  }

  .footer-links a {
    justify-content: center;
  }

  .site-logo--footer {
    margin-left: auto;
    margin-right: auto;
  }

  /* Toast spans width cleanly */
  .toast {
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.85rem;
  }
}
