/* ==========================================================================
   SatheAchi.com — Premium E-commerce Design System v3.0
   ========================================================================== */

:root {
  /* Colors */
  --primary: #ff6b00;
  --primary-dark: #e55e00;
  --primary-light: #fff3eb;
  --navy: #1a1035;
  --bg-color: #f0f3f7;
  --white: #ffffff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border: #f3f4f6;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Premium Glass UI Variables */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --apple-blur: blur(20px) saturate(180%);
  --apple-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-base: 'Inter', sans-serif;
  --font-head: 'Inter', sans-serif;
  
  /* Layout */
  --wrap-width: 1240px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Soft Shadows */
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.06);
  --shadow-hover: 0 15px 35px rgba(0,0,0,0.08);
  
  /* Transitions */
  --trans: all 0.25s ease;
}

/* ═══════════════════════════════════════════════
   GLOBAL PREMIUM ANIMATION SYSTEM
   ═══════════════════════════════════════════════ */
@keyframes sa-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sa-slideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sa-slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sa-scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes sa-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
@keyframes sa-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.sa-anim-fadeIn  { animation: sa-fadeIn  0.4s ease both; }
.sa-anim-slideUp { animation: sa-slideUp 0.45s cubic-bezier(0.22,1,0.36,1) both; }
.sa-anim-scaleIn { animation: sa-scaleIn 0.35s cubic-bezier(0.22,1,0.36,1) both; }

[data-theme="dark"] {
  --bg-color: #0f172a;
  --white: #1e293b;
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.2);
  --glass-bg: rgba(30, 41, 59, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --apple-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* ─── RESET & BASE ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  font-family: var(--font-base); 
  background-color: var(--bg-color); 
  color: var(--text-dark); 
  line-height: 1.5; 
  font-size: 14px; 
  overflow-x: hidden; 
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); 
}
body.sa-has-sticky-bar {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 180px);
}
a { text-decoration: none; color: inherit; transition: var(--trans); }
button { border: none; background: none; cursor: pointer; font-family: var(--font-base); transition: var(--trans); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
input, select { font-family: var(--font-base); outline: none; }

.sa-wrap { max-width: var(--wrap-width); margin: 0 auto; padding: 0 20px; }

/* ─── BUTTONS ─── */
.sa-btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 28px; border-radius: var(--radius-full); font-weight: 600; font-size: 15px; color: #fff; background: var(--primary); }
.sa-btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,107,0,0.3); }

/* Premium Glass UI Components */
.sa-glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--apple-blur);
  -webkit-backdrop-filter: var(--apple-blur);
  box-shadow: var(--apple-shadow);
  border-radius: var(--radius-lg);
  transition: var(--trans);
}
.sa-glass-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

/* iOS Touch Target & Active State Utilities */
.sa-touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sa-active-press:active {
  transform: scale(0.95) !important;
  transition: transform 0.1s ease;
}

/* ─── 1. HEADER — Smart Scroll + Logo Image + Dynamic Island Search ─── */
.sa-header {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.015), 0 1px 0 rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: padding, background-color, backdrop-filter, box-shadow;
}
.sa-header.scrolled {
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.03), 0 1px 0 rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .sa-header {
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .sa-header.scrolled {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sa-header-hidden { transform: translateY(-100%); box-shadow: none; }
.sa-header-inner  { 
  display: flex !important; 
  align-items: center; 
  gap: 20px; 
  justify-content: space-between;
}

/* ── Real Logo Image (MAIN BRANDING FOCUS) ── */
.sa-logo { 
  display: flex; align-items: center; justify-content: flex-start; flex: 0 0 auto; 
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1; transform: translateX(0) scale(1); transform-origin: left center;
}
.sa-logo-img { height: 38px; width: auto; display: block; object-fit: contain; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease; }
.sa-logo-img:hover { transform: scale(1.02); filter: brightness(1.05); }
/* Fallback icon-based logo (hidden when image loads) */
.sa-logo-icon { width: 38px; height: 38px; background: var(--primary); color: #fff; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.sa-logo-text { font-weight: 800; font-size: 22px; color: var(--text-dark); margin-left: 8px; }

/* ── Ultra-Compact Dynamic Island Pill Search ── */
.sa-search-wrap { 
  flex: 1 1 auto;
  max-width: 460px;
  height: 42px;
  margin: 0 auto;
  position: relative;
  transition: max-width 0.5s cubic-bezier(0.16, 1, 0.3, 1), flex 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}
.sa-search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 99px;
  padding: 0 6px 0 16px;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.015), inset 0 1px 1.5px rgba(255, 255, 255, 0.3);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
}
[data-theme="dark"] .sa-search-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
.sa-search-box input {
  width: 100%;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dark);
  outline: none;
  border: none;
  background: transparent;
}
.sa-search-box input::placeholder {
  color: var(--text-muted);
  opacity: 0.65;
  transition: opacity 0.3s;
}
.sa-search-icon {
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.3s;
}
.sa-search-btn {
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.9;
  border: none;
  cursor: pointer;
}
.sa-search-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
  opacity: 1;
}
.sa-search-btn:active {
  transform: scale(0.92);
}

