/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:    #0a0a0f;
  --bg2:   #111118;
  --bg3:   #16161f;
  --line:  rgba(255,255,255,.07);
  --gold:  #c9a96e;
  --goldg: rgba(201,169,110,.2);
  --white: #f0f0eb;
  --muted: #6a6a7a;
  --t:     .22s cubic-bezier(.4,0,.2,1);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg); color: var(--white);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* ── HEADER ─────────────────────────────────────────────── */
.header {
  text-align: center;
  padding: 3rem 1rem 2.2rem;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,169,110,.1), transparent 70%);
}
.header-eyebrow {
  font-family: 'Bodoni Moda', serif;
  font-style: italic; font-size: .8rem;
  letter-spacing: .15em; color: var(--muted);
  margin-bottom: .55rem;
}
.logo {
  font-family: 'Bodoni Moda', serif;
  font-weight: 300; font-size: 3rem;
  letter-spacing: .4em; color: var(--gold);
  text-shadow: 0 0 60px rgba(201,169,110,.3);
  line-height: 1;
}

/* ── MAIN / GRID ─────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2px 2px 6rem;   /* 2px = editorial gap matches card gaps */
}

.looks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

/* SKELETON */
.skeleton {
  padding-top: 145%;
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* EMPTY */
.empty-state {
  grid-column: 1/-1; text-align: center;
  padding: 5rem 1rem; color: var(--muted);
  font-family: 'Bodoni Moda', serif; font-size: 1.1rem;
}

/* ── CARD ────────────────────────────────────────────────── */
.look-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg3);
  -webkit-user-select: none; user-select: none;
  display: block;
}
.look-card:active { opacity: .88; }

/* Photo — tall portrait, no border-radius (editorial) */
.card-img-wrap {
  position: relative;
  padding-top: 145%;   /* ~2:3 ratio — editorial fashion */
  overflow: hidden;
}
.card-img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  display: block;
  transition: transform .45s ease;
  /* Slight blur on low-res images — hides pixelation beautifully */
  image-rendering: auto;
}
/* Soft vignette to hide edges of low-quality photos */
.card-img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(0,0,0,.55) 0%, transparent 70%),
    radial-gradient(ellipse 100% 30% at 50% 0%,   rgba(0,0,0,.25) 0%, transparent 100%);
  pointer-events: none;
}

.card-img-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bodoni Moda', serif; font-size: 3rem; color: var(--muted);
}

/* Name overlay at bottom */
.card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: .9rem .85rem .75rem;
  z-index: 2;
}
.card-name {
  font-family: 'Bodoni Moda', serif;
  font-weight: 300; font-size: 1rem;
  color: #fff; line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
.card-link-icon {
  position: absolute; top: .6rem; left: .6rem; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5); text-decoration: none;
  transition: color var(--t), border-color var(--t);
}
.card-link-icon:hover { color: var(--gold); border-color: rgba(201,169,110,.4); }

/* Hover (desktop only) */
@media (hover: hover) {
  .look-card:hover .card-img-wrap img { transform: scale(1.04); }
}

/* ── FOOTER ──────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 2rem 1rem;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: .6rem;
}
.footer-logo {
  font-family: 'Bodoni Moda', serif;
  font-size: .9rem; letter-spacing: .25em; color: var(--muted);
}
.footer-dot, .footer-copy { font-size: .75rem; color: var(--muted); opacity: .5; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; opacity: 0;
  transition: opacity .22s ease;
}
.modal.open { pointer-events: all; opacity: 1; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.75); backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative; z-index: 1;
  width: 100%; max-height: 92dvh;
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.32,1,.28,1);
  box-shadow: 0 -24px 60px rgba(0,0,0,.6);
}
.modal.open .modal-panel { transform: translateY(0); }

/* Drag handle */
.modal-panel::before {
  content: '';
  display: block; flex-shrink: 0;
  width: 32px; height: 3px; border-radius: 3px;
  background: rgba(255,255,255,.12);
  margin: 10px auto 0;
}

.modal-close {
  position: absolute; top: .85rem; right: .85rem; z-index: 10;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.modal-close:active { background: rgba(255,255,255,.14); }

/* Compact horizontal photo strip */
.modal-photo-wrap {
  flex-shrink: 0;
  height: 200px; width: 100%;
  position: relative; overflow: hidden;
  background: var(--bg3);
}
.modal-photo-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  display: block;
}
.modal-photo-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bodoni Moda', serif; font-size: 3rem; color: var(--muted);
}

/* Body */
.modal-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 1.2rem 1.2rem 2.5rem;
  position: relative;
}

.modal-name {
  font-family: 'Bodoni Moda', serif;
  font-weight: 300; font-size: 1.5rem; color: var(--white);
  padding-right: 2rem; line-height: 1.2;
}
.modal-divider {
  height: 1px; margin: .9rem 0;
  background: linear-gradient(90deg, rgba(201,169,110,.3), transparent);
}

