/* ═══════════════════════════════════════════════════════════
   Empirical Skye — v3 Custom CSS
   Sky atmosphere, fog effects, glass morphism, animations
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ──────────────────────────────── */
:root {
  --midnight:    #0b1540;
  --sky-pastel:  #EAF4FF;
  --sky-mid:     #C8DEFF;
  --sky-deep:    #7EB0F5;
  --sky-top:     #EAF4FF;
  --fog-white:   rgba(255, 255, 255, 0.72);
  --glass-bg:    rgba(255, 255, 255, 0.65);
  --glass-border:rgba(255, 255, 255, 0.45);
  --shadow-soft: 0 4px 32px rgba(11, 21, 64, 0.10);
  --shadow-card: 0 2px 16px rgba(11, 21, 64, 0.08);
  --radius-xl:   1.25rem;
  --radius-2xl:  1.5rem;
}

/* ─── Base / Body ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: #1e2a4a;
  min-height: 100vh;
  background: linear-gradient(
    180deg,
    var(--sky-top, #EAF4FF) 0%,
    #ddf0ff 38%,
    #c8e6f7 62%,
    #e8f4f0 78%,
    #f5f0e8 100%
  );
  background-attachment: fixed;
}

body.es-sky-tint {
  transition: background 0.6s ease;
}

/* ─── Sky Canvas (fog layer) ─────────────────────────────── */
#sky-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* Ensure all content sits above canvas */
#site-header, main, footer {
  position: relative;
  z-index: 1;
}

/* ─── Parallax Cloud Layers ──────────────────────────────── */
.es-cloud-layer {
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
  will-change: transform;
  opacity: 0.22;
  background-repeat: repeat-x;
  background-size: auto 100%;
}

.es-hero-clouds {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Pure CSS animated cloud bands */
.es-cloud-band {
  position: absolute;
  left: -50%;
  width: 200%;
  border-radius: 50%;
  background: radial-gradient(ellipse 60% 30% at 50% 50%,
    rgba(255,255,255,0.55) 0%,
    rgba(220,237,255,0.3) 40%,
    transparent 70%
  );
  animation: driftCloud linear infinite;
}
.es-cloud-band:nth-child(1) { top: 6%;  height: 80px;  animation-duration: 38s; opacity: 0.7; }
.es-cloud-band:nth-child(2) { top: 18%; height: 60px;  animation-duration: 55s; animation-direction: reverse; opacity: 0.5; }
.es-cloud-band:nth-child(3) { top: 32%; height: 100px; animation-duration: 44s; opacity: 0.4; animation-delay: -12s; }
.es-cloud-band:nth-child(4) { top: 52%; height: 50px;  animation-duration: 62s; animation-direction: reverse; opacity: 0.3; animation-delay: -8s; }

@keyframes driftCloud {
  from { transform: translateX(0); }
  to   { transform: translateX(25%); }
}

/* ─── Header ─────────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 80px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(126, 176, 245, 0.25);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#site-header.es-header-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 24px rgba(11, 21, 64, 0.10);
  border-bottom-color: rgba(126, 176, 245, 0.45);
}

.es-logo:hover {
  filter: drop-shadow(0 0 8px rgba(126, 176, 245, 0.55));
  transform: scale(1.03);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.es-nav-link {
  position: relative;
  font-weight: 500;
  color: #1e2a4a;
  text-decoration: none;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}
.es-nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #7EB0F5, #0b1540);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}
.es-nav-link:hover { color: var(--midnight); }
.es-nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.es-nav-link.active::after { transform: scaleX(1); }

/* ─── Glass Morphism Cards ───────────────────────────────── */
.es-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
}

.es-glass-dark {
  background: rgba(11, 21, 64, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(126, 176, 245, 0.2);
  border-radius: var(--radius-2xl);
}

/* ─── World Category Cards ───────────────────────────────── */
.es-world-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.25,.8,.25,1),
              box-shadow 0.35s ease;
  will-change: transform;
}
.es-world-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 16px 48px rgba(11, 21, 64, 0.22);
}

