/* ATP App 1.5.0. Everything inside html.atp-standalone only shows when opened from the home screen. */
:root { --atp-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }

/* ---------- App header ---------- */
.atp-app-header, .atp-ptr, .atp-loadbar, .atp-app-tabbar { display: none; }
html.atp-standalone .atp-app-header {
  display: flex; align-items: center; gap: 2px; position: fixed; top: 0; left: 0; right: 0; z-index: 99998;
  height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0;
  background: var(--atp-tab-bg, var(--atp-app-color, #111)); color: var(--atp-head-fg, #fff);
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 10px rgba(0,0,0,.18); font-family: var(--atp-font); box-sizing: border-box;
}
html.atp-standalone.atp-has-header body { padding-top: calc(54px + env(safe-area-inset-top)) !important; }
/* WordPress toolbar (logged-in admins) doesn't belong in the app. */
html.atp-standalone { margin-top: 0 !important; }
html.atp-standalone #wpadminbar { display: none !important; }
.atp-app-header [hidden] { display: none !important; }
.atp-ah-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 12px; background: transparent; color: inherit !important; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent; text-decoration: none !important;
}
.atp-ah-btn:active { background: rgba(127,127,127,.18); }
.atp-ah-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.atp-ah-back svg { width: 26px; height: 26px; stroke-width: 2.2; }
.atp-ah-brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; padding-left: 6px; color: inherit !important; text-decoration: none !important; }
html.atp-has-back .atp-ah-brand { padding-left: 0; }
.atp-ah-brand img { width: 30px; height: 30px; border-radius: 8px; flex: none; object-fit: cover; }
.atp-ah-brand span { font: 700 17px/1.1 var(--atp-font); letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atp-ah-actions { display: flex; align-items: center; }
.atp-ah-cart .atp-app-ico { position: relative; width: 24px; height: 24px; display: block; }
.atp-ah-searchbar {
  position: absolute; left: 0; right: 0; top: 100%; display: flex; gap: 8px; padding: 10px 12px;
  background: var(--atp-tab-bg, #111); box-shadow: 0 8px 16px rgba(0,0,0,.2); margin: 0;
}
.atp-ah-searchbar input[type=search] {
  flex: 1; min-width: 0; height: 42px; border: 0 !important; border-radius: 12px !important; padding: 0 14px !important;
  font: 16px var(--atp-font) !important; background: #fff !important; color: #111 !important; box-shadow: none !important; margin: 0 !important;
}
.atp-ah-searchbar button {
  height: 42px; border: 0; border-radius: 12px; padding: 0 16px; font: 600 15px var(--atp-font);
  background: var(--atp-accent, #c62828); color: #fff; cursor: pointer;
}

/* Loading bar between pages */
html.atp-standalone .atp-loadbar {
  display: block; position: fixed; left: 0; top: calc(54px + env(safe-area-inset-top)); height: 3px; width: 0; z-index: 99999;
  background: var(--atp-accent, #c62828); opacity: 0; pointer-events: none;
}
html.atp-standalone:not(.atp-has-header) .atp-loadbar { top: env(safe-area-inset-top); }
html.atp-loading .atp-loadbar { opacity: 1; animation: atp-load 2.5s cubic-bezier(.1,.7,.3,1) forwards; }
@keyframes atp-load { from { width: 0; } to { width: 88%; } }

/* Pull to refresh */
html.atp-standalone .atp-ptr {
  display: flex; align-items: center; justify-content: center; position: fixed; left: 50%; z-index: 99997;
  top: calc(54px + env(safe-area-inset-top) - 44px); width: 36px; height: 36px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.22); transform: translate(-50%, 0); opacity: 0; pointer-events: none;
}
html.atp-standalone:not(.atp-has-header) .atp-ptr { top: calc(env(safe-area-inset-top) - 44px); }
.atp-ptr svg { width: 20px; height: 20px; fill: none; stroke: #777; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
html.atp-standalone .atp-ptr.is-on { opacity: 1; }
.atp-ptr.is-ready svg, .atp-ptr.is-spin svg { stroke: var(--atp-accent, #c62828); }
.atp-ptr.is-spin svg { animation: atp-spin .7s linear infinite; }
@keyframes atp-spin { to { transform: rotate(360deg); } }

/* ---------- Bottom tab bar ---------- */
html.atp-standalone .atp-app-tabbar {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 99999;
  background: var(--atp-tab-bg, var(--atp-app-color, #111)); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -1px 0 rgba(255,255,255,.06), 0 -2px 10px rgba(0,0,0,.15); transition: transform .2s ease;
}
html.atp-standalone body { padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
html.atp-standalone.atp-kb .atp-app-tabbar { transform: translateY(110%); }
.atp-app-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; justify-content: center; position: relative;
  color: var(--atp-tab-fg, rgba(255,255,255,.62)) !important; text-decoration: none !important;
  font: 600 10.5px/1.2 var(--atp-font); letter-spacing: .1px; -webkit-tap-highlight-color: transparent;
}
.atp-app-tab.is-active { color: var(--atp-tab-active, #fff) !important; }
.atp-app-tab.is-active::before {
  content: ""; position: absolute; top: -6px; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px;
  background: var(--atp-accent, #c62828);
}
.atp-app-tab:active .atp-app-ico { transform: scale(.9); }
.atp-app-ico { position: relative; width: 24px; height: 24px; transition: transform .12s; }
.atp-app-ico svg, .atp-more-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.atp-app-badge {
  position: absolute; top: -4px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 8px; background: var(--atp-accent, #e02424); color: #fff; font: 700 10px/16px var(--atp-font); text-align: center;
  box-shadow: 0 0 0 2px var(--atp-tab-bg, #111);
}
.atp-app-badge[hidden] { display: none; }

/* ---------- More menu ---------- */
.atp-more[hidden] { display: none !important; }
.atp-more { position: fixed; inset: 0; z-index: 99996; font-family: var(--atp-font); }
.atp-more-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s; }
.atp-more-panel {
  position: absolute; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); max-height: 70vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 6px 16px 10px; background: #151515; color: #f4f4f4;
  transform: translateY(105%); transition: transform .24s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -10px 30px rgba(0,0,0,.3);
}
.atp-more.is-in .atp-more-backdrop { opacity: 1; }
.atp-more.is-in .atp-more-panel { transform: none; }
html.atp-more-open, html.atp-more-open body { overflow: hidden; }
.atp-more ul { list-style: none; margin: 0; padding: 0; }
.atp-more li { margin: 0; padding: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.atp-more li:last-child { border-bottom: 0; }
.atp-more a { display: flex; align-items: center; gap: 14px; min-height: 54px; color: inherit !important; text-decoration: none !important; font: 600 16px var(--atp-font); position: relative; }
.atp-more a:active { opacity: .6; }
.atp-more-ico { position: relative; width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; flex: none; }
.atp-more-ico svg { width: 20px; height: 20px; }
.atp-more a .atp-app-badge { position: static; margin-left: 4px; box-shadow: none; }
.atp-more--light .atp-more-panel { background: #fff; color: #1d1d1f; }
.atp-more--light li { border-bottom-color: rgba(0,0,0,.07); }
.atp-more--light .atp-more-ico { background: #f2f2f4; }
.atp-more-chev { width: 18px; height: 18px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 2; opacity: .4; }

/* ---------- Pop-up sheets (install, notifications, login tip) ---------- */
.atp-sheet {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 99999; box-sizing: border-box;
  max-width: 480px; margin: 0 auto; padding: 14px 16px 16px; border-radius: 20px; font: 14px/1.4 var(--atp-font);
  box-shadow: 0 12px 40px rgba(0,0,0,.35); transform: translateY(130%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
html.atp-standalone .atp-sheet { bottom: calc(70px + env(safe-area-inset-bottom)); }
.atp-sheet.is-in { transform: none; }
.atp-sheet.is-out { transform: translateY(130%); transition-duration: .22s; }
.atp-sheet--dark { background: #141414; color: #f4f4f4; border: 1px solid rgba(255,255,255,.08); }
.atp-sheet--light { background: #fff; color: #1d1d1f; border: 1px solid rgba(0,0,0,.06); }
.atp-sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: currentColor; opacity: .25; margin: -4px auto 10px; }
.atp-sheet-x {
  position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer;
  color: inherit; opacity: .55; display: flex; align-items: center; justify-content: center;
}
.atp-sheet-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.atp-sheet-row { display: flex; align-items: center; gap: 12px; padding-right: 30px; }
.atp-sheet-row img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.atp-sheet-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.atp-sheet-txt strong { font-size: 16px; line-height: 1.25; font-weight: 700; }
.atp-sheet-txt span { opacity: .82; }
.atp-sheet-actions { margin-top: 14px; }
.atp-sheet-cta {
  display: block; width: 100%; min-height: 46px; border: 0; border-radius: 14px; padding: 12px 16px; cursor: pointer;
  background: var(--atp-accent, #c62828); color: #fff; font: 700 16px/1.2 var(--atp-font);
}
.atp-sheet-cta:active { filter: brightness(.9); }
.atp-share { width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: #0a84ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Notifications ---------- */
.atp-app-notify-wrap { margin: 16px 0; scroll-margin-top: 80px; }
.atp-app-notify-btn { border: 0; border-radius: 12px; padding: 12px 18px; background: var(--atp-accent, #111); color: #fff; font-weight: 600; cursor: pointer; }
.atp-app-notify-off { border: 0; background: none; padding: 6px 0; color: inherit; text-decoration: underline; cursor: pointer; font-size: 14px; opacity: .75; }
.atp-app-notify-btn[hidden], .atp-app-notify-help[hidden], .atp-app-notify-off[hidden] { display: none; }
.atp-app-notify-help { margin: 8px 0 0; font-size: 14px; color: #555; }

/* "Get shipping updates" card on order pages */
.atp-app-ordercard[hidden] { display: none !important; }
.atp-app-ordercard {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 22px; padding: 16px; border-radius: 16px;
  background: #141414; color: #f4f4f4; font-family: var(--atp-font); box-shadow: 0 4px 18px rgba(0,0,0,.12);
}
.atp-oc-ico { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; flex: none; }
.atp-oc-ico .atp-i { width: 22px; height: 22px; vertical-align: 0; }
.atp-oc-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.4; }
.atp-oc-text strong { font-size: 16px; line-height: 1.3; }
.atp-oc-text span { opacity: .82; }
.atp-oc-help { margin: 4px 0 0 !important; font-weight: 600; }
.atp-oc-btn, .atp-oc-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--atp-accent, #c62828); color: #fff !important; font-weight: 700; font-size: 15px; text-decoration: none !important;
}
.atp-oc-btn[hidden], .atp-oc-link[hidden], .atp-oc-help[hidden] { display: none; }
@media (max-width: 600px) { .atp-oc-btn, .atp-oc-link { width: 100%; } }
.atp-app-ordercard.is-done .atp-oc-ico { background: #1f6d36; }

/* ---------- Get the App page ---------- */
.atp-get-app { max-width: 560px; margin: 0 auto; padding: 8px 0 24px; font-family: -apple-system, system-ui, "Segoe UI", sans-serif; color: #1d1d1f; }
.atp-get-app [hidden] { display: none !important; }
.atp-ga-head { text-align: center; }
.atp-ga-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.atp-ga-head h2 { margin: 14px 0 6px; font-size: 26px; line-height: 1.2; }
.atp-ga-head p { margin: 0 auto; max-width: 440px; color: #555; font-size: 16px; line-height: 1.5; }
.atp-ga-perks { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 10px; }
.atp-ga-perks li { display: flex; align-items: center; gap: 12px; background: #f5f5f7; border-radius: 12px; padding: 12px 14px; font-size: 15px; margin: 0; }
.atp-ga-perks .atp-i { width: 22px; height: 22px; color: var(--atp-app-color, #111); flex: none; }
.atp-i { width: 18px; height: 18px; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.atp-i-fill { fill: currentColor; stroke: none; }
.atp-ga-tabs { display: flex; background: #ececf0; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.atp-ga-tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 8px; font-size: 15px; font-weight: 600; color: #555; cursor: pointer; }
.atp-ga-tabs button[aria-selected="true"] { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.atp-ga-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.atp-ga-steps li { display: flex; gap: 12px; align-items: flex-start; border: 1px solid #e5e5ea; border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.45; margin: 0; }
.atp-ga-steps .atp-i { color: #0a84ff; }
.atp-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--atp-app-color, #111); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.atp-ga-note { font-size: 13px; color: #6e6e73; margin: 12px 2px 0; line-height: 1.45; }
.atp-ga-warn { background: #fff4e5; border: 1px solid #ffd8a8; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin: 0 0 12px; }
.atp-ga-copy, .atp-ga-install { border: 0; border-radius: 10px; background: var(--atp-accent, var(--atp-app-color, #111)); color: #fff; font-weight: 600; cursor: pointer; }
.atp-ga-copy { display: block; margin-top: 8px; padding: 8px 14px; font-size: 14px; }
.atp-ga-install { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; padding: 14px; font-size: 17px; margin-bottom: 14px; }
.atp-ga-desktop { text-align: center; color: #555; margin-top: 16px; }
.atp-ga-installed { text-align: center; font-size: 17px; }
.atp-ga-installed .atp-i { color: #1a7f37; }

/* ---------- Back-in-stock button ---------- */
.atp-app-stock { margin: 12px 0 18px; }
.atp-app-stock[hidden] { display: none; }
.atp-app-stock-btn { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--atp-app-color, #111); background: #fff; color: var(--atp-app-color, #111); border-radius: 12px; padding: 11px 16px; font-weight: 600; font-size: 15px; cursor: pointer; min-height: 44px; }
.atp-app-stock-btn[hidden], .atp-app-stock-help[hidden], .atp-app-stock-install[hidden] { display: none; }
.atp-app-stock-help { margin: 8px 0 0; font-size: 14px; color: #444; }
.atp-app-stock-install { display: inline-block; margin-top: 6px; font-weight: 600; }

/* Keep common chat buttons above the app tab bar */
html.atp-standalone #tidio-chat-iframe,
html.atp-standalone #hubspot-messages-iframe-container,
html.atp-standalone .joinchat,
html.atp-standalone #ht-ctc-chat,
html.atp-standalone .ht-ctc,
html.atp-standalone .wa__btn_popup { bottom: calc(72px + env(safe-area-inset-bottom)) !important; }

@media (prefers-reduced-motion: reduce) {
  .atp-sheet, .atp-more-panel, .atp-more-backdrop, .atp-app-tabbar { transition: none; }
  html.atp-loading .atp-loadbar { animation: none; width: 60%; }
}
