/* Ritmo, interacción y adaptación móvil. La paleta se conserva en brand.css. */
:root {
  --page-gutter: clamp(20px, 4vw, 48px);
  --ease-out: cubic-bezier(.2, .65, .3, 1);
  --quick: 180ms;
  --gentle: 260ms;
}
html { scrollbar-gutter: stable; }
body { -webkit-font-smoothing: antialiased; }
button, input, a { -webkit-tap-highlight-color: transparent; }
.site-header, main, footer { padding-inline: var(--page-gutter); }
.site-header { gap: 24px; padding-block: 24px; }
.site-header nav { flex-wrap: wrap; gap: 12px 24px; }
.site-header nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.wordmark span { line-height: 1.6; margin-top: 10px; }
.wordmark { max-width: 100%; overflow-wrap: anywhere; }
.wordmark span { white-space: normal; }
.preview-note { font-size: .75rem; line-height: 1.5; padding-block: 10px; }
.intro { margin: 24px 0 28px; padding: 24px 0 32px; }
.intro h1 { font-size: clamp(2.5rem, 5vw, 4.3rem); line-height: 1.12; }
.hero-word { display: inline-block; }
.intro.welcome-line::after { transform-origin: left; animation: welcome-line 620ms 180ms var(--ease-out) backwards; }
@keyframes welcome-line { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: scaleX(1); } }
.intro > p { max-width: 340px; line-height: 1.65; }
.intro::after { bottom: 0; }
.eyebrow { font-size: .75rem; line-height: 1.5; margin-bottom: 12px; }
.catalog-modes { gap: 28px; margin-bottom: 20px; }
.catalog-modes { position: relative; }
.mode-indicator { position: absolute; bottom: -1px; left: 0; height: 2px; background: var(--wine); pointer-events: none; transition: transform 420ms var(--ease-out), width 420ms var(--ease-out); }
.catalog-modes.has-indicator button[aria-selected="true"] { border-bottom-color: transparent; }
.catalog-modes button { min-height: 48px; padding: 12px 2px; line-height: 1.4; }
.catalog-modes button, .contact-link, .button, .detail-btn, .wa-small, .name button, .close {
  transition: color var(--quick), background-color var(--quick), border-color var(--quick), box-shadow var(--quick);
}
.search { min-height: 60px; padding: 6px 16px; gap: 12px; border-radius: 4px; transition: border-color var(--quick), box-shadow var(--quick); }
.search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 12%, transparent); }
.search input { min-height: 46px; font-size: 1rem; line-height: 1.5; outline: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search-hint { color: var(--muted); }
.clear-search { width: 44px; min-height: 44px; flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; }
.clear-designer { min-height: 44px; padding-inline: 12px; }
.catalog-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 32px; margin-top: 24px; align-items: start; }
.filters { padding-right: 24px; }
.filter-title { margin-bottom: 20px; }
.filter-title button { min-height: 44px; padding: 4px 0 4px 12px; }
fieldset { margin-bottom: 24px; min-width: 0; }
legend { font-size: .8125rem; line-height: 1.5; margin-bottom: 8px; letter-spacing: .08em; }
fieldset label { min-height: 44px; gap: 10px; padding: 8px 0; line-height: 1.5; }
fieldset input { width: 18px; height: 18px; }
fieldset label, legend, .brand, .perfume-label, .similarity h4, .detail-top > span { overflow-wrap: anywhere; }
.filter-help { color: var(--muted); font-size: .875rem; line-height: 1.6; margin: 0; }
.apply-filters { display: none; }
.catalog-results { min-width: 0; scroll-margin-top: 24px; }
.results-header { align-items: baseline; flex-wrap: wrap; margin-bottom: 16px; gap: 6px 16px; }
.results-header > span { color: var(--muted); font-size: .8125rem; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.filter-chip { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: .875rem; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.filter-chip > span { color: var(--gold); font-size: 1.125rem; }
.filter-chip:hover { border-color: var(--gold); }
.product-grid { gap: 24px; }
.product-card { display: flex; flex-direction: column; border-radius: 5px; overflow: hidden; transition: border-color var(--gentle), box-shadow var(--gentle), transform var(--gentle) var(--ease-out); }
.product-photo { height: 224px; padding: 28px; flex: 0 0 auto; background: #f7f7f7; }
.product-photo img { transition: transform 400ms var(--ease-out); }
.product-photo .perfume-label { height: 100%; padding: 12px; gap: 10px; }
.product-photo:focus-visible { outline-offset: -5px; }
.product-gender { padding: 4px 9px; line-height: 1.4; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; border-top-width: 1px; }
.card-body > .brand { margin-bottom: 8px; line-height: 1.5; }
.name { font-size: 1.5rem; line-height: 1.25; margin-bottom: 10px; overflow-wrap: anywhere; }
.name button { display: flex; align-items: start; min-height: 44px; max-width: 100%; }
.card-profile { line-height: 1.55; margin-bottom: 10px; }
.card-notes { font-size: 1rem; line-height: 1.5; margin-bottom: 16px; min-height: 0; }
.card-longevity { margin-top: auto; margin-bottom: 12px; padding-top: 4px; }
.card-seasons { gap: 6px; margin-bottom: 20px; }
.season-pill { font-size: .8125rem; padding: 4px 8px; border-radius: 3px; }
.card-body > .card-seasons { min-height: 62px; align-content: start; }
.card-actions { padding-top: 12px; flex-wrap: wrap; gap: 4px 12px; }
.detail-btn, .wa-small { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: .875rem; line-height: 1.4; }
.card-actions .detail-btn { justify-content: start; flex: 1 1 120px; text-align: left; }
.wa-small { gap: 6px; color: var(--ink); }
.wa-small svg { flex: 0 0 auto; margin: 0; width: 18px; height: 18px; }
.button { min-height: 48px; border-radius: 3px; }
.empty { padding: 40px 24px; border-radius: 4px; }
.empty h2 { margin: 0 0 16px; line-height: 1.25; }
.empty p { margin-bottom: 24px; }
.guide { margin-block: 64px 48px; padding-top: 40px; }
.guide-grid { gap: 32px; }
footer { padding-block: 32px; }
footer > a:last-child { display: inline-flex; align-items: center; min-height: 44px; }

/* Un movimiento breve acompaña los cambios sin demorar la interacción. */
@media (hover: hover) and (pointer: fine) {
  .product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px #0002; }
  .recommendation-card:hover { transform: translateY(-2px); }
}
dialog { border-radius: 6px; max-height: calc(100dvh - 48px); overscroll-behavior: contain; scrollbar-gutter: stable; box-shadow: 0 28px 90px #0007; }
dialog[open] { animation: detail-enter 380ms var(--ease-out) both; }
dialog[open]::backdrop { animation: backdrop-enter 320ms ease-out both; }
dialog.is-closing { animation: detail-exit 220ms ease-in both; pointer-events: none; }
dialog.is-closing::backdrop { animation: backdrop-exit 220ms ease-in both; }
@keyframes detail-enter { from { opacity: 0; transform: translateY(24px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes detail-exit { to { opacity: 0; transform: translateY(14px) scale(.99); } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-exit { to { opacity: 0; } }
.detail-top { min-height: 72px; padding: 12px 28px; gap: 16px; letter-spacing: .08em; background: var(--bg); }
.close { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 3px; }
.detail-grid { padding: 32px; gap: 12px 36px; }
.detail-heading { grid-column: 2; min-width: 0; }
.detail-side { min-width: 0; grid-column: 1; grid-row: 1 / 3; }
.detail-main { min-width: 0; grid-column: 2; }
.detail-image { padding: 24px; border-radius: 4px; overflow: hidden; }
.detail-heading h2 { font: 400 clamp(2rem, 4vw, 3rem)/1.12 var(--serif); margin: 6px 0 12px; overflow-wrap: anywhere; }
.detail-category { margin: 0; }
.detail-summary { line-height: 1.7; margin-top: 0; }
.longevity-block { border-bottom: 0; padding-bottom: 0; }
.detail-section { margin-top: 28px; padding-top: 24px; }
.detail-section h3 { font-size: .875rem; line-height: 1.5; letter-spacing: .08em; }
.reference-label { font-size: .75rem; line-height: 1.5; }
.reference-source, .comparison-source { line-height: 1.6; padding-block: 6px; }
.similarity, .recommendation-card, .dupe-card { border-radius: 4px; }
.source-list a { display: inline-flex; align-items: center; min-height: 44px; line-height: 1.5; }
.recommendation-card { transition: transform var(--gentle), border-color var(--quick); }
.recommendation-copy p { margin: 0; }
.designer-reference, .dupe-alternative { padding: 24px; }
.designer-reference h3, .dupe-product h4 { overflow-wrap: anywhere; }
.dupe-actions { flex-wrap: wrap; }
.dupe-alternative { display: flex; flex-direction: column; }
.dupe-actions { margin-top: auto; }
.designer-search input { width: 0; }
#toast { border-radius: 4px; bottom: max(24px, env(safe-area-inset-bottom)); }

@media (max-width: 1100px) {
  .catalog-layout { grid-template-columns: 196px minmax(0, 1fr); gap: 24px; }
  .product-grid { gap: 20px; }
  .detail-grid { grid-template-columns: 260px minmax(0, 1fr); gap: 12px 28px; padding: 28px; }
  .card-body > .card-seasons { min-height: 32px; }
}
@media (max-width: 760px) {
  :root { --page-gutter: 20px; }
  .site-header { flex-wrap: wrap; align-items: center; padding-block: 18px; gap: 16px; }
  .wordmark { font-size: 1.875rem; }
  .wordmark span { font-size: .75rem; letter-spacing: .08em; margin-top: 7px; }
  .site-header nav { gap: 8px 16px; max-width: none; }
  .site-header nav a { font-size: .875rem; }
  .site-header .contact-link { border: 1px solid var(--line); padding: 8px 12px; }
  .intro { margin: 20px 0 24px; padding: 12px 0 24px; }
  .intro h1 { font-size: clamp(2.5rem, 9vw, 3.4rem); }
  .intro > p { font-size: 1rem; max-width: 100%; margin-top: 12px; }
  .catalog-modes { gap: 20px; margin-bottom: 18px; }
  .catalog-modes button { font-size: .9375rem; }
  .search { min-height: 56px; padding-inline: 12px; gap: 10px; }
  .search svg { width: 20px; height: 20px; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 16px; }
  .filter-panel > summary { min-height: 52px; padding: 12px 14px; border-radius: 4px; font-size: .9375rem; gap: 8px; }
  .filter-panel > summary::after { content: ''; width: 8px; height: 8px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: rotate(45deg); flex: 0 0 auto; margin: -4px 2px 0 4px; transition: transform var(--quick); }
  .filter-panel[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
  .filter-panel > summary span { font-size: .75rem; margin-left: auto; text-align: right; }
  .filter-panel[open] > summary { margin-bottom: 0; border-radius: 4px 4px 0 0; border-bottom-color: transparent; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; padding: 0 14px 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 4px 4px; background: var(--surface); }
  .filter-title { grid-column: 1 / -1; margin: 0; }
  .filters fieldset { min-width: 0; margin: 0; }
  .filters label { align-items: start; font-size: .875rem; padding-block: 10px; }
  .filters input { margin-top: 2px; }
  .filters .season-icon { margin-top: 2px; }
  .filter-help { display: block; grid-column: 1 / -1; font-size: .8125rem; padding-top: 16px; }
  .apply-filters { display: flex; grid-column: 1 / -1; position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); width: 100%; box-shadow: 0 4px 20px #0004; }
  .results-header { align-items: start; font-size: .875rem; }
  .results-header > span { font-size: .75rem; }
  .product-grid { gap: 20px; }
  .product-photo { height: 210px; padding: 24px; }
  .card-body { padding: 18px; }
  .card-actions { flex-direction: row; align-items: center; }
  .card-body > .card-seasons { min-height: 62px; }
  .guide { margin-block: 48px 32px; padding-top: 32px; }
  .guide-grid { gap: 24px; }
  footer { padding-block: 28px; }
  dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .detail-top { padding-inline: 20px; min-height: 68px; }
  .detail-grid { display: flex; gap: 28px; padding: 20px; }
  .detail-side { display: flex; flex-direction: column; align-items: stretch; position: static; }
  .detail-image { height: 220px; min-height: 0; padding: 20px; }
  .detail-image img { height: 100%; max-height: 100%; width: 100%; }
  .detail-side .availability { font-size: .875rem; margin: 14px 0; }
  .detail-side .button { margin-bottom: 10px; }
  .detail-heading h2 { font-size: 2.25rem; }
  .detail-section { margin-top: 24px; padding-top: 20px; }
  .detail-usage { grid-template-columns: 1fr; gap: 16px; }
  .detail-note, .sources-note { line-height: 1.6; }
  .note-tiles { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 20px 8px; }
  .designer-reference, .dupe-alternative { padding: 20px; }
  .dupe-actions .detail-btn { text-align: left; justify-content: start; }
  .recommendation-card { padding: 16px; gap: 16px; }
}
@media (max-width: 560px) {
  .site-header { gap: 12px; }
  .site-header nav { width: 100%; justify-content: space-between; gap: 8px 12px; }
  .site-header nav > a:nth-child(2) { display: inline-flex; }
  .intro { margin-block: 16px 20px; padding-top: 8px; }
  .intro h1 { font-size: clamp(2.4rem, 10vw, 3rem); }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .product-photo { height: 200px; padding: 24px; }
  .card-body > .card-seasons { min-height: 0; }
  .results-header { display: block; }
  .results-header > span { display: block; margin-top: 4px; }
  .similarity.has-reference { grid-template-columns: 92px minmax(0, 1fr); }
  .has-reference .reference-photo { height: 124px; }
  .has-reference h4 { font-size: 1.375rem; }
  .similarity p { font-size: 1rem; line-height: 1.6; }
  .longevity-block { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .longevity-block > div:first-child { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .longevity-block small { grid-column: 1 / -1; }
}
@media (max-width: 359px) {
  :root { --page-gutter: 16px; }
  .filters { grid-template-columns: minmax(0, 1fr); }
  .filter-panel > summary span { max-width: 90px; }
  .detail-grid { padding: 16px; }
  .detail-top { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .product-card:hover, .product-photo:hover img, .recommendation-card:hover { transform: none; }
}
