/* ============================================================
   MAI ME - Minimal fashion store (Zara-inspired)
   ============================================================ */

:root {
  --black: #14110f;
  --white: #fff;
  --paper: #f4f1ec;
  --grey: #8a8279;
  --line: #e4dfd7;
  --sale: #b12a1b;
  --header-h: 60px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Playfair Display", "Times New Roman", Times, Georgia, serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-block-start: var(--header-h); /* anchors don't hide under fixed header */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.4;
}

::selection { background: var(--black); color: var(--white); }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Keyboard focus only - never on mouse click. */
:focus { outline: none; }
:focus-visible { outline: 1.5px solid var(--black); outline-offset: 3px; }
.site-header :focus-visible,
.hero :focus-visible { outline-color: currentColor; }

.link-btn {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 2px;
  white-space: nowrap;
  transition: opacity 0.2s var(--ease);
}
.link-btn:hover { opacity: 0.55; }

/* Thin line icons (Zara-style) */
.icon-link {
  display: inline-grid;
  place-items: center;
  padding: 4px;
  position: relative;
  transition: opacity 0.2s var(--ease);
}
.icon-link:hover { opacity: 0.55; }
.icon-link svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* ---------------- Header ---------------- */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-inline: clamp(16px, 3vw, 40px);
  color: var(--black);
  background: transparent;
  border-block-end: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}
/* Any scroll → clean solid white bar (over the hero's white top gutter it's seamless). */
.site-header.scrolled {
  background: var(--white);
  border-block-end-color: var(--line);
}
.header-left { display: flex; align-items: center; gap: 26px; }
.header-actions { flex-direction: row; align-items: center; gap: clamp(12px, 1.4vw, 20px); }
.actions-cluster { display: contents; }

.main-nav { display: none; } /* Zara-style: navigation lives in the hamburger menu */
.main-nav ul { display: flex; gap: 22px; list-style: none; }
.main-nav a {
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 500;
  padding-block: 4px;
  position: relative;
}
.main-nav a::after {
  content: "";
  position: absolute;
  inset-block-end: -2px;
  inset-inline: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}
.main-nav a:hover::after { transform: scaleX(1); }
.site-header.scrolled .nav-sale { color: var(--sale); }

