/* ==========================================================================
   TT Shop — Design System & Base Styles
   ========================================================================== */

:root {
  /* Brand */
  --primary: #ff3b5c;
  --primary-dark: #e0264a;
  --primary-light: #ffe4e9;
  --secondary: #17181a;
  --accent: #ff7a00;
  --accent-light: #fff1e0;

  /* Semantic */
  --success: #14b872;
  --success-light: #e3f9ef;
  --warning: #ffb020;
  --danger: #ff3b5c;

  /* Neutrals */
  --text: #17181a;
  --text-muted: #6b7075;
  --text-faint: #9a9ea3;
  --background: #f7f7f8;
  --surface: #ffffff;
  --border: #ececee;
  --border-strong: #dedfe2;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(20, 20, 25, 0.06), 0 1px 2px rgba(20, 20, 25, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 20, 25, 0.08);
  --shadow-lg: 0 16px 40px rgba(20, 20, 25, 0.12);

  /* Layout */
  --header-h: 64px;
  --bottom-nav-h: 62px;
  --container-max: 1280px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 240ms;

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}
/* product_detail / cart render their own mobile sticky bar instead of the
   bottom nav (see index.php OWN_STICKY_BAR_PAGES) — no bottom-nav-h reserve needed. */
body.page-product_detail,
body.page-cart {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: 'Prompt', 'Inter', sans-serif; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: 16px;
}

/* Full-bleed mobile pages that center themselves on wide screens
   (their inner components carry their own horizontal spacing). */
.home-page,
.listing-layout,
.pd-page,
.cart-layout,
.checkout-layout,
.profile-page,
.orders-page,
.wishlist-page,
.search-page,
.category-page {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.94rem;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  white-space: nowrap;
  min-height: 44px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: var(--background); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; min-height: 36px; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.is-disabled { opacity: 0.5; pointer-events: none; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  font-size: 1.05rem;
  transition: background var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--background); }

/* ---------- Badges ---------- */
.badge-count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.badge-count-sm { top: -2px; right: -8px; }
.badge-dot { width: 8px; height: 8px; min-width: 8px; padding: 0; font-size: 0; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
.navbar-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}
.navbar-logo {
  font-family: 'Prompt', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.navbar-logo-dot { color: var(--primary); }

.navbar-search { display: none; }
.search-form { position: relative; flex: 1; display: flex; }
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 0.9rem;
}
.search-input {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--background);
  padding: 0 16px 0 40px;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.search-input:focus { border-color: var(--primary); background: var(--surface); }
.search-submit { display: none; }

.navbar-links { display: none; }
.navbar-mobile-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }

.navbar-mobile-search {
  padding: 0 16px 12px;
}

.navbar-avatar { border-radius: 50%; object-fit: cover; display: block; }