/* ═══════════════════════════════════════════════
   ISLAND ACTIVE STATE (Desktop & Mobile)
   ═══════════════════════════════════════════════ */
.sa-header-inner.island-active .sa-logo {
  flex: 0; opacity: 0; transform: scale(0.6) translateX(-30px);
  max-width: 0; margin-right: 0; padding: 0; pointer-events: none; overflow: hidden;
}
.sa-header-inner.island-active .sa-hdr-actions {
  flex: 0; opacity: 0; transform: translateX(20px);
  max-width: 0; margin-left: 0; padding: 0; pointer-events: none; overflow: hidden;
}
.sa-header-inner.island-active .sa-search-wrap {
  flex: 1 1 100%; width: 550px; max-width: 100%;
}
.sa-header-inner.island-active .sa-search-box {
  background: var(--white);
  border-color: rgba(255, 107, 0, 0.45);
  box-shadow: 0 12px 32px rgba(255, 107, 0, 0.08), 0 0 0 3px rgba(255, 107, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .sa-header-inner.island-active .sa-search-box {
  background: #1e293b;
  border-color: rgba(255, 107, 0, 0.6);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 107, 0, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}
.sa-header-inner.island-active .sa-search-icon {
  color: var(--primary);
}
.sa-header-inner.island-active .sa-search-btn {
  opacity: 1;
  width: 32px;
  height: 32px;
}

/* Premium Glass Suggestions Dropdown — positioned relative to .sa-search-wrap */
.sa-search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  min-width: 320px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
  display: none;
  animation: sa-dropdown-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  padding: 16px 0;
}
[data-theme="dark"] .sa-search-suggestions {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.sa-search-suggestions.active { display: block; }

@keyframes sa-dropdown-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sa-suggestions-section {
  padding: 8px 20px;
}
.sa-suggestions-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sa-suggestions-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.sa-tag {
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  border: 1px solid transparent;
}
.sa-tag:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(255, 107, 0, 0.15);
}
[data-theme="dark"] .sa-tag {
  background: rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .sa-tag:hover {
  background: rgba(255, 107, 0, 0.15);
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.25s;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 13.5px;
}
.suggestion-item:hover {
  background: rgba(255, 107, 0, 0.06);
  color: var(--primary);
}
.suggestion-item i {
  color: var(--text-muted);
  font-size: 12px;
}
.suggestion-item:hover i {
  color: var(--primary);
}

.sa-hdr-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; transition: all 0.55s cubic-bezier(0.32,0.72,0,1.15); opacity: 1; justify-content: flex-end; flex: 1; }
.sa-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-dark);
  position: relative;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.015), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.sa-icon-btn:hover {
  background: rgba(255, 255, 255, 0.75);
  color: var(--primary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 22px rgba(255, 107, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 107, 0, 0.25);
}
.sa-icon-btn:active {
  transform: translateY(0) scale(0.93);
}
[data-theme="dark"] .sa-icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .sa-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--primary);
  border-color: rgba(255, 107, 0, 0.35);
  box-shadow: 0 8px 22px rgba(255, 107, 0, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

#saProfileBtn { padding: 0; overflow: hidden; }

.sa-avatar-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #ff8a00);
  border-radius: 50%;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.sa-badge {
  position: absolute; 
  top: -4px; 
  right: -4px;
  background: linear-gradient(135deg, #ff3b30, #ff453a);
  color: #fff;
  font-size: 9.5px; 
  font-weight: 700;
  min-width: 16px; 
  height: 16px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  padding: 0 4.5px;
  border-radius: 99px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
  animation: sa-scaleIn 0.3s ease;
}
[data-theme="dark"] .sa-badge {
  border-color: #1e293b;
}

/* Profile Dropdown Container & Menu */
.sa-profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 240px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.08), 0 1px 0 rgba(0,0,0,0.02);
  border: 1px solid rgba(255, 255, 255, 0.5);
  z-index: 1001;
  padding: 12px 0;
  display: none;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transform-origin: top right;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.sa-profile-dropdown.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}
[data-theme="dark"] .sa-profile-dropdown {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

.sa-dropdown-header {
  padding: 12px 20px 10px;
}
.sa-dropdown-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sa-user-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-dark);
}
.sa-user-email {
  font-size: 11px;
  color: var(--text-muted);
}
.sa-dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 6px 0;
}
[data-theme="dark"] .sa-dropdown-divider {
  background: rgba(255, 255, 255, 0.06);
}