.brand {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-indent: 0.18em; /* balance the trailing letter-spacing so it stays optically centred */
  text-align: center;
  white-space: nowrap;
  opacity: 0;               /* the giant wordmark is the brand while over the hero */
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.site-header.scrolled .brand { opacity: 1; pointer-events: auto; }

.header-actions { display: flex; justify-content: flex-end; }

.bag-count {
  position: absolute;
  inset-block-start: -3px;
  inset-inline-end: -5px;
  font-size: 9px;
  line-height: 15px;
  min-width: 15px;
  height: 15px;
  padding-inline: 3px;
  text-align: center;
  border-radius: 999px;
  background: var(--sale);
  color: #fff;
  font-weight: 500;
  letter-spacing: 0;
  transition: transform 0.2s var(--ease);
}
.bag-count.pulse { transform: scale(1.35); }

.menu-btn { display: flex; flex-direction: column; gap: 5px; padding: 8px 8px 8px 0; }
.menu-btn span { width: 22px; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease), opacity 0.3s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------------- Mobile menu ---------------- */
.mobile-menu {
  position: fixed;
  inset-block-start: var(--header-h);
  inset-inline: 0;
  z-index: 90;
  background: var(--white);
  transform: translateY(-120%);
  transition: transform 0.4s var(--ease);
  border-block-end: 1px solid var(--line);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu ul { list-style: none; padding: 8px 24px 24px; }
.mobile-menu a {
  display: block;
  padding: 16px 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-block-end: 1px solid var(--line);
}
.mobile-menu-secondary { padding-block-start: 8px; }
.mobile-menu-secondary a { font-size: 14px; font-weight: 400; color: var(--grey); }

/* ---------------- Search overlay ---------------- */
.search-overlay {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 110;
  background: var(--white);
  border-block-end: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform 0.35s var(--ease);
}
.search-overlay.open { transform: translateY(0); }
.search-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding-inline: 24px;
}
.search-inner input {
  flex: 1 1 auto;
  min-inline-size: 0;
  border: none;
  font-size: 22px;
  letter-spacing: 0.05em;
  font-family: inherit;
  outline: none;
  text-transform: uppercase;
}
.search-inner input::placeholder { color: var(--line); }

/* ---------------- Hero showcase (Zara editorial) ---------------- */
.hero {
  position: relative;
  height: 100dvh;
  min-height: 560px;
  background: var(--white);
  /* White gutters frame the image; top clears the header, bottom clears arrows. */
  padding: clamp(56px, 8vh, 92px) clamp(16px, 3vw, 40px) clamp(56px, 8vh, 88px);
  overflow: hidden;
}
.hero-frame {
  position: relative;
  height: 100%;
  overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s var(--ease);
}
.slide.is-active { opacity: 1; visibility: visible; }

.slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Barely-there slow zoom - calm, editorial, no shaking. */
.slide.is-active .slide-img { animation: slow-zoom 12s ease-out both; }
@keyframes slow-zoom {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

/* Small editorial kicker, top-left of the frame. */
.hero-kicker {
  position: absolute;
  inset-block-start: clamp(20px, 3vw, 34px);
  inset-inline-start: clamp(20px, 3vw, 40px);
  z-index: 4;
  color: var(--white);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  mix-blend-mode: difference;
}

/* The oversized serif brand, sitting on top of the image. */
.hero-wordmark {
  position: absolute;
  inset-block-end: -0.12em;
  inset-inline: 0;
  text-align: center;
  z-index: 4;
  pointer-events: none;
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  color: var(--white);
  mix-blend-mode: difference; /* always legible on any image */
  line-height: 0.8;
  letter-spacing: 0.01em;
  font-size: clamp(96px, 24vw, 400px);
  white-space: nowrap;
  animation: wordmark-in 1.1s var(--ease) both;
}
@keyframes wordmark-in {
  from { opacity: 0; transform: translateY(4%); letter-spacing: 0.12em; }
  to   { opacity: 1; transform: none; letter-spacing: 0.01em; }
}

.hero-controls {
  position: absolute;
  inset-block-end: clamp(18px, 3.5vh, 36px);
  inset-inline: clamp(20px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: difference;
  color: var(--white);
}
.hero-nav { display: flex; align-items: center; gap: 16px; pointer-events: auto; }
.hero-nav button {
  color: inherit;
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.hero-nav button:hover { opacity: 0.5; }
#heroPrev:hover { transform: translateX(-5px); }
#heroNext:hover { transform: translateX(5px); }
.hero-index { font-size: 11px; letter-spacing: 0.18em; min-width: 56px; text-align: center; }
.hero-cta {
  pointer-events: auto;
  color: inherit;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-block-end: 4px;
  border-block-end: 1px solid currentColor;
  transition: opacity 0.2s var(--ease);
}
.hero-cta:hover { opacity: 0.6; }

.btn-outline {
  display: inline-block;
  padding: 13px 34px;
  border: 1px solid var(--white);
  color: var(--white);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.05);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.btn-outline:hover { background: var(--white); color: var(--black); }
.btn-outline.dark { border-color: var(--black); color: var(--black); background: transparent; }
.btn-outline.dark:hover { background: var(--black); color: var(--white); }

/* ---------------- Split categories ---------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split-card { position: relative; overflow: hidden; aspect-ratio: 4 / 5; }
.split-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.split-card:hover img { transform: scale(1.05); }
/* Subtle bottom scrim keeps the label legible on any image. */
.split-card::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent);
  pointer-events: none;
}
.split-label {
  position: absolute;
  inset-block-end: clamp(24px, 4vw, 44px);
  inset-inline-start: clamp(20px, 3vw, 44px);
  z-index: 1;
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.split-label em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 4.5vw, 56px);
  line-height: 1;
}
.split-label > span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  position: relative;
  padding-block-end: 5px;
}
.split-label > span::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 28px;
  height: 1px;
  background: currentColor;
  transition: width 0.45s var(--ease);
}
.split-card:hover .split-label > span::after { width: 100%; }

