/* ==========================================================================
   Delightpk — responsive.css
   Phone (320+) · Large phone · Tablet · Laptop · Desktop · Ultra-wide
   Har page ke <body data-page="..."> se scope hota hai, is liye kisi dusre page
   ka layout kharab nahi hota. Ye file sab styles ke BAAD load hoti hai.
   ========================================================================== */

/* ---------- Global safety (har device) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, video, canvas { max-width: 100%; }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--primary, #f76707); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Bahut chhoti screens (≤ 360px) ---------- */
@media (max-width: 360px) {
  body[data-page="home"] .container,
  body[data-page="results"] .container { gap: 8px; padding-left: 8px; padding-right: 8px; }
  .bar a span { font-size: 9px; }
}

/* ==========================================================================
   HOME (index) + CATEGORY RESULTS — product grid
   ========================================================================== */
@media (min-width: 600px) {
  body[data-page="home"] .container,
  body[data-page="results"] .container,
  body[data-page="home"] .skeleton-container,
  body[data-page="results"] .skeleton-container {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px; padding: 8px 20px 24px; max-width: 1400px; margin: 0 auto;
  }
  body[data-page="home"] .item-card .card-img-wrap,
  body[data-page="results"] .item-card .card-img-wrap { height: auto; aspect-ratio: 1 / 1; }
  body[data-page="home"] .item-card .card-img-wrap img,
  body[data-page="results"] .item-card .card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
  body[data-page="home"] .section-block { width: calc(100% - 40px); max-width: 1360px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
  body[data-page="home"] .products-section-header { max-width: 1400px; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; box-sizing: border-box; }
}
@media (min-width: 768px) {
  body[data-page="home"] header,
  body[data-page="results"] header { padding: 0 24px; }
  body[data-page="home"] header h1 {
    width: auto; max-width: 320px; overflow: visible; font-size: 20px;
    -webkit-mask-image: none; mask-image: none;
  }
  body[data-page="home"] .store-marquee { animation: none; }
  body[data-page="home"] .store-marquee .mq-b,
  body[data-page="home"] .store-marquee .mq-dot { display: none; }
  body[data-page="home"] .search-wrap { max-width: 480px; flex: 1 1 auto; }
}
@media (min-width: 1100px) {
  body[data-page="home"] header,
  body[data-page="results"] header { padding-left: max(32px, calc((100vw - 1400px) / 2 + 20px)); padding-right: max(32px, calc((100vw - 1400px) / 2 + 20px)); }
}

/* Bottom nav: bade screens par bhi compact aur center */
.bar { max-width: 440px; }

/* ==========================================================================
   CATEGORIES
   ========================================================================== */
@media (min-width: 700px) {
  body[data-page="categories"] { background-attachment: fixed; }
  body[data-page="categories"] .main-header { left: 50%; right: auto; transform: translateX(-50%); width: 100%; max-width: 760px; }
  body[data-page="categories"] .sidebar { left: calc(50% - 380px); }
  body[data-page="categories"] .content { margin-left: auto; margin-right: auto; max-width: 760px; padding-left: 112px; box-sizing: border-box; }
}

/* ==========================================================================
   CART
   ========================================================================== */
body[data-page="cart"] .cart-scroll-wrapper { max-width: 760px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* ==========================================================================
   PROFILE / SETTINGS / HELP / MY ORDERS / LEGAL
   ========================================================================== */
body[data-page="profile"] > h2,
body[data-page="profile"] > .btn,
body[data-page="profile"] > #authButtons { max-width: 560px; margin-left: auto; margin-right: auto; }
body[data-page="settings"] .container,
body[data-page="help"] .container,
body[data-page="myorders"] .container { max-width: 640px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
body[data-page="help"] .small-text { max-width: 640px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
body[data-page="legal"] > h3,
body[data-page="legal"] > p { max-width: 820px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
@media (min-width: 768px) {
  body[data-page="legal"] > h3,
  body[data-page="legal"] > p { padding-left: 0; padding-right: 0; }
}

/* ==========================================================================
   ITEM DETAILS
   ========================================================================== */
@media (min-width: 768px) {
  body[data-page="item"] .item-details { max-width: 760px; margin: 0 auto; box-sizing: border-box; }
  body[data-page="item"] #supplier-container,
  body[data-page="item"] .similar-heading,
  body[data-page="item"] #itemContainer { max-width: 1200px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
}

/* ==========================================================================
   LOGIN / SIGNUP
   ========================================================================== */
@media (min-width: 600px) {
  body[data-page="auth"] { max-width: 520px; margin: 32px auto; }
}

/* ==========================================================================
   ORDER pages / CHAT / THANKS
   ========================================================================== */
body[data-page="order"] .wrap { margin-left: auto; margin-right: auto; }
@media (min-width: 700px) {
  body[data-page="order"] .wrap { max-width: 640px; }
  body[data-page="chat"] .chat-header,
  body[data-page="chat"] .chat-messages { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; }
  body[data-page="chat"] .chat-input-area { max-width: 760px; }
}
body[data-page="thanks"] .thank-you-card { margin-left: auto; margin-right: auto; max-width: min(440px, 92vw); }

/* ==========================================================================
   Landscape phones — navigation + header chhote
   ========================================================================== */
@media (max-height: 480px) and (orientation: landscape) {
  .bar { transform: scale(.9); transform-origin: center bottom; }
}
