/* ── DESIGN SYSTEM (Apple-Inspired Studio) ── */
:root {
  --color-primary: #0071e3;
  --color-primary-hover: #0077ed;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f7;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-border: rgba(0, 0, 0, 0.08);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-pill: 980px;
  --radius-card: 22px;
  --radius-small: 12px;
  --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --header-height: 48px;
  --container-width: 1020px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover {
  opacity: 0.8;
}

/* ── STICKY Frosted HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 22px;
  height: 100%;
}

.logo {
  color: #1d1d1f;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 44px;
  opacity: 0.8;
  transition: opacity var(--transition);
}
.logo:hover {
  opacity: 1;
}

.header-nav {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
  height: 100%;
}

.header-nav li {
  display: flex;
  align-items: center;
  height: 100%;
}

.header-nav a {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  height: 100%;
}
.header-nav a:hover {
  color: var(--color-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px; /* Control spacing between icon wrappers */
  height: 100%;
}

.nav-icon-wrapper,
.cart-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #1d1d1f;
  opacity: 0.8;
  transition: opacity var(--transition);
  cursor: pointer;
}

.nav-icon-wrapper svg,
.cart-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
}

.nav-icon-wrapper:hover,
.cart-icon:hover {
  opacity: 1;
}

.cart-icon {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #1d1d1f;
  color: white;
  font-size: 8px;
  font-weight: 600;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── APPLE HERO SECTIONS ── */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 55px 22px 0 22px;
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border-bottom: 12px solid white;
}

.hero-section.theme-dark {
  background: #000000;
  border-bottom: 12px solid #000;
}
.hero-section.theme-dark .hero-title,
.hero-section.theme-dark .hero-subhead {
  color: #f5f5f7;
}
.hero-section.theme-dark .hero-eyebrow {
  color: #86868b;
}

/* Soft Radial Gradients for Studio look */
.hero-section.gradient-studio-blue {
  background: radial-gradient(circle at center, #e3f2fd 0%, #f5f5f7 100%);
}
.hero-section.gradient-studio-purple {
  background: radial-gradient(circle at center, #ebdfff 0%, #f5f5f7 100%);
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.hero-title {
  font-size: clamp(38px, 6vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: #1d1d1f;
}

.hero-subhead {
  font-size: clamp(18px, 2.2vw, 21px);
  font-weight: 400;
  color: #1d1d1f;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 24px;
  z-index: 10;
}

.btn {
  font-size: 14px;
  font-weight: 400;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-secondary:hover {
  background-color: var(--color-primary);
  color: white;
}

.hero-section.theme-dark .btn-secondary {
  border-color: white;
  color: white;
}
.hero-section.theme-dark .btn-secondary:hover {
  background-color: white;
  color: black;
}

/* Floating Image */
.hero-product-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  object-fit: contain;
  margin-top: 12px;
  z-index: 1;
  /* Blends white image background into hero gradient — no visible border */
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 95%);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 95%);

  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.04));
  animation: floatEffect 5s ease-in-out infinite;
}

@keyframes floatEffect {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* ── PRODUCT GRID & CARDS ── */
.section {
  padding: 80px 22px;
  background-color: var(--color-bg);
}
.section-alt {
  background-color: var(--color-bg-alt);
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  max-width: var(--container-width);
  margin: 0 auto;
}

.product-card {
  background: white;
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: transform 0.4s cubic-bezier(0.15, 1, 0.3, 1), box-shadow 0.4s ease;
  box-shadow: 0 4px 18px rgba(0,0,0,0.03);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.03);
  /* Needed so mix-blend-mode works correctly against the card's own white background */
  isolation: isolate;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.08);
}

.product-card-img-wrapper {
  height: 180px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: transparent;
  border-radius: var(--radius-small);
  overflow: hidden;
}

.product-card-img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform var(--transition);
  /* Makes white image backgrounds invisible — blends into card background */
  mix-blend-mode: multiply;

  /* Ensure no hard pixel border on image edges */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.product-card:hover .product-card-img {
  transform: scale(1.04);
}

.product-card-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.product-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
  line-height: 1.3;
}

.product-card-price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-card-price {
  font-size: 16px;
  font-weight: 600;
}

.product-card-price-old {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: line-through;
}

.product-card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--color-sale);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* ── CART DRAWER ── */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.cart-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: white;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.15, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.1);
}
.cart-drawer.active {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-drawer-header h3 { font-size: 20px; font-weight: 600; }
.cart-drawer-close { background: none; border: none; font-size: 24px; cursor: pointer; }

.cart-drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
}

.cart-item {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}
.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}
.cart-item-details { flex-grow: 1; }
.cart-item-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-item-price { font-size: 14px; color: var(--color-text-secondary); }

.cart-drawer-footer {
  padding: 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ── ANIMATIONS ── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Cart item image blend */
.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: contain;

  background: transparent;
  mix-blend-mode: multiply;
}

/* ── SEARCH OVERLAY ── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
}
.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.search-overlay-inner {
  width: 100%;
  max-width: 680px;
  padding: 0 22px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 28px;
  font-weight: 600;
  font-family: var(--font-family);
  color: var(--color-text);
  outline: none;
  letter-spacing: -0.02em;
}
.search-box input::placeholder {
  color: #86868b;
}

.search-box svg {
  width: 24px;
  height: 24px;
  stroke: #86868b;
}

.search-close-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 17px;
  font-family: var(--font-family);
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-small);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
}
.search-result-item:hover {
  background: rgba(0,0,0,0.04);
}

.search-result-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
  mix-blend-mode: multiply;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-result-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}
.search-result-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}
.search-result-price {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.search-empty {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 15px;
  padding: 32px 0;
}

/* ── MOBILE NAV DRAWER ── */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: white;
  z-index: 301;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.15, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
}
.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--color-text-secondary);
  line-height: 1;
  padding: 0;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  overflow-y: auto;
  flex: 1;
}
.mobile-nav-link {
  padding: 14px 24px;
  font-size: 15px;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background var(--transition);
  letter-spacing: -0.01em;
}
.mobile-nav-link:hover {
  background: var(--color-bg-alt);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section { min-height: 480px; padding-top: 48px; }
  .header-nav { display: none; }
  .hero-title { font-size: 32px; }
  .hero-subhead { font-size: 17px; }
}