/* ---------------- Manifesto ---------------- */
.manifesto {
  background: var(--paper);
  text-align: center;
  padding: clamp(80px, 13vw, 170px) clamp(20px, 6vw, 80px);
}
.manifesto-eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey);
  margin-block-end: clamp(24px, 3vw, 38px);
}
.manifesto-text {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5.2vw, 68px);
  line-height: 1.12;
  letter-spacing: 0.005em;
}
.manifesto-text em { font-style: italic; }
.manifesto-sub {
  max-inline-size: 40ch;
  margin: clamp(26px, 3vw, 40px) auto 0;
  color: var(--grey);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

/* ---------------- Section / product grid ---------------- */
.section { padding: clamp(64px, 9vw, 120px) clamp(16px, 3vw, 40px); }
.section-head {
  text-align: center;
  margin-block-end: clamp(40px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.section-index { font-size: 11px; letter-spacing: 0.22em; color: var(--grey); }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1;
  letter-spacing: 0.01em;
}
.section-title em { font-style: italic; }
.section-sub { color: var(--grey); font-size: 13px; letter-spacing: 0.03em; }
.section-link {
  margin-block-start: 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block-end: 4px;
  border-block-end: 1px solid var(--black);
  transition: gap 0.25s var(--ease);
}
.section-link:hover { gap: 14px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* fixed columns so items never shrink or orphan */
  gap: clamp(32px, 4vw, 52px) clamp(8px, 1.2vw, 16px);
}
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.product { position: relative; }
.product-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f4f4f4;
  display: block;
}
.product-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s var(--ease);
}
.product-media .img-hover { opacity: 0; }
.product-media:hover .img-hover { opacity: 1; }

.product-tag {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--black);
  text-transform: uppercase;
}
.product-tag.sale { color: var(--sale); }

.add-btn {
  position: absolute;
  inset-block-end: 10px;
  inset-inline: 10px;
  z-index: 2;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
  color: var(--black);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              background 0.2s var(--ease), color 0.2s var(--ease);
}
.product-media:hover .add-btn,
.add-btn:focus-visible { opacity: 1; transform: translateY(0); }
.add-btn:hover { background: var(--black); color: var(--white); }
/* Touch devices: no hover, so always show the action. */
@media (hover: none) {
  .add-btn { opacity: 1; transform: none; }
}

.product-info { padding: 14px 2px 4px; display: flex; flex-direction: column; gap: 4px; }
.product-name { font-size: 13px; letter-spacing: 0.02em; }
.product-price { font-size: 13px; color: var(--grey); }
.product-price .old { color: var(--grey); text-decoration: line-through; margin-inline-end: 8px; }
.product-price .new { color: var(--sale); }

/* ---------------- Campaign band ---------------- */
.campaign { position: relative; overflow: hidden; }
.campaign-img { width: 100%; height: min(92vh, 860px); object-fit: cover; }
.campaign::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.5), rgba(0,0,0,0.12) 42%, transparent 68%);
  pointer-events: none;
}
.campaign-text {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: clamp(24px, 7vw, 110px);
  transform: translateY(-50%);
  z-index: 1;
  max-inline-size: 460px;
  color: var(--white);
}
.campaign-eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.85;
}
.campaign-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 8vw, 108px);
  line-height: 0.98;
  letter-spacing: 0.005em;
  margin-block: 18px 22px;
}
.campaign-title em { font-style: italic; }
.campaign-text p { font-size: 15px; line-height: 1.6; margin-block-end: 28px; opacity: 0.92; }

/* Underline link utility */
.link-underline {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-block-end: 5px;
  border-block-end: 1px solid currentColor;
  transition: opacity 0.2s var(--ease);
}
.link-underline:hover { opacity: 0.6; }
.link-underline.light { color: var(--white); }

