/* ————————————————————————————————
   Maison D'amir — luxury storefront
   ———————————————————————————————— */

:root {
  --bg: #faf8f4;
  --bg-alt: #f2eee7;
  --ink: #1a1815;
  --ink-soft: #6b655c;
  --line: #e3ddd2;
  --accent: #9a7b4f;
  --accent-dark: #7d6340;
  --white: #ffffff;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', 'Helvetica Neue', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 64px;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ——— Announcement ——— */
#announcement-bar {
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 9px 16px;
}

/* ——— Header ——— */
#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.header-nav { display: flex; gap: 28px; align-items: center; }
.header-nav.left { justify-content: flex-start; }
.header-nav.right { justify-content: flex-end; }

.header-nav a, .cart-label {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
}

.header-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.header-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.icon-btn {
  background: none;
  border: none;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
}

.cart-count {
  background: var(--accent);
  color: var(--white);
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* mobile menu */
#menu-toggle { display: none; flex-direction: column; gap: 5px; }
.menu-line { width: 20px; height: 1px; background: var(--ink); display: block; }

.mobile-menu {
  position: fixed;
  inset: calc(var(--header-h) + 33px) 0 auto 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 49;
  display: flex;
  flex-direction: column;
  padding: 12px 28px 24px;
}
.mobile-menu a {
  padding: 14px 0;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

/* ——— Layout helpers ——— */
.container { max-width: 1400px; margin: 0 auto; padding: 0 28px; }

.section-title {
  text-align: center;
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 8px;
}
.section-sub {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 48px;
}

/* ——— Buttons ——— */
.btn {
  display: inline-block;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 16px 42px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), opacity 0.3s;
  text-align: center;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-full { width: 100%; display: block; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: calc(92vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(160deg, #efe9df 0%, #faf8f4 55%, #ece5d8 100%);
}
.hero-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  opacity: 0.9;
}
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26,24,21,0.1), rgba(26,24,21,0.42));
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 60px 24px;
  animation: fadeUp 1.1s var(--ease) both;
}
.hero.has-image .hero-content { color: var(--white); }
.hero-kicker {
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0.85;
}
.hero-title {
  font-size: clamp(44px, 8vw, 96px);
  font-weight: 500;
  margin-bottom: 28px;
}
.hero-title em { font-style: italic; font-weight: 400; }
.hero .btn { backdrop-filter: blur(2px); }
.hero.has-image .btn { border-color: var(--white); color: var(--white); }
.hero.has-image .btn:hover { background: var(--white); color: var(--ink); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— Launch page ——— */
/* While the store is closed there is nothing to browse, so the shop chrome
   steps aside and the page becomes a single invitation. */
body.store-locked .header-nav,
body.store-locked #menu-toggle,
body.store-locked #cart-toggle,
body.store-locked .footer-links { display: none !important; }

body.store-locked .header-inner { grid-template-columns: 1fr; justify-items: center; }

.coming-soon {
  min-height: calc(88vh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 28px;
  background: linear-gradient(160deg, #efe9df 0%, #faf8f4 55%, #ece5d8 100%);
  animation: fadeUp 1s var(--ease) both;
}
.coming-soon h1 {
  font-size: clamp(48px, 9vw, 104px);
  font-weight: 500;
  margin-bottom: 22px;
}
.coming-soon h1 em { font-style: italic; font-weight: 400; }
.coming-sub {
  color: var(--ink-soft);
  max-width: 440px;
  font-size: 15px;
  margin-bottom: 34px;
}

.notify-form {
  display: flex;
  gap: 10px;
  width: min(460px, 100%);
}
.notify-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 16px 18px;
  transition: border-color 0.25s;
}
.notify-form input:focus { outline: none; border-color: var(--ink); }
.notify-form .btn { padding: 16px 26px; white-space: nowrap; }

.notify-msg {
  margin-top: 18px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
}
.notify-msg.error { color: #a5453b; }

@media (max-width: 520px) {
  .notify-form { flex-direction: column; }
  .notify-form .btn { width: 100%; }
}

/* ——— Product grid ——— */
.shop-section { padding: 90px 0 110px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 40px 28px;
}

.product-card {
  display: block;
  animation: fadeUp 0.7s var(--ease) both;
}
.product-card:nth-child(2) { animation-delay: 0.06s; }
.product-card:nth-child(3) { animation-delay: 0.12s; }
.product-card:nth-child(4) { animation-delay: 0.18s; }

.card-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-alt);
  margin-bottom: 16px;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), opacity 0.5s;
}
.product-card:hover .card-media img.primary { transform: scale(1.05); }
.card-media img.secondary {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.product-card:hover .card-media img.secondary { opacity: 1; transform: scale(1.05); }

.card-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 6px 12px;
}