/* Products */
.modal-products { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }

.product-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
  transition: border-color var(--t), background var(--t);
  min-height: 52px;
  -webkit-user-select: none; user-select: none;
}
.product-item:active { background: rgba(255,255,255,.03); }
.product-item.selected {
  border-color: rgba(201,169,110,.4);
  background: rgba(201,169,110,.05);
}

.product-check {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), border-color var(--t);
}
.product-item.selected .product-check { background: var(--gold); border-color: var(--gold); }
.product-check::after {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #000; opacity: 0; transition: opacity var(--t);
}
.product-item.selected .product-check::after { opacity: 1; }

.product-thumb {
  width: 40px; height: 40px; object-fit: cover;
  border-radius: 6px; background: var(--bg3); flex-shrink: 0;
}
.product-thumb-placeholder {
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--bg3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bodoni Moda', serif; color: var(--muted); font-size: .8rem;
}

.product-info { flex: 1; min-width: 0; }
.product-name {
  font-size: .88rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-price { font-size: .8rem; color: var(--gold); margin-top: .1rem; }

/* Total */
.modal-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: .75rem 0; border-top: 1px solid var(--line); margin-bottom: .9rem;
}
.modal-total-label {
  font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.modal-total-val {
  font-family: 'Bodoni Moda', serif;
  font-weight: 300; font-size: 1.5rem; color: var(--gold);
}

/* CTA */
.modal-cta {
  width: 100%; min-height: 50px;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--gold); border: none; border-radius: 40px;
  color: #000; font-family: 'Inter', sans-serif;
  font-size: .82rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 24px var(--goldg);
  transition: opacity var(--t), transform var(--t);
}
.modal-cta:active { transform: scale(.98); opacity: .9; }
.modal-cta:disabled { opacity: .35; cursor: not-allowed; }

/* ── SHOPPING LIST SCREEN ────────────────────────────────── */
.sl-screen {
  position: absolute; inset: 0;
  background: var(--bg2);
  display: flex; flex-direction: column;
  padding: 1rem 1.1rem 1.5rem;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: slideIn .24s cubic-bezier(.32,1,.28,1);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.sl-back {
  display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: none; color: var(--muted);
  font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; padding: .2rem 0; margin-bottom: .8rem;
  align-self: flex-start; transition: color var(--t);
}
.sl-back:active { color: var(--gold); }

.sl-hint {
  font-size: .65rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .7rem;
}

.sl-items { display: flex; flex-direction: column; gap: 1px; flex: 1; }

.sl-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .75rem .4rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--white);
  min-height: 56px;
  transition: opacity var(--t);
}
.sl-item:last-child { border-bottom: none; }
.sl-item:active { opacity: .55; }
.sl-item.visited .sl-item-name { text-decoration: line-through; color: var(--muted); }

.sl-item-thumb {
  width: 42px; height: 42px; object-fit: cover;
  border-radius: 6px; background: var(--bg3); flex-shrink: 0;
}
.sl-item-thumb-placeholder {
  width: 42px; height: 42px; border-radius: 6px;
  background: var(--bg3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bodoni Moda', serif; color: var(--muted); font-size: .8rem;
}
.sl-item-info { flex: 1; min-width: 0; }
.sl-item-name {
  font-size: .88rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sl-item-price { font-size: .78rem; color: var(--gold); margin-top: .1rem; }
.sl-item-arrow { color: var(--muted); font-size: .9rem; flex-shrink: 0; }

.sl-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: .9rem; border-top: 1px solid var(--line); margin-top: .5rem;
  flex-shrink: 0;
}
.sl-total-label {
  font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.sl-total-val {
  font-family: 'Bodoni Moda', serif;
  font-weight: 300; font-size: 1.4rem; color: var(--gold);
}

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* ── TABLET ─────────────────────────────────────────────── */
@media (min-width: 540px) {
  .looks-grid { grid-template-columns: repeat(3, 1fr); }
  .logo { font-size: 3.5rem; }
}

/* ── DESKTOP ─────────────────────────────────────────────── */
@media (min-width: 900px) {
  .header { padding: 4rem 1rem 3rem; }
  .logo { font-size: 4.5rem; letter-spacing: .45em; }
  .looks-grid { grid-template-columns: repeat(4, 1fr); }

  /* Desktop modal: side by side */
  .modal { align-items: center; }
  .modal-panel {
    flex-direction: row; align-items: stretch;
    width: 820px; max-width: 90vw;
    max-height: 85vh; border-radius: 20px;
    transform: translateY(12px) scale(.97);
  }
  .modal.open .modal-panel { transform: translateY(0) scale(1); }
  .modal-panel::before { display: none; }
  .modal-photo-wrap { width: 300px; flex-shrink: 0; height: auto; }
  .modal-photo_wrap img { object-position: center; }
  .modal-close { top: 1rem; right: 1rem; }
}