/* ---------------- Sale strip ---------------- */
.sale-strip { background: var(--black); color: var(--white); overflow: hidden; padding-block: clamp(20px, 3vw, 34px); }
.marquee { display: flex; width: max-content; animation: scroll 34s linear infinite; }
.marquee span {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 3.4vw, 46px);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.sale-strip:hover .marquee { animation-play-state: paused; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--paper); padding: clamp(48px, 7vw, 88px) clamp(20px, 4vw, 56px) 28px; }
.footer-wordmark {
  display: block;
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 16vw, 220px);
  line-height: 0.9;
  letter-spacing: 0.02em;
  margin-block-end: clamp(40px, 6vw, 80px);
  transition: opacity 0.25s var(--ease);
}
.footer-wordmark:hover { opacity: 0.65; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 40px;
  max-inline-size: 1200px;
  margin-inline: auto;
}
.footer-cols h3 { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; margin-block-end: 18px; }
.footer-cols a { display: block; font-size: 13px; color: var(--grey); padding-block: 5px; transition: color 0.2s; }
.footer-cols a:hover { color: var(--black); }
.newsletter p { font-size: 13px; color: var(--grey); margin-block-end: 14px; }
.newsletter form { display: flex; border-block-end: 1px solid var(--black); }
.newsletter input { flex: 1 1 auto; min-inline-size: 0; border: none; padding: 8px 0; font-family: inherit; font-size: 14px; outline: none; background: transparent; }
.newsletter button { font-size: 20px; padding-inline: 8px; }
.newsletter-msg { color: var(--black); font-weight: 500; min-height: 1.2em; }
.footer-bottom {
  max-inline-size: 1200px;
  margin: 56px auto 0;
  padding-block-start: 20px;
  border-block-start: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--grey);
}

/* ---------------- Cart drawer ---------------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,0.35);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 130;
  width: min(420px, 100%);
  background: var(--white);
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-block-end: 1px solid var(--line);
}
.cart-head h2 { font-size: 14px; letter-spacing: 0.1em; }
.cart-items { flex: 1 1 auto; overflow-y: auto; padding: 8px 24px; }
.cart-empty { color: var(--grey); font-size: 13px; padding-block: 40px; text-align: center; }

.cart-row { display: flex; gap: 14px; padding-block: 18px; border-block-end: 1px solid var(--line); }
.cart-row img { width: 74px; height: 96px; object-fit: cover; flex: 0 0 auto; background: #f4f4f4; }
.cart-row-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
.cart-row-info .name { font-size: 13px; }
.cart-row-info .price { font-size: 13px; color: var(--grey); }
.cart-qty { display: flex; align-items: center; gap: 12px; margin-block-start: auto; }
.cart-qty button { width: 24px; height: 24px; border: 1px solid var(--line); font-size: 14px; display: grid; place-items: center; transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.cart-qty button:hover { border-color: var(--black); }
.cart-remove { font-size: 11px; letter-spacing: 0.06em; color: var(--grey); text-decoration: underline; text-underline-offset: 2px; align-self: flex-start; transition: color 0.2s var(--ease); }
.cart-remove:hover { color: var(--black); }

.cart-foot { padding: 20px 24px; border-block-start: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; font-size: 14px; letter-spacing: 0.06em; margin-block-end: 16px; }
.btn-solid {
  width: 100%; padding: 15px; background: var(--black); color: var(--white);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  transition: opacity 0.2s;
}
.btn-solid:hover { opacity: 0.85; }

/* ---------------- Reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
/* Gentle per-column stagger across a row of products. */
.product-grid .product:nth-child(4n+2) { transition-delay: 0.07s; }
.product-grid .product:nth-child(4n+3) { transition-delay: 0.14s; }
.product-grid .product:nth-child(4n+4) { transition-delay: 0.21s; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  /* Compact mobile header: hamburger · brand · bag. Search/login/help live in the menu. */
  .site-header,
  .site-header.scrolled { padding: 14px 16px; align-items: center; min-height: var(--header-h); }
  .header-actions,
  .site-header.scrolled .header-actions,
  .actions-cluster,
  .site-header.scrolled .actions-cluster { flex-direction: row; align-items: center; gap: 14px; }
  .search-btn,
  .actions-cluster .icon-link:not(.bag-btn) { display: none; }
  .brand { font-size: 20px; }

  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .section { padding: 48px 16px; }
  .editorial-text { inset-inline: 24px; max-inline-size: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto; }
}