.sa-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  margin: 2px 8px;
  color: var(--text-dark);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.sa-dropdown-item:hover {
  background: rgba(255, 107, 0, 0.08);
  color: var(--primary);
}
[data-theme="dark"] .sa-dropdown-item:hover {
  background: rgba(255, 107, 0, 0.15);
}
.sa-dropdown-item i {
  font-size: 13.5px;
  width: 16px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.2s;
}
.sa-dropdown-item:hover i {
  color: var(--primary);
}

.sa-dropdown-login-btn {
  display: block;
  margin: 10px 12px;
  padding: 11px;
  text-align: center;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.15);
}
.sa-dropdown-login-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 107, 0, 0.22);
}

/* Cart Icon Bounce Animation */
@keyframes cart-bounce {
  0%   { transform: scale(1) rotate(0deg); }
  20%  { transform: scale(1.4) rotate(-12deg); }
  40%  { transform: scale(0.88) rotate(6deg); }
  60%  { transform: scale(1.15) rotate(-4deg); }
  80%  { transform: scale(0.96) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.cart-bounce-anim {
  animation: cart-bounce 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Suggestions search icon flex-shrink fix */
.sa-search-icon { flex-shrink: 0; }

/* ─── 2. DARK CATEGORY NAV ─── */
.sa-dark-nav { background: var(--navy); color: #fff; }
.sa-dark-nav-inner { display: flex; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 0; }
.sa-dark-nav-inner::-webkit-scrollbar { display: none; }
.sa-dn-item { padding: 15px 20px; font-size: 14px; font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.8); position: relative; }
.sa-dn-item:hover { color: #fff; }
.sa-dn-item.active { color: var(--primary); font-weight: 700; }
.sa-dn-item.active::after { content: ''; position: absolute; bottom: 0; left: 20px; right: 20px; height: 3px; background: var(--primary); border-radius: 3px 3px 0 0; }

/* ─── 3. HERO SECTION ─── */
.sa-hero { padding: 25px 0; }
.sa-hero-slider { border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(135deg, #1a1a2e 0%, #2a2a4a 100%); display: flex; position: relative; min-height: 380px; box-shadow: var(--shadow-md); }
.sa-hero-content { flex: 1; padding: 60px; display: flex; flex-direction: column; justify-content: center; z-index: 2; }
.sa-hero-h1 { font-size: 48px; font-weight: 800; color: #fff; line-height: 1.1; margin-bottom: 15px; }
.sa-hero-p { font-size: 18px; color: rgba(255,255,255,0.8); margin-bottom: 30px; }
.sa-hero-img { flex: 1; position: relative; display: flex; align-items: center; justify-content: flex-end; }
.sa-hero-img img { max-height: 120%; object-fit: contain; margin-right: 20px; }

/* ─── 4. TRUST BADGES ─── */
.sa-trust { padding: 0 0 40px; }
.sa-trust-grid { display: flex; justify-content: space-between; background: var(--white); padding: 20px 30px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.sa-trust-item { display: flex; align-items: center; gap: 15px; }
.sa-ti-icon { font-size: 24px; }
.sa-ti-label { font-weight: 700; font-size: 14px; color: var(--text-dark); margin-bottom: 2px; }
.sa-ti-sub { font-size: 12px; color: var(--text-muted); }

/* ─── GENERAL SECTION STYLES ─── */
.sa-section { padding: 30px 0; }
.sa-sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.sa-sec-title { font-size: 20px; font-weight: 800; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.sa-view-all { font-weight: 600; font-size: 13px; color: var(--primary); display: flex; align-items: center; gap: 4px; }

/* ─── 5. FLASH SALE ─── */
.sa-flash-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sa-flash-title-row { display: flex; align-items: center; gap: 15px; }
.sa-flash-title-row i { color: var(--primary); font-size: 20px; }
.sa-flash-title { font-size: 18px; font-weight: 800; }
.sa-cd-box { background: #fff3eb; color: var(--danger); font-weight: 800; padding: 6px 10px; border-radius: 6px; font-size: 16px; border: 1px solid rgba(239, 68, 68, 0.2); }
.sa-cd-sep { color: var(--danger); font-weight: 800; }
.sa-flash-grid, .sa-prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ─── PRODUCT CARDS ─── */
.sa-prod-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 15px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 1px solid var(--border);
  will-change: transform;
}
.sa-prod-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 107, 0, 0.25);
}
.sa-prod-card:active {
  transform: scale(0.97) translateY(-2px);
}
[data-theme="dark"] .sa-prod-card {
  background: rgba(30, 41, 59, 0.45);
  border-color: rgba(255, 255, 255, 0.05);
}
.sa-pc-top { position: relative; margin-bottom: 15px; }
.sa-disc-tag { position: absolute; top: 0; left: 0; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: var(--radius-sm); z-index: 2; }
.sa-wish-tag { position: absolute; top: 0; right: 0; width: 30px; height: 30px; background: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.sa-wish-tag:hover { color: var(--danger); }
.sa-pc-img { height: 180px; display: flex; align-items: center; justify-content: center; background: #fdfdfd; border-radius: var(--radius-md); }
.sa-pc-img img { max-height: 100%; max-width: 100%; object-fit: contain; }

.sa-pc-title { font-weight: 600; font-size: 14px; color: var(--text-dark); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.sa-pc-stars { color: var(--warning); font-size: 11px; margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.sa-pc-stars span { color: var(--text-muted); font-size: 11px; }
.sa-pc-price { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.sa-pc-now { font-size: 16px; font-weight: 800; color: var(--primary); }
.sa-pc-was { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }

/* ─── 6. TOP BRANDS ─── */
.sa-brands-grid { display: flex; gap: 15px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.sa-brands-grid::-webkit-scrollbar { display: none; }
.sa-brand-card { min-width: 100px; height: 50px; background: var(--white); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: var(--text-dark); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 0 15px; }

/* ─── 7. SHOP BY CATEGORY ─── */
.sa-cats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; }
.sa-cat-card { display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--white); padding: 20px 10px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: var(--trans); cursor: pointer; }
.sa-cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.sa-cat-circle { width: 60px; height: 60px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--primary); }
.sa-cat-card span { font-weight: 600; font-size: 13px; color: var(--text-dark); }

/* ─── FLOATING CHAT & BOTTOM NAV ─── */
.sa-live-chat { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 10px 25px rgba(255,107,0,0.4); z-index: 999; cursor: pointer; transition: transform 0.3s; }
.sa-live-chat:hover { transform: scale(1.1); }

/* ── Ultra-Premium Floating Liquid Glass Bottom Nav (Apple VisionOS & iOS Dock Inspired) ── */
.sa-bottom-nav { 
  display: flex; 
  position: fixed; 
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  left: 50%; 
  transform: translateX(-50%); 
  width: max-content;
  padding: 8px 24px;
  border-radius: 40px;
  gap: 28px;
  background: rgba(255, 255, 255, 0.35); 
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  z-index: 999;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sa-bn-item { 
  flex: 1; 
  min-width: 48px; 
  height: 48px;
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  color: #64748b; 
  position: relative; 
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border-radius: 50%;
}

.sa-bn-item i { 
  font-size: 24px; 
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
  z-index: 2; 
}
.sa-bn-item span { display: none; } /* Hide text for Apple Dock feel */

/* Interactive States */
.sa-bn-item:hover i {
  transform: scale(1.1);
  color: var(--primary);
}

.sa-bn-item:active {
  transform: scale(0.9);
}

/* Active Glass Bubble State */
.sa-bn-item.active { 
  color: var(--primary);
}
.sa-bn-item.active::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  animation: saBubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes saBubblePop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.sa-bn-item.active i { 
  transform: scale(1.12); 
  filter: drop-shadow(0 2px 8px rgba(255, 107, 0, 0.45)); 
}
.sa-bn-item.active span { font-weight: 700; }

/* Dark Mode Liquid Glass */
[data-theme="dark"] .sa-bottom-nav {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1); 
}
[data-theme="dark"] .sa-bn-item { color: #94a3b8; }
[data-theme="dark"] .sa-bn-item.active { color: var(--primary); }
[data-theme="dark"] .sa-bn-item.active::before { 
  background: rgba(255, 255, 255, 0.12); 
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05); 
}

/* ─── RESPONSIVE DESIGN (High Density Mobile UI) ─── */
@media (max-width: 1024px) {
  .sa-search-wrap { max-width: 400px; }
  .sa-hero-h1 { font-size: 36px; }
  .sa-flash-grid, .sa-prod-grid { grid-template-columns: repeat(3, 1fr); }
  .sa-cats-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .sa-wrap { padding: 0 12px; }
  
  .sa-header { padding: 8px 0; }
  .sa-logo-img { height: 32px; } /* Clean, balanced height */
  .sa-logo-text { display: none; }

  .sa-header-inner { gap: 10px; }
  
  /* Compact Search Wrap for Mobile */
  .sa-search-wrap { height: 36px; }
  .sa-search-box { padding: 0 6px 0 12px; }
  .sa-search-box input { font-size: 13px; padding: 0 6px; }
  .sa-search-box input::placeholder { font-size: 12.5px; opacity: 0.55; }
  .sa-search-icon { font-size: 13px; }
  .sa-search-btn { width: 26px; height: 26px; font-size: 11px; }

  .sa-hdr-actions { gap: 6px; margin-left: 0; flex: none; }
  .sa-icon-btn { width: 36px; height: 36px; font-size: 15px; }
  .sa-hdr-actions button[title="Notifications"], a[title="Wishlist"], button#saTheme { display: none; }

  /* Adjust active island on mobile to be compact */
  .sa-header-inner.island-active .sa-search-wrap {
    flex: 1 1 100%;
  }
  .sa-header-inner.island-active .sa-search-btn {
    width: 28px;
    height: 28px;
  }
  
  /* Compact Dark Nav */
  .sa-dn-item { padding: 8px 12px; font-size: 12px; font-weight: 600; gap: 6px; }
  .sa-dn-item i { font-size: 13px; }
  .sa-dn-item.active::after { left: 12px; right: 12px; height: 2px; }

  /* Compact Hero Banner */
  .sa-hero { padding: 10px 0; }
  .sa-hero-slider { min-height: 140px; flex-direction: row; border-radius: var(--radius-md); }
  .sa-hero-content { padding: 15px 20px; justify-content: center; }
  .sa-hero-h1 { font-size: 20px; line-height: 1.2; margin-bottom: 8px; }
  .sa-hero-p { display: none; }
  .sa-btn-primary { padding: 6px 14px; font-size: 12px; }
  .sa-hero-img { display: flex; opacity: 0.8; justify-content: flex-end; padding-right: 10px; }
  .sa-hero-img img { max-height: 90%; max-width: 120px; }

  /* Hide Trust Badges */
  .sa-trust { display: none; }
  
  /* Tighter Section Margins */
  .sa-section { padding: 15px 0; }
  .sa-sec-head { margin-bottom: 12px; }
  .sa-sec-title { font-size: 16px; font-weight: 800; gap: 5px; }
  .sa-view-all { font-size: 12px; }

  /* Category Grid — Premium Horizontal Scroll on Mobile */
  .sa-cats-grid {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 12px;
    padding: 4px 4px 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .sa-cats-grid::-webkit-scrollbar { display: none; }
  .sa-cat-card {
    min-width: 80px;
    flex: 0 0 80px;
    scroll-snap-align: start;
    padding: 10px 5px;
    gap: 6px;
    border-radius: var(--radius-md);
  }
  .sa-cat-circle { width: 50px; height: 50px; font-size: 22px; }
  .sa-cat-card span { font-size: 11px; font-weight: 600; text-align: center; }

  /* Compact Flash Sale */
  .sa-flash-head { margin-bottom: 12px; }
  .sa-flash-title-row { gap: 8px; }
  .sa-flash-title-row i { font-size: 16px; }
  .sa-flash-title { font-size: 15px; }
  .sa-cd-box { padding: 3px 5px; font-size: 12px; border-radius: 4px; }
  .sa-cd-sep { font-size: 12px; }
  
  /* Dense Product Cards — taller images */
  .sa-flash-grid, .sa-prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sa-prod-card { padding: 12px; border-radius: var(--radius-md); }
  .sa-pc-top { margin-bottom: 10px; }
  .sa-pc-img { height: 150px; border-radius: var(--radius-md); }
  .sa-disc-tag { font-size: 9px; padding: 2px 5px; }
  .sa-wish-tag { width: 26px; height: 26px; font-size: 12px; }
  .sa-pc-title { font-size: 12px; line-height: 1.3; margin-bottom: 4px; }
  .sa-pc-stars { font-size: 9px; margin-bottom: 6px; }
  .sa-pc-stars span { font-size: 9px; }
  .sa-pc-now { font-size: 14px; }
  .sa-pc-was { font-size: 10px; }

  /* Bottom elements */
  .sa-bottom-nav { display: flex; }
  .sa-live-chat { bottom: 105px; right: 15px; width: 45px; height: 45px; font-size: 18px; }
}

/* ══════════════════════════════════════════════════════════
   SATHEACHI MOTION ENGINE (Apple-Inspired Native App Feel)
   ══════════════════════════════════════════════════════════ */

/* ── 1. Page Transition Overlay ── */
#saMotionOverlay {
  position: fixed; inset: 0; z-index: 800; /* Behind Header (1000) and Bottom Nav (999) */
  background: var(--bg-color);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.sa-mo-logo {
  display: flex; flex-direction: column; align-items: center; gap: 30px;
  transform: scale(0.95); opacity: 0;
  transition: all 0.4s cubic-bezier(0.32, 0.72, 0, 1.2);
}
.sa-mo-logo img { height: 96px; } /* Much larger logo */
.sa-mo-ring {
  width: 40px; height: 40px;
  border: 3.5px solid rgba(255,107,0,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: saSpin 0.8s linear infinite;
}
@keyframes saSpin { to { transform: rotate(360deg); } }

/* Enter (Page Load) */
#saMotionOverlay.sa-mo-enter { opacity: 1; pointer-events: auto; }
#saMotionOverlay.sa-mo-enter .sa-mo-logo { transform: scale(1); opacity: 1; }
#saMotionOverlay.sa-mo-entered { opacity: 0; pointer-events: none; }
#saMotionOverlay.sa-mo-entered .sa-mo-logo { transform: scale(1.05); opacity: 0; }

/* Exit (Page Switch) */
#saMotionOverlay.sa-mo-exit { opacity: 1; pointer-events: auto; }
#saMotionOverlay.sa-mo-exit .sa-mo-logo { transform: scale(1); opacity: 1; transition-delay: 0.1s; }

/* Body Content Entry */
body { opacity: 0; transition: opacity 0.5s ease; }
body.sa-body-entered { opacity: 1; }

/* ── 2. Header & Sections Reveal ── */
.sa-header-reveal {
  transform: translateY(-20px); opacity: 0;
  animation: saDropIn 0.6s cubic-bezier(0.32, 0.72, 0, 1) 0.1s forwards;
}
@keyframes saDropIn { to { transform: translateY(0); opacity: 1; } }

.sa-section-pre { opacity: 0; transform: translateY(30px); transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1); will-change: transform, opacity; }
.sa-section-visible { opacity: 1; transform: translateY(0); }

/* ── 3. Staggered Card Reveals ── */
.sa-card-hidden { opacity: 0; transform: translateY(18px) scale(0.97); will-change: transform, opacity; }
.sa-card-visible {
  animation: saCardUp 0.55s cubic-bezier(0.32, 0.72, 0, 1.1) forwards;
}
@keyframes saCardUp { 
  to { opacity: 1; transform: translateY(0) scale(1); } 
}
/* Prevent hover from conflicting with reveal animation */
.sa-card-hidden:hover { transform: translateY(18px) scale(0.97) !important; }

/* ── 4. Apple-Style Button Micro-Interactions ── */
.sa-press-primary { transform: scale(0.95) !important; filter: brightness(0.9); }
.sa-press-icon { transform: scale(0.88) !important; opacity: 0.7; }
.sa-press-card { transform: scale(0.97) !important; }

/* ── 5. Bottom Nav Stable Fix ── */
.sa-bn-tapped::before { background: rgba(255,107,0,0.2) !important; transform: scale(0.9) !important; }
.sa-bn-tapped i { transform: scale(0.9) !important; }

/* ══════════════════════════════════════════════════════════
   PREMIUM HERO SLIDER (Native Scroll Snapping)
   ══════════════════════════════════════════════════════════ */
.sa-hero-premium { padding: 24px 0; overflow: hidden; }
.sa-premium-slider-wrapper { position: relative; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.08); }
.sa-premium-slider {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.sa-premium-slider::-webkit-scrollbar { display: none; }
.sa-slide { min-width: 100%; scroll-snap-align: start; position: relative; }
.sa-slide-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 40px 60px; min-height: 380px; position: relative; overflow: hidden;
}
.sa-slide-content { position: relative; z-index: 2; max-width: 50%; animation: saSlideFade 0.8s cubic-bezier(0.32, 0.72, 0, 1) both; }
@keyframes saSlideFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.sa-slide-badge { display: inline-block; background: rgba(255,255,255,0.2); color: #fff; font-size: 12px; font-weight: 800; padding: 6px 14px; border-radius: 999px; margin-bottom: 16px; backdrop-filter: blur(8px); text-transform: uppercase; letter-spacing: 1px; }
.sa-slide-h1 { font-size: 42px; font-weight: 900; color: #fff; line-height: 1.1; margin-bottom: 16px; letter-spacing: -1px; }
.sa-slide-p { font-size: 16px; color: rgba(255,255,255,0.85); margin-bottom: 24px; line-height: 1.5; font-weight: 500; }
.sa-slide-content .sa-btn-primary { background: #fff; color: #1e1b4b; padding: 14px 28px; border-radius: 999px; font-size: 15px; font-weight: 700; display: inline-flex; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: all 0.3s; border: none; }
.sa-slide-content .sa-btn-primary:active { transform: scale(0.95); }

.sa-slide-img { position: absolute; right: 0; bottom: 0; height: 100%; width: 55%; z-index: 1; }
.sa-slide-img img { width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(to right, transparent, black 30%); mask-image: linear-gradient(to right, transparent, black 30%); animation: saImgZoom 10s linear infinite alternate; }
@keyframes saImgZoom { from { transform: scale(1); } to { transform: scale(1.05); } }

/* Premium Dots */
.sa-slider-dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: 999px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); }
.sa-dot { width: 8px; height: 8px; background: rgba(255,255,255,0.4); border-radius: 50%; cursor: pointer; transition: all 0.4s cubic-bezier(0.32, 0.72, 0, 1.2); }
.sa-dot.active { width: 24px; background: #fff; border-radius: 999px; }

/* ══════════════════════════════════════════════════════════
   PREMIUM FLASH SALE (Horizontal Scroll)
   ══════════════════════════════════════════════════════════ */
.sa-flash-premium { padding: 40px 0; background: #fff; }
[data-theme="dark"] .sa-flash-premium { background: var(--bg-color); }
.sa-flash-icon-box { width: 36px; height: 36px; background: linear-gradient(135deg, #ff6b00, #ff9a3c); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 4px 12px rgba(255,107,0,0.3); }
.sa-cd-timer { display: flex; align-items: center; gap: 6px; margin-left: 8px; }

.sa-flash-slider-container { margin-top: 24px; overflow: hidden; padding-bottom: 8px; }
.sa-flash-slider { 
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 16px; scrollbar-width: none; 
  /* Allow card shadows to show */
  padding-top: 4px; margin-top: -4px;
}
.sa-flash-slider::-webkit-scrollbar { display: none; }
.sa-flash-slider .sa-prod-card { min-width: 220px; scroll-snap-align: start; flex: 0 0 220px; margin: 0; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .sa-hero-premium { padding: 12px 0; }
  .sa-slide-inner { padding: 24px 20px; min-height: 220px; }
  .sa-slide-content { max-width: 65%; }
  .sa-slide-badge { font-size: 9px; padding: 4px 10px; margin-bottom: 10px; }
  .sa-slide-h1 { font-size: 24px; margin-bottom: 8px; }
  .sa-slide-p { font-size: 12px; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; overflow: hidden; -webkit-box-orient: vertical; }
  .sa-slide-content .sa-btn-primary { padding: 8px 16px; font-size: 11px; }
  .sa-slide-img { width: 60%; }
  
  .sa-flash-premium { padding: 20px 0; }
  .sa-flash-slider { gap: 12px; padding-bottom: 16px; }
  .sa-flash-slider .sa-prod-card { min-width: 160px; flex: 0 0 160px; }
}

/* ══════════════════════════════════════════════════════════
   GLOBAL SLIDE-UP MODALS (iOS Native Style)
   ══════════════════════════════════════════════════════════ */
.sa-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 9999; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.sa-modal-overlay.active { opacity: 1; pointer-events: auto; }

.sa-modal-sheet {
  width: 100%; max-width: 600px; max-height: 90vh; background: #f2f2f7;
  border-radius: 24px 24px 0 0; padding: 24px 20px 40px;
  transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}
[data-theme="dark"] .sa-modal-sheet { background: #1c1c1e; }
.sa-modal-overlay.active .sa-modal-sheet { transform: translateY(0); }

.sa-modal-drag { width: 40px; height: 5px; background: #c7c7cc; border-radius: 10px; margin: 0 auto 20px; }
[data-theme="dark"] .sa-modal-drag { background: #48484a; }

.sa-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.sa-modal-title { font-size: 22px; font-weight: 800; color: #1c1c1e; }
[data-theme="dark"] .sa-modal-title { color: #fff; }
.sa-modal-close { background: #e5e5ea; color: #8e8e93; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
[data-theme="dark"] .sa-modal-close { background: #2c2c2e; }
.sa-modal-close:active { transform: scale(0.9); }

/* Modal Content Styling (Forms, Empty States) */
.sa-modal-form { display: flex; flex-direction: column; gap: 16px; }
.sa-form-group { display: flex; flex-direction: column; gap: 8px; }
.sa-form-group label { font-size: 14px; font-weight: 600; color: #3a3a3c; }
[data-theme="dark"] .sa-form-group label { color: #ebebf5; }
.sa-form-group input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.1); font-size: 16px; background: #fff; outline: none; transition: border-color 0.2s; }
[data-theme="dark"] .sa-form-group input { background: #2c2c2e; border-color: rgba(255,255,255,0.05); color: #fff; }
.sa-form-group input:focus { border-color: var(--primary); }

.sa-modal-btn { width: 100%; padding: 16px; background: var(--primary); color: #fff; border: none; border-radius: 16px; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform 0.2s; margin-top: 10px; }
.sa-modal-btn:active { transform: scale(0.96); }

/* Empty State Styling */
.sa-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.sa-empty-icon { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, rgba(255,107,0,0.1), rgba(255,107,0,0.2)); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 20px; }
.sa-empty-title { font-size: 20px; font-weight: 700; color: #1c1c1e; margin-bottom: 8px; }
[data-theme="dark"] .sa-empty-title { color: #fff; }
.sa-empty-p { font-size: 15px; color: #8e8e93; margin-bottom: 24px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════
   PREMIUM APPLE GLASS MODAL SYSTEM
   ══════════════════════════════════════════════════════════ */
.sa-glass-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
}
.sa-glass-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sa-glass-modal-box {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(35px) saturate(190%);
  -webkit-backdrop-filter: blur(35px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 24px;
  padding: 32px 24px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: scale(0.9) translateY(15px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  text-align: center;
  color: #1d1d1f;
  position: relative;
}
[data-theme="dark"] .sa-glass-modal-box {
  background: rgba(28, 28, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}
.sa-glass-modal-overlay.active .sa-glass-modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.sa-glass-modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d1d1f;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  font-size: 14px;
}
[data-theme="dark"] .sa-glass-modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
}
.sa-glass-modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .sa-glass-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.sa-glass-modal-close-btn:active {
  transform: scale(0.9);
}

.sa-glass-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.sa-glass-modal-icon.success {
  background: rgba(48, 209, 88, 0.12);
  color: #30d158;
}
.sa-glass-modal-icon.error {
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
}
.sa-glass-modal-icon.confirm {
  background: rgba(10, 132, 255, 0.12);
  color: #0a84ff;
}
.sa-glass-modal-icon.info {
  background: rgba(142, 142, 147, 0.12);
  color: #8e8e93;
}

.sa-glass-modal-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  color: inherit;
}
.sa-glass-modal-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #8e8e93;
  margin-bottom: 24px;
}
[data-theme="dark"] .sa-glass-modal-desc {
  color: #98989d;
}

.sa-glass-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.sa-glass-modal-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sa-glass-modal-btn:active {
  transform: scale(0.96);
}

.sa-glass-modal-btn.secondary {
  background: rgba(0, 0, 0, 0.05);
  color: #1d1d1f;
}
[data-theme="dark"] .sa-glass-modal-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
}
.sa-glass-modal-btn.secondary:hover {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .sa-glass-modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sa-glass-modal-btn.primary {
  background: var(--primary);
  color: #fff;
}
.sa-glass-modal-btn.primary:hover {
  background: var(--primary-dark);
}

.sa-glass-modal-btn.danger {
  background: #ff453a;
  color: #fff;
}
.sa-glass-modal-btn.danger:hover {
  background: #e03b30;
}

@media (max-width: 576px) {
  .sa-glass-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .sa-glass-modal-box {
    border-radius: 30px 30px 0 0;
    max-width: 100%;
    padding: 32px 24px calc(env(safe-area-inset-bottom) + 30px);
    transform: translateY(100%);
    border-left: none;
    border-right: none;
    border-bottom: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
  }
  .sa-glass-modal-overlay.active .sa-glass-modal-box {
    transform: translateY(0);
  }
}

/* ════════════════════════════════════════════════ */
/* 📱 DESKTOP CENTERED MOBILE LAYOUT CONTAINER       */
/* ════════════════════════════════════════════════ */
@media (min-width: 1025px) {
  html {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
  }
  html[data-theme="dark"] {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%) !important;
  }

  body {
    max-width: 430px; /* iPhone 14 Pro Max width */
    margin: 0 auto !important;
    position: relative;
    background-color: var(--bg-color) !important;
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.15) !important;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    
    /* Transform creates a containing block context for fixed/absolute elements */
    transform: translate3d(0, 0, 0);
  }

  [data-theme="dark"] body {
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.5) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
  }
}

/* ─── Premium Glass Floating Back Button ─── */
.sa-back-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  z-index: 10001; /* Above header (1000) and bottom nav (999) */
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.sa-back-btn:hover {
  background: rgba(255, 255, 255, 0.65);
  transform: scale(1.06);
}

.sa-back-btn:active {
  transform: scale(0.92);
}

body.sa-has-back-btn .sa-logo {
  margin-left: 46px; /* Adjust logo position to make space for the back button */
}

/* Dark Mode Overrides */
[data-theme="dark"] .sa-back-btn {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sa-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Authentication Loading Overlay */
#sa-auth-loader {
  position: fixed;
  inset: 0;
  z-index: 10002; /* Above bottom nav and header elements */
  background: rgba(242, 242, 247, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

[data-theme="dark"] #sa-auth-loader {
  background: rgba(0, 0, 0, 0.75);
}

#sa-auth-loader.active {
  opacity: 1;
  pointer-events: auto;
}


