:root {
  color-scheme: light;
  --background: #f5f4ee;
  --paper: #fffef9;
  --ink: #252b24;
  --muted: #565d53;
  --line: #dfdfd4;
  --green: #334c39;
  --wash: #e8ede3;
  --serif: Georgia, 'Times New Roman', serif;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
:focus-visible { outline: 2px solid #477a54; outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus { position: absolute; z-index: 3; background: white; padding: 12px; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 64px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header h1 {
  font: 400 clamp(1.18rem, 2.35vw, 2.1rem)/1.05 var(--serif);
  letter-spacing: -.045em;
  margin: 0;
}
.site-header h1 span { color: var(--green); font-style: italic; }
.site-header nav { display: flex; gap: 6px; align-items: center; }
.site-header nav :is(a, button) {
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  min-height: 42px;
  font-size: .85rem;
  text-decoration: none;
}
.site-header nav :is(a, button):hover, .site-header nav [aria-pressed="true"] { background: var(--wash); }
.site-header nav span, #catalog-count {
  border-radius: 99px;
  padding: 2px 7px;
  background: var(--wash);
  color: var(--green);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.workspace {
  display: grid;
  grid-template-areas: 'details studio catalog';
  grid-template-columns: minmax(220px, 278px) minmax(320px, 1fr) minmax(255px, 330px);
  align-items: start;
  gap: clamp(14px, 2vw, 28px);
  max-width: 1510px;
  margin: auto;
  padding: clamp(14px, 2.4vw, 36px);
}
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); min-width: 0; }
.studio { grid-area: studio; min-width: 0; }
.studio-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.studio-bar h2, .catalog h2 { margin: 0; font: 400 clamp(1.35rem, 2vw, 1.75rem)/1.1 var(--serif); letter-spacing: -.035em; }
.pose-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid #cbd6c9; border-radius: 9px; background: var(--wash); color: var(--green);
  padding: 5px 12px; min-height: 42px; white-space: nowrap; font-size: .84rem; font-weight: 650;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.pose-button:hover { background: #dce7d9; border-color: #a5b4a3; }
.pose-icon { display: inline-block; font-size: 1.12rem; line-height: 1; }
.pose-button[data-pose="tres-cuartos"] .pose-icon { rotate: 38deg; }
.portrait {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
  min-width: 0;
  height: clamp(420px, calc(100dvh - 155px), 770px);
  border-radius: 15px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, #b8b5af, #d6d2cf 65%, #a9a69f);
}
.portrait-images, .portrait-layer { position: absolute; inset: 0; }
.portrait-layer { display: grid; place-items: center; overflow: hidden; background: #c5c1bc; }
.portrait-layer::before {
  content: "";
  position: absolute;
  inset: -44px;
  background: var(--portrait-ambient, none) center / cover no-repeat;
  filter: blur(42px);
  opacity: .74;
}
.portrait-layer img {
  position: relative; display: block; max-width: 100%; width: auto; height: 100%;
  min-height: 0; object-fit: contain;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}
.portrait :is(figcaption, .photo-action) {
  position: absolute; padding: 7px 10px; border-radius: 8px;
  background: #fffef3ee; color: var(--ink); font-size: .76rem;
}
.portrait figcaption { left: 11px; bottom: 11px; }
.portrait .photo-action { right: 11px; bottom: 11px; border: 1px solid #e3e4dc; min-height: 40px; }
.details { grid-area: details; padding: clamp(14px, 2vw, 24px); }
.eyebrow { margin: 0 0 10px; font-size: .73rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dress-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dress-heading h2 { margin: 0; font: 400 clamp(1.65rem, 2.9vw, 2.55rem)/.98 var(--serif); letter-spacing: -.045em; overflow-wrap: anywhere; }
.favorite-button { border: 1px solid var(--line); flex: 0 0 41px; height: 41px; background: transparent; border-radius: 50%; font-size: 1.45rem; line-height: 1; }
.favorite-button:hover, .favorite-button[aria-pressed="true"] { background: var(--wash); color: var(--green); }
.dress-style { color: var(--muted); margin: 8px 0 14px; font-size: .86rem; }
.price { margin: 0 0 13px; font-size: 1.26rem; font-weight: 600; }
.specs { border-block: 1px solid var(--line); padding: 8px 0; margin: 0 0 16px; font-size: .82rem; }
.specs > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; display: flex; align-items: center; gap: 6px; font-weight: 550; }
.swatch { width: 13px; height: 13px; border-radius: 50%; background: #859d7a; border: 1px solid #6a8061; }
.primary-button, .secondary-button {
  width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 10px; border-radius: 8px; text-align: center; font-size: .83rem; font-weight: 650;
}
.primary-button { background: var(--green); color: white; text-decoration: none; }
.primary-button:hover { background: #233b2a; }
.secondary-button { background: transparent; border: 1px solid var(--line); }
.secondary-button:hover, .secondary-button[aria-pressed="true"] { background: var(--wash); }
.fine-print, .catalog-note { font-size: .76rem; line-height: 1.45; color: var(--muted); }
.fine-print { margin: 9px 0 15px; }
.catalog-note { background: #f4eee0; color: #614b25; padding: 10px; border-radius: 8px; }
.shop-section { margin-top: 20px; }
.shop-section h3 { font-size: .91rem; font-weight: 650; margin: 0 0 8px; }
.shop-preview {
  display: flex; width: 100%; text-align: left; gap: 9px; align-items: center; border: 1px solid var(--line);
  border-radius: 8px; padding: 5px; background: var(--background); font-size: .8rem;
}
.shop-preview img { width: 53px; height: 65px; object-fit: cover; border-radius: 5px; }
.shop-preview small { display: block; color: var(--muted); margin-top: 3px; }
.shop-arrow { margin: 0 7px 0 auto; }
.catalog { grid-area: catalog; max-height: calc(100dvh - 105px); display: flex; flex-direction: column; overflow: clip; }
.catalog-header { padding: 14px 14px 9px; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
#search { width: 100%; min-height: 42px; padding: 7px 10px; border: 1px solid #cfd3c8; border-radius: 8px; background: #fafaf5; font-size: .82rem; }
.dress-grid {
  list-style: none; margin: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 6px 14px 14px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.dress-card {
  width: 100%; height: 100%; display: block; padding: 4px 4px 8px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--paper); text-align: left;
}
.dress-card:hover { border-color: #82947d; }
.dress-card[aria-pressed="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: var(--wash); }
.dress-card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 4.9; object-fit: contain; background: #eeeae3; border-radius: 5px; }
.card-title, .card-ref { display: block; margin-inline: 4px; }
.card-title { margin-top: 5px; font-size: .81rem; font-weight: 620; overflow-wrap: anywhere; }
.card-ref { margin-top: 2px; font-size: .67rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding: 0 14px 12px; color: var(--muted); font-size: .83rem; }
dialog { width: min(94vw, 620px); max-height: 92dvh; padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--paper); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; background: #202620ad; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.dialog-header h2 { margin: 0; font: 400 clamp(1.3rem, 3vw, 1.75rem)/1.1 var(--serif); }
.dialog-header button, .gallery-nav button { min-width: 42px; min-height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--background); font-size: 1.2rem; }
.dialog-image { display: grid; place-items: center; border-radius: 8px; overflow: hidden; background: #e3e1db; min-height: 160px; }
.dialog-image img { display: block; max-width: 100%; max-height: 67dvh; object-fit: contain; }
.gallery-nav { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 10px; font-size: .84rem; }
.compare-dialog { width: min(97vw, 820px); }
.compare-help { font-size: .8rem; color: var(--muted); margin: 0 0 9px; }
.compare-pose { margin-bottom: 10px; }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.comparison article { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 7px; }
.comparison label { display: block; font-size: .75rem; margin-bottom: 4px; }
.comparison select { width: 100%; min-height: 40px; border: 1px solid #cfd3c8; border-radius: 6px; background: var(--paper); padding: 5px; margin-bottom: 7px; font-size: .8rem; }
.comparison img { border-radius: 5px; display: block; width: 100%; height: auto; max-height: 52dvh; object-fit: contain; background: #d1ceca; }
.comparison p { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; font-size: .8rem; margin: 7px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .pose-icon { transition: rotate 220ms ease-out; }
  .pose-button, .favorite-button, .dress-card, .photo-action, .shop-preview {
    transition: transform 160ms ease-out, background-color 160ms ease, border-color 160ms ease;
  }
  :is(.pose-button, .favorite-button, .dress-card, .photo-action, .shop-preview):active { transform: scale(.98); }
  dialog[open] { animation: dialog-in 180ms ease-out; }
  @keyframes dialog-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (max-width: 940px) {
  .workspace { grid-template-areas: 'studio catalog' 'details catalog'; grid-template-columns: minmax(0, 1fr) minmax(220px, 310px); }
  .catalog { position: sticky; top: 10px; max-height: calc(100dvh - 20px); }
}
@media (max-width: 650px) {
  .site-header { flex-wrap: wrap; padding: 11px 14px; gap: 4px; }
  .site-header h1 { font-size: 1.55rem; }
  .site-header nav { gap: 0; margin-left: -8px; }
  .site-header nav :is(a, button) { min-height: 40px; padding-inline: 8px; }
  .workspace { grid-template-areas: 'studio' 'details' 'catalog'; grid-template-columns: minmax(0, 1fr); }
  .portrait { height: auto; min-height: 0; aspect-ratio: 2 / 3; }
  .portrait-layer::before { content: none; }
  .portrait-layer img { width: 100%; mask-image: none; }
  .catalog { position: static; max-height: none; overflow: visible; }
  .dress-grid { overflow: visible; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dress-heading h2 { font-size: 2rem; }
}