.card-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}
.card-price { color: var(--ink-soft); font-size: 13px; letter-spacing: 0.08em; margin-top: 2px; }
.card-price .compare { text-decoration: line-through; margin-left: 8px; opacity: 0.6; }

/* ——— Editorial band ——— */
.editorial {
  background: var(--ink);
  color: var(--bg);
  padding: 110px 28px;
  text-align: center;
}
.editorial h2 {
  font-size: clamp(30px, 5vw, 52px);
  max-width: 720px;
  margin: 0 auto 18px;
  font-weight: 400;
}
.editorial h2 em { font-style: italic; color: #cbb491; }
.editorial p {
  color: #b8b2a8;
  max-width: 520px;
  margin: 0 auto 36px;
  font-size: 15px;
}
.editorial .btn { border-color: var(--bg); color: var(--bg); }
.editorial .btn:hover { background: var(--bg); color: var(--ink); }

/* ——— Product page ——— */
.product-page {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  padding: 56px 0 110px;
  align-items: start;
}

.product-page > * { min-width: 0; }

.gallery { position: sticky; top: calc(var(--header-h) + 24px); }
.gallery-main {
  aspect-ratio: 3 / 4;
  background: var(--bg-alt);
  overflow: hidden;
  position: relative;
}
.gallery-main img {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: imgFade 0.5s var(--ease) both;
}
@keyframes imgFade { from { opacity: 0; } to { opacity: 1; } }

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-thumbs button {
  flex: 0 0 72px;
  aspect-ratio: 3 / 4;
  border: 1px solid transparent;
  padding: 0;
  background: var(--bg-alt);
  overflow: hidden;
  transition: border-color 0.3s;
}
.gallery-thumbs button.active { border-color: var(--ink); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info { padding-top: 8px; }
.product-vendor {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.product-title { font-size: clamp(30px, 4vw, 44px); margin-bottom: 14px; }
.product-price { font-size: 17px; letter-spacing: 0.06em; margin-bottom: 32px; }
.product-price .compare { text-decoration: line-through; color: var(--ink-soft); margin-left: 10px; }

.option-group { margin-bottom: 28px; }
.option-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}
.option-label .selected-value { color: var(--ink-soft); text-transform: none; letter-spacing: 0.05em; margin-left: 8px; }

.option-values { display: flex; flex-wrap: wrap; gap: 10px; }

.option-btn {
  border: 1px solid var(--line);
  background: var(--white);
  min-width: 52px;
  padding: 12px 18px;
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: border-color 0.25s, background 0.25s, color 0.25s, opacity 0.25s;
}
.option-btn:hover { border-color: var(--ink); }
.option-btn.selected { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.option-btn.unavailable {
  opacity: 0.35;
  text-decoration: line-through;
  cursor: not-allowed;
}

.swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  padding: 0;
  position: relative;
  transition: transform 0.25s var(--ease);
}
.swatch::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.25s;
}
.swatch.selected::after { border-color: var(--ink); }
.swatch:hover { transform: scale(1.08); }

.qty-row { display: flex; gap: 14px; margin: 6px 0 14px; }
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--white);
}
.qty-control button {
  width: 44px; height: 52px;
  background: none; border: none;
  font-size: 18px;
  color: var(--ink);
}
.qty-control span { min-width: 32px; text-align: center; font-size: 14px; }

.add-to-cart { flex: 1; }

.product-desc {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14.5px;
}
.product-desc.plain { white-space: pre-line; }
.product-desc p { margin-bottom: 12px; }