.es-world-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(.25,.8,.25,1);
}
.es-world-card:hover img {
  transform: scale(1.06);
}

/* Permanent dark gradient for text legibility */
.es-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(11, 21, 64, 0.78) 0%,
    rgba(11, 21, 64, 0.18) 45%,
    transparent 70%
  );
  transition: opacity 0.35s ease;
}

/* Fog reveal that rises on hover */
.es-card-fog {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  background: radial-gradient(
    ellipse 90% 55% at 50% 100%,
    rgba(200, 225, 255, 0.35) 0%,
    rgba(180, 210, 255, 0.18) 50%,
    transparent 80%
  );
  pointer-events: none;
}

.es-world-card:hover .es-card-fog {
  opacity: 1;
  transform: translateY(0);
}

/* Shimmer ring on hover */
.es-world-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-2xl);
  box-shadow: inset 0 0 0 1.5px rgba(200, 225, 255, 0);
  transition: box-shadow 0.35s ease;
}
.es-world-card:hover::after {
  box-shadow: inset 0 0 0 1.5px rgba(200, 225, 255, 0.45);
}

/* ─── Product Cards ──────────────────────────────────────── */
.es-product-card {
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(126, 176, 245, 0.18);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}
.es-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(11, 21, 64, 0.14);
  border-color: rgba(126, 176, 245, 0.4);
}
.es-product-card:hover .es-product-img {
  transform: scale(1.04);
}

.es-product-img {
  transition: transform 0.4s cubic-bezier(.25,.8,.25,1);
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ─── Buttons ────────────────────────────────────────────── */
.es-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  background: var(--midnight);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  text-decoration: none;
}
.es-btn-primary:hover {
  background: #122068;
  box-shadow: 0 4px 18px rgba(11, 21, 64, 0.30);
  transform: translateY(-1px);
}
.es-btn-primary:active { transform: translateY(0); }

.es-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.8);
  color: var(--midnight);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid rgba(11, 21, 64, 0.14);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  text-decoration: none;
  backdrop-filter: blur(8px);
}
.es-btn-ghost:hover {
  background: #EAF4FF;
  border-color: rgba(126, 176, 245, 0.5);
  transform: translateY(-1px);
}

.es-btn-sky {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #7EB0F5 0%, #5a93e8 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.es-btn-sky:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(94, 147, 232, 0.4);
  transform: translateY(-1px);
}

/* ─── Tags / Pills ───────────────────────────────────────── */
.es-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(234, 244, 255, 0.9);
  color: var(--midnight);
  border: 1px solid rgba(126, 176, 245, 0.3);
  letter-spacing: 0.01em;
}

.es-world-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255,255,255,0.75);
  color: var(--midnight);
  border: 1px solid rgba(11, 21, 64, 0.12);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  backdrop-filter: blur(6px);
}
.es-world-pill:hover, .es-world-pill.active {
  background: var(--midnight);
  color: #fff;
  border-color: var(--midnight);
  transform: translateY(-1px);
}

/* ─── Entrance Reveal Animations ────────────────────────── */
[data-sky-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(.25,.8,.25,1);
}
[data-sky-reveal].sky-revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-sky-reveal][data-delay="100"] { transition-delay: 0.1s; }
[data-sky-reveal][data-delay="200"] { transition-delay: 0.2s; }
[data-sky-reveal][data-delay="300"] { transition-delay: 0.3s; }
[data-sky-reveal][data-delay="400"] { transition-delay: 0.4s; }
[data-sky-reveal][data-delay="500"] { transition-delay: 0.5s; }

/* ─── Hero Section ───────────────────────────────────────── */
.es-hero {
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.es-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    #EAF4FF 0%,
    #D8EDFF 30%,
    #EFF8FF 60%,
    #ffffff 100%
  );
  z-index: 0;
}

/* ─── Mission / Feature Cards ────────────────────────────── */
.es-feature-card {
  border-radius: var(--radius-2xl);
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 225, 255, 0.5);
  box-shadow: 0 2px 24px rgba(11, 21, 64, 0.07);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