.notif-panel {
  position: absolute;
  right: 16px;
  top: calc(100% + 8px);
  width: min(340px, calc(100vw - 32px));
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: dropIn var(--dur-base) var(--ease);
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.notif-panel-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  position: relative;
}
a.notif-item:hover { background: var(--background); }
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread { background: var(--primary-light); }
.notif-item p { font-size: 0.85rem; margin-bottom: 4px; }
.notif-item span { font-size: 0.75rem; color: var(--text-faint); }
.notif-item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-left: auto; }
.notif-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 0.85rem;
}
.notif-icon.tone-success { background: var(--success-light); color: var(--success); }
.notif-icon.tone-danger { background: var(--primary-light); color: var(--danger); }
.notif-icon.tone-warning { background: #fff2d9; color: #a15400; }
.notif-icon.tone-info { background: #e3ecff; color: #2545c9; }
.notif-icon.tone-neutral { background: var(--background); color: var(--text-faint); }

/* ---------- Full notification center (pages/notifications.php) ---------- */
.notif-center-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; }
.notif-center-header h1 { font-size: 1.1rem; margin-bottom: 4px; }
.notif-center-header p { color: var(--text-muted); font-size: 0.82rem; }
.notif-filter-tabs { display: flex; gap: 8px; padding: 0 16px 12px; }
.notif-center-list { margin: 0 16px 16px; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.notif-center-group-label { font-size: 0.72rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; padding: 12px 16px 6px; }
.notif-center-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: inherit;
}
.notif-center-item:last-child { border-bottom: none; }
.notif-center-item:hover { background: var(--background); }
.notif-center-item.is-unread { background: var(--primary-light); }
.notif-center-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.notif-center-icon.tone-success { background: var(--success-light); color: var(--success); }
.notif-center-icon.tone-danger { background: var(--primary-light); color: var(--danger); }
.notif-center-icon.tone-warning { background: #fff2d9; color: #a15400; }
.notif-center-icon.tone-info { background: #e3ecff; color: #2545c9; }
.notif-center-icon.tone-neutral { background: var(--background); color: var(--text-faint); }
.notif-center-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-center-title { font-size: 0.88rem; font-weight: 600; }
.notif-center-text { font-size: 0.82rem; color: var(--text-muted); white-space: pre-line; }
.notif-center-time { font-size: 0.72rem; color: var(--text-faint); margin-top: 2px; }
.notif-center-item .unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Bottom Navigation (Mobile) ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(20, 20, 25, 0.05);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 0 6px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 500;
  min-height: 56px;
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.bottom-nav-icon-wrap { position: relative; font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active .bottom-nav-icon-wrap::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}
.bottom-nav-item:active { transform: scale(0.94); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 32px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  gap: 20px;
  padding-block: 28px;
}
.footer-brand p { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--background);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.footer-social a:hover { background: var(--primary); color: #fff; }

.footer-col summary {
  cursor: pointer;
  font-weight: 600;
  padding: 10px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-col summary::-webkit-details-marker { display: none; }
.footer-col summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.7rem;
  color: var(--text-faint);
  transition: transform var(--dur-fast) var(--ease);
}
.footer-col[open] summary::after { transform: rotate(180deg); }
.footer-col ul { padding-bottom: 10px; }
.footer-col li { padding: 6px 0; font-size: 0.85rem; color: var(--text-muted); }
.footer-col li a:hover { color: var(--primary); }
.footer-col { border-bottom: 1px solid var(--border); }

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding-block: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
}
.footer-payments { display: flex; gap: 12px; font-size: 1.3rem; color: var(--text-faint); }

/* ---------- Hero Slider ---------- */
.hero-slider {
  position: relative;
  margin: 12px 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-slider-track {
  display: flex;
  transition: transform var(--dur-base) var(--ease);
}
.hero-slide {
  min-width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  position: relative;
}
.hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.72) 100%);
}
.hero-slide-overlay { position: relative; z-index: 1; padding: 24px 20px; color: #fff; max-width: 480px; }
.hero-slide-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffd7dd;
  margin-bottom: 6px;
}
.hero-slide-overlay h2 { font-size: 1.4rem; line-height: 1.25; margin-bottom: 6px; }
.hero-slide-subtitle { font-size: 0.88rem; opacity: 0.9; margin-bottom: 14px; }

.hero-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: background var(--dur-fast) var(--ease);
}
.hero-slider-nav:hover { background: #fff; }
.hero-slider-nav.prev { left: 14px; }
.hero-slider-nav.next { right: 14px; }

.hero-slider-dots {
  position: absolute;
  bottom: 14px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 1;
}
.hero-slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: width var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.hero-slider-dot.active { width: 18px; background: #fff; }

/* ---------- Section Header ---------- */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px 16px 12px;
  gap: 12px;
}
.section-header-text h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.section-header-text h2 i { color: var(--primary); font-size: 1rem; }
.section-header-text p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.section-header-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Utility ---------- */
.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }

.section { margin-bottom: 8px; }
.section-surface { background: var(--surface); }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f2f2f3 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.fade-in { animation: fadeIn var(--dur-base) var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  align-items: center;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--secondary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--dur-base) var(--ease);
  width: 100%;
  justify-content: center;
}
.toast.success i { color: var(--success); }
.toast.error i { color: var(--primary); }
.toast.leaving { animation: toastOut var(--dur-base) var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.96); } }

/* TT Shop logo mark */
.navbar-logo { display: inline-flex; align-items: center; }.navbar-logo-mark { width: 1.6em; height: 1.6em; border-radius: 8px; flex: none; }
