/* ==========================================================================
   Zarna Jewels — app-style shell for phones and small tablets (Oct 2026)
   Loaded with media="(max-width: 991.98px)": nothing here touches the desktop.
   - fixed bottom tab bar (.za-bar): Home · Shop · Design · Bag · Account (includes/front/app-bar.blade.php)
   - compact top bar: back arrow on inner pages, bag and account moved to the tab bar
   - the fixed bars of the product page, the ring builder, the WhatsApp button and the cookie notice sit above it
   - tap feedback, page fade-in, "add to home screen" card, full-screen (standalone) tweaks
   ========================================================================== */
:root {
    --za-bar-h: 62px;
    --za-bar: calc(var(--za-bar-h) + env(safe-area-inset-bottom, 0px));
    --za-emerald: #1f3d33;
    --za-gold: #b08d57;
    --za-ivory: #fbf7ee;
    --za-ink: #1b1a17;
    --za-muted: #767065;
    --za-line: rgba(27, 26, 23, 0.1);
    --za-sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
}

/* room for the bar at the end of every page that has one */
html.za-has-bar body { padding-bottom: var(--za-bar); }

/* ---------- bottom tab bar ---------- */
.za-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
    height: var(--za-bar); padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: rgba(251, 247, 238, 0.94); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--za-line); box-shadow: 0 -8px 30px -18px rgba(0, 0, 0, 0.35);
    font-family: var(--za-sans); transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.za-bar__item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-width: 0; padding: 6px 2px 5px; border: 0; background: none; color: var(--za-muted) !important; text-decoration: none !important;
    font: 500 10.5px/1.1 var(--za-sans); letter-spacing: 0.01em; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: color 0.2s, transform 0.15s;
}
.za-bar__item svg { width: 24px; height: 24px; flex: none; }
.za-bar__item span:last-child { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.za-bar__item:active { transform: scale(0.92); }
.za-bar__item.is-on { color: var(--za-emerald) !important; font-weight: 600; }
.za-bar__item.is-on::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 0 0 3px 3px; background: var(--za-gold); }
.za-bar__count {
    position: absolute; top: 3px; left: calc(50% + 4px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--za-gold); color: #fff; font: 700 10px/17px var(--za-sans); text-align: center;
}
/* the ring builder: a raised round button in the middle, like a camera button */
.za-bar__item--accent .za-bar__gem {
    display: grid; place-items: center; width: 46px; height: 46px; margin-top: -18px; border-radius: 50%;
    background: linear-gradient(145deg, #2d5a4a, var(--za-emerald)); color: #fbf7ee; box-shadow: 0 8px 20px -6px rgba(31, 61, 51, 0.6), 0 0 0 4px var(--za-ivory);
}
.za-bar__item--accent .za-bar__gem svg { width: 24px; height: 24px; }
.za-bar__item--accent.is-on .za-bar__gem { background: linear-gradient(145deg, #c9a24a, var(--za-gold)); }
.za-bar__item--accent.is-on::before { display: none; }

html.za-bar-hidden .za-bar { transform: translateY(110%); }
html.za-typing .za-bar { display: none; }
html.za-typing body { padding-bottom: 0; }

/* ---------- things that sit on the bottom edge move up above the bar ---------- */
html.za-has-bar .zd-buybar,
html.za-has-bar .zr-mobilebar { bottom: var(--za-bar); padding-bottom: 10px; z-index: 1034; transition: bottom 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1); }
/* while the tab bar is tucked away (scrolling down) the price bars take its place at the bottom edge */
html.za-has-bar.za-bar-hidden .zd-buybar,
html.za-has-bar.za-bar-hidden .zr-mobilebar { bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
html.za-has-bar .hp-wa, html.za-has-bar .te-wa, html.za-has-bar .td-wa, html.za-has-bar .tn-wa, html.za-has-bar .tr-wa,
html.za-has-bar .tf-wa, html.za-has-bar .tb-wa, html.za-has-bar .ts-wa, html.za-has-bar .tg-wa { bottom: calc(var(--za-bar) + 14px); }
html.za-has-bar .zh-ck { bottom: calc(var(--za-bar) + 12px); }
html.za-has-bar .backToTopBtn { display: none !important; }
html.za-has-bar .zk-filters__foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
/* while the menu drawer or the bag drawer is open the bar slides away (they live inside the header's own layer) */
html.zh-menu-open .za-bar, html.zh-bag-open .za-bar { transform: translateY(110%); }

/* ---------- compact top bar ---------- */
.zh-bar__in { min-height: 30px; }
.zh-bar { font-size: 11.5px; }
.zh-main__in { height: 54px; }
.zh-logo img { height: 36px; }
.zh-icon { width: 40px; height: 40px; }
/* bag and account live in the tab bar on phones; the search and the wishlist stay in the top bar */
.zh-main__right .zh-cart .cart-view-list-icon,
.zh-main__right .zh-account,
.zh-main__right > a.zh-icon[href*="login"] { display: none; }
.zh-main__right .zh-icon--wish { display: inline-flex; }
/* back arrow instead of the menu on inner pages (the Shop tab opens the menu) */
.za-back { display: none; }
html.za-can-back .za-back { display: inline-flex; }
html.za-can-back .zh-burger-btn { display: none; }
.zh-search { padding: 0 8px; }

/* ---------- feel ---------- */
a, button, [role="button"] { -webkit-tap-highlight-color: transparent; }
/* (opacity only: a transform on <body> would pin the fixed bars to the page instead of the screen) */
@keyframes za-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
    html.za-ready body { animation: za-in 0.22s ease-out both; }
}
.zk-card:active, .hp-card:active, .zd-btn:active, .za-install__btn:active, .zh-nav__link:active { transform: scale(0.985); transition: transform 0.1s; }
/* rounded, card-like product tiles and sections */
.zk-card, .hp-card { border-radius: 16px; overflow: hidden; }
img { -webkit-user-drag: none; }
::selection { background: rgba(176, 141, 87, 0.25); }

/* ---------- "add to home screen" card ---------- */
.za-install {
    position: fixed; left: 12px; right: 12px; bottom: calc(var(--za-bar) + 12px); z-index: 1036;
    display: flex; align-items: center; gap: 12px; padding: 12px 40px 12px 12px;
    background: #fff; border: 1px solid var(--za-line); border-radius: 16px; box-shadow: 0 20px 50px -14px rgba(0, 0, 0, 0.35);
    font-family: var(--za-sans); color: var(--za-ink); transform: translateY(20px); opacity: 0; transition: transform 0.3s, opacity 0.3s;
}
.za-install.is-in { transform: none; opacity: 1; }
.za-install img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.za-install__text { flex: 1; min-width: 0; line-height: 1.3; }
.za-install__text b { display: block; font-size: 14px; }
.za-install__text span { display: block; font-size: 12.5px; color: var(--za-muted); }
.za-install__btn { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--za-emerald); color: #fbf7ee; font: 600 12.5px var(--za-sans); letter-spacing: 0.04em; }
.za-install__close { position: absolute; top: 4px; right: 6px; width: 32px; height: 32px; border: 0; background: none; color: var(--za-muted); font-size: 22px; line-height: 1; }

/* ---------- opened from the home screen (standalone) ---------- */
html.za-standalone .zh-bar { display: none; }
html.za-standalone .zh { padding-top: env(safe-area-inset-top, 0px); }
html.za-standalone .za-bar { background: rgba(251, 247, 238, 0.98); }

/* tablets in portrait (768–991 px): the same app shell with a roomier top bar; the tab bar sits in the middle */
@media (min-width: 640px) {
    .za-bar { grid-template-columns: repeat(5, 110px); justify-content: center; }
}
@media (min-width: 768px) {
    .zh-main__in { height: 64px; }
    .zh-logo img { height: 44px; }
    .zh-icon { width: 44px; height: 44px; }
    .zh-search { width: min(260px, 100%); padding: 0 14px; border: 1px solid var(--za-line); background: #fff; color: var(--za-muted); border-radius: 999px; }
    .zh-search__text { display: inline; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .za-install { left: auto; right: 20px; width: 420px; }
}