.es-feature-card:hover {
  box-shadow: 0 8px 40px rgba(11, 21, 64, 0.12);
}

.es-mission-card {
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg,
    rgba(255,255,255,0.9) 0%,
    rgba(234,244,255,0.75) 100%
  );
  backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 225, 255, 0.6);
  box-shadow: 0 2px 24px rgba(11, 21, 64, 0.07);
}

/* ─── Cart Drawer ────────────────────────────────────────── */
.es-drawer {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 380px;
  max-width: 100vw;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(200, 225, 255, 0.5);
  box-shadow: -8px 0 48px rgba(11, 21, 64, 0.16);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(.25,.8,.25,1);
  will-change: transform;
}
.es-drawer.open {
  transform: translateX(0);
}

.es-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 21, 64, 0.35);
  backdrop-filter: blur(2px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.es-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Product Modal ──────────────────────────────────────── */
.es-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 21, 64, 0.45);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.es-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.es-modal {
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(200, 225, 255, 0.5);
  box-shadow: 0 24px 80px rgba(11, 21, 64, 0.25);
  max-width: min(960px, 94vw);
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.35s cubic-bezier(.25,.8,.25,1);
  will-change: transform;
}
.es-modal-overlay.open .es-modal {
  transform: scale(1) translateY(0);
}

/* ─── Toast Notifications ────────────────────────────────── */
.es-toast-wrap {
  position: fixed;
  top: 1.25rem; right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.es-toast {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(200, 225, 255, 0.6);
  box-shadow: 0 4px 20px rgba(11, 21, 64, 0.12);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--midnight);
  animation: toastIn 0.3s cubic-bezier(.25,.8,.25,1);
  pointer-events: auto;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.es-toast-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--midnight);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* ─── Search Input ───────────────────────────────────────── */
.es-search {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(126, 176, 245, 0.3);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  font-size: 0.9rem;
  color: var(--midnight);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.es-search:focus {
  border-color: rgba(126, 176, 245, 0.65);
  box-shadow: 0 0 0 3px rgba(126, 176, 245, 0.18);
}

.es-search-wrap {
  position: relative;
  max-width: 340px;
}
.es-search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.45;
}

/* ─── Footer ─────────────────────────────────────────────── */
.es-footer {
  background: linear-gradient(180deg, rgba(11,21,64,0.97) 0%, #060c24 100%);
  border-top: 1px solid rgba(126, 176, 245, 0.15);
  position: relative;
  overflow: hidden;
}

.es-footer::before {
  content: '';
  position: absolute;
  top: -60px; left: 0; right: 0;
  height: 80px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%,
    rgba(126, 176, 245, 0.12) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* ─── Made-to-order badge ────────────────────────────────── */
.es-mto-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(245, 200, 80, 0.15);
  color: #b07800;
  border: 1px solid rgba(245, 200, 80, 0.35);
}

/* ─── Scroll-to-top button ───────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 80;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(126, 176, 245, 0.35);
  box-shadow: 0 4px 16px rgba(11, 21, 64, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  color: var(--midnight);
}
#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#scroll-top:hover {
  background: var(--midnight);
  color: #fff;
}

/* ─── Loading skeleton ───────────────────────────────────── */
.es-skeleton {
  background: linear-gradient(90deg,
    rgba(200,225,255,0.35) 25%,
    rgba(220,238,255,0.6) 50%,
    rgba(200,225,255,0.35) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-xl);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ─── Page-level sky gradient (used on <main>) ───────────── */
.es-sky-page {
  background: linear-gradient(
    180deg,
    rgba(234, 244, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.0) 60%
  );
}

/* ─── Focus ring (accessibility) ────────────────────────── */
:focus-visible {
  outline: 2px solid #7EB0F5;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .es-drawer { width: 100vw; }
  .es-modal  { max-height: 96vh; }
  #sky-canvas { opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  #sky-canvas { display: none; }
  [data-sky-reveal] {
    opacity: 1;
    transform: none;
  }
}