/* spec list — "Key: Value" lines from the description */
.product-specs { margin-bottom: 24px; }
.spec-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.spec-row:last-child { border-bottom: none; }
.spec-row dt {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.spec-row dd { margin: 0; font-size: 13.5px; color: var(--ink); }

/* size guide — horizontal chart in a box */
.size-guide {
  margin-top: 30px;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 24px 24px 20px;
}
.size-guide-title {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
}
.size-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.size-guide table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
}
.size-guide td, .size-guide th {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  background: var(--white);
}
.size-guide td:first-child, .size-guide th:first-child {
  text-align: left;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg-alt);
}
.size-guide tr:first-child td, .size-guide tr:first-child th {
  background: var(--bg-alt);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.size-guide tr:nth-child(2) td {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.swatch { width: 40px; height: 40px; }

.availability-note { font-size: 12.5px; color: var(--accent-dark); letter-spacing: 0.06em; margin-bottom: 18px; }

.back-link {
  display: inline-block;
  margin-top: 40px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.back-link:hover { color: var(--ink); }

/* ——— Cart drawer ——— */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, 0.45);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.cart-overlay.open { opacity: 1; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 100vw);
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.5s var(--ease);
  box-shadow: -20px 0 60px rgba(0,0,0,0.12);
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}
.cart-header h2 { font-size: 24px; }
#cart-close { font-size: 26px; line-height: 1; }

.cart-items { flex: 1; overflow-y: auto; padding: 10px 26px; }

.cart-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 0;
  font-size: 14px;
}

.cart-item {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.cart-item-img {
  aspect-ratio: 3 / 4;
  background: var(--bg-alt);
  overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-title { font-family: var(--serif); font-size: 16px; }
.cart-item-variant { font-size: 12px; color: var(--ink-soft); margin: 2px 0 10px; }
.cart-item-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
}
.cart-item-qty button { width: 28px; height: 30px; background: none; border: none; }
.cart-item-qty span { min-width: 24px; text-align: center; font-size: 13px; }
.cart-item-price { font-size: 13.5px; text-align: right; }
.cart-item-remove {
  background: none; border: none;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: underline;
  margin-top: 10px;
  padding: 0;
}

.cart-footer { padding: 20px 26px 28px; border-top: 1px solid var(--line); }
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.cart-note { font-size: 12px; color: var(--ink-soft); margin-bottom: 16px; }

/* ——— About page ——— */
.about-page { max-width: 680px; margin: 0 auto; padding: 90px 28px 120px; text-align: center; }
.about-page h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 28px; }
.about-page p { color: var(--ink-soft); margin-bottom: 18px; font-size: 15.5px; }

/* ——— Footer ——— */
#site-footer { background: var(--ink); color: var(--bg); }
.footer-inner { text-align: center; padding: 70px 28px 50px; }
.footer-brand { font-family: var(--serif); font-size: 30px; letter-spacing: 0.08em; margin-bottom: 8px; }
.footer-tag { color: #b8b2a8; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 30px; }
.footer-links { display: flex; justify-content: center; gap: 32px; margin-bottom: 36px; }
.footer-links a { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: #d8d3ca; }
.footer-links a:hover { color: var(--bg); }
.footer-copy { font-size: 12px; color: #8a857c; }

/* ——— Toast ——— */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 14px 28px;
  z-index: 120;
  opacity: 0;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ——— Loading ——— */
.loading {
  text-align: center;
  padding: 100px 0;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ——— Responsive ——— */
.desktop-only { display: inline-flex; }

@media (max-width: 640px) {
  .spec-row { grid-template-columns: 1fr; gap: 2px; }
  .size-guide { padding: 18px 16px 14px; }
}

@media (max-width: 860px) {
  .desktop-only { display: none; }
  #menu-toggle { display: inline-flex; }
  .header-inner { grid-template-columns: 48px 1fr 48px; padding: 0 16px; }
  .brand { font-size: 21px; text-align: center; }
  .product-page { grid-template-columns: 1fr; gap: 36px; padding-top: 24px; }
  .gallery { position: static; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
  .container { padding: 0 16px; }
  .shop-section { padding: 56px 0 70px; }
}
