/* ═══════════════════════════════════════════════════════════════════════
   HOREKA — APP POLISH LAYER
   Purely ADDITIVE native-app feel. Adds behavior only; does not restyle
   colours, spacing, sizes or layout of any existing component.
   Loaded last so it wins only on the specific properties it touches.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Stop iOS Safari auto-zoom when focusing a field ──────────────────
   iOS ignores user-scalable=0 and zooms whenever a focused input's font is
   under 16px. Input BOX heights in this theme are set explicitly, so raising
   only the text to 16px changes no layout — it just kills the zoom. Scoped
   to touch widths; desktop typography untouched. Checkboxes/radios excluded. */
@media (max-width: 1024px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ── 2. No grey/blue tap flash on interactive elements ───────────────────
   The single biggest "this is a web page" tell on touch. */
a, button, [role="button"], input, select, textarea, label,
.button, .hk-search-btn, .hk-location-btn {
    -webkit-tap-highlight-color: transparent;
}

/* ── 3. No long-press callout / accidental text-selection on CHROME only ──
   Applied to buttons & nav only — body copy, prices and product text stay
   fully selectable/copyable. */
button, [role="button"], .button,
input[type="submit"], input[type="button"],
nav a, .hk-search-btn, .hk-location-btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ── 4. Kill page rubber-band + pull-to-refresh reloads ──────────────────
   overscroll-behavior on the page stops the whole-page bounce/refresh;
   `contain` on overlays stops scroll-chaining to the page behind them. */
html, body {
    overscroll-behavior-y: none;
}
[class*="drawer"], [class*="modal"], [class*="popup"],
[class*="offcanvas"], .cart-drawer, .hk-drawer {
    overscroll-behavior: contain;
}

/* ── 5. Momentum scrolling on nested scrollers (older iOS) ───────────────*/
html, body, [class*="drawer"], [class*="modal"], .hk-scroll {
    -webkit-overflow-scrolling: touch;
}

/* ── 6. Prevent iOS silently inflating text on rotate ────────────────────*/
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ── 7. Instant tap feedback on buttons (apps respond in <100ms) ─────────
   Only fires DURING an active press, so it never alters resting appearance. */
button:active, [role="button"]:active, .button:active,
input[type="submit"]:active, .hk-search-btn:active, .hk-location-btn:active {
    opacity: .65;
    transition: opacity .05s ease;
}

/* ── 8. Safe-area handling — ONLY when launched as an installed app ───────
   Normal in-browser browsing is 100% unchanged. Once a manifest is added
   (Tier 2) and the site is opened from the home screen, sticky/fixed bars
   clear the notch and home indicator instead of hiding beneath them. */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
    .hk-checkout-bar, .sticky-bottom-bar,
    [class*="sticky"][class*="bottom"], .swipe-place-order {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}
