:root {
    --paper: #f3efe7;
    --card: #fffdf9;
    --ink: #1a1714;
    --muted: #6f675d;
    --line: #e2dbcf;
    --stage: #f6f1e8; /* backdrop behind product photos */
    --ml: #ffe600; /* Mercado Libre yellow, so the buy button reads as "their" button */
    --display: "Montserrat", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 15px/1.5 "Inter Tight", system-ui, sans-serif;
}

a { color: inherit; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 20px;
}
.logo { font: 800 24px/1 var(--display); text-decoration: none; letter-spacing: -0.03em; }
.logo em { color: var(--muted); }
.top-link { font-weight: 600; text-underline-offset: 3px; }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.hero { padding: 40px 0 36px; border-bottom: 1px solid var(--ink); margin-bottom: 32px; }
.hero h1 {
    margin: 0;
    max-width: 20ch;
    font: 800 clamp(34px, 5.6vw, 64px)/1.04 var(--display);
    letter-spacing: -0.035em;
}
.hero h1 em { color: var(--muted); }
.hero-text { max-width: 58ch; margin: 22px 0 28px; color: var(--muted); font-size: 16px; }

.search input {
    width: 100%;
    max-width: 640px;
    padding: 14px 16px;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 17px; /* >=16px stops iOS zoom on focus */
}
.search input:focus { outline: 3px solid var(--ml); outline-offset: 0; }
.count { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.count span { color: var(--ink); font-weight: 600; }
.popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.popular a {
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
}
.popular a:hover { border-color: var(--ink); }
.count.loading { visibility: hidden; } /* not display:none: keeps its space so nothing jumps when data arrives */
.card-label strong { color: var(--ink); }

.top { flex-wrap: wrap; gap: 12px 20px; }
.top-search { flex: 1 1 220px; max-width: 320px; }
.top-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 16px; /* >=16px stops iOS zoom on focus */
}
.top-search input:focus { outline: 3px solid var(--ml); border-color: var(--ink); }
@media (max-width: 520px) { .top-search { max-width: none; } }
/* Phones: tighter hero so the first card peeks above the fold (text unchanged) */
@media (max-width: 600px) {
    .top { padding: 16px; }
    main { padding: 0 16px; }
    .hero { padding: 12px 0 24px; margin-bottom: 20px; }
    .hero-text { margin: 14px 0 18px; font-size: 15px; }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); /* room for name + price on one row */
    gap: 20px;
    align-items: start;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}
.card-media {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 210px;
    padding: 10px 0;
    background: var(--stage);
    border-bottom: 1px solid var(--line);
}
/* multiply turns the photos' white JPG background into the stage color: bottles sit on the card, not in a white box */
.card-media img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card-media .initial { font: italic 800 96px/1 var(--display); color: var(--line); }

.card-body { padding: 16px; }
.card-brand { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card h2 { margin: 2px 0 0; font: 700 22px/1.15 var(--display); letter-spacing: -0.025em; }
.card-label { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.card ul, .clone-list { display: grid; gap: 8px; list-style: none; margin: 8px 0 0; padding: 0; }

/* A clone is one row-link: name + seller left, price + a small ML-yellow arrow right.
   Yellow stays an accent, not a wall of buttons. */
.buy {
    position: relative; /* anchors the visually-hidden label */
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "name price go" "seller price go";
    align-items: center;
    gap: 2px 10px;
    padding: 10px 10px 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
}
.buy:hover { border-color: var(--ink); }
.buy:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.clone-name { grid-area: name; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.clone-name span { font-weight: 400; color: var(--muted); }
.clone-name .badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--ink);
    color: var(--paper);
    font-size: 11px;
    font-weight: 600;
    vertical-align: 1px;
    white-space: nowrap;
}
.seller { grid-area: seller; font-size: 12px; color: var(--muted); }
.price { grid-area: price; font-weight: 700; white-space: nowrap; }
.price.none { font-weight: 500; font-size: 13px; color: var(--muted); }
.go {
    grid-area: go;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: var(--ml);
    color: #2d3277;
    font-weight: 700;
}
.buy:hover .go { background: #fff159; }
.all-link { display: inline-block; margin: 12px 0 2px; font-size: 14px; font-weight: 600; text-underline-offset: 3px; }

.empty { grid-column: 1 / -1; padding: 48px 0; color: var(--muted); }
.empty p { margin: 0 0 10px; }
.empty p:first-child { font: italic 700 22px var(--display); overflow-wrap: anywhere; }
.empty a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

.more {
    display: block;
    margin: 32px auto;
    padding: 12px 28px;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.more:hover { background: var(--ink); color: var(--paper); }
.more[hidden], .end[hidden] { display: none; } /* author display rules would otherwise beat the hidden attribute */
.end { margin: 32px 0; text-align: center; color: var(--muted); font-size: 14px; }

footer {
    max-width: 1180px;
    margin: 48px auto 0;
    padding: 24px 20px 48px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}
footer p { max-width: 80ch; }

/* Card titles link to the perfume page */
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Perfume page (/clones/<slug>/) */
.perfume-page { padding-bottom: 8px; }
.crumbs { margin: 8px 0 20px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--ink); }
.perfume {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 24px;
}
.perfume-media { display: flex; justify-content: center; background: var(--stage); border-radius: 4px; }
.perfume-media img { width: 100%; max-width: 320px; height: auto; mix-blend-mode: multiply; }
@media (min-width: 721px) { .perfume-media { position: sticky; top: 24px; } } /* bottle stays in view along the list */
.perfume-media .initial { font: italic 800 140px/1 var(--display); color: var(--line); padding: 60px 0; }
.perfume h1 { margin: 2px 0 0; font: 800 clamp(28px, 4vw, 44px)/1.05 var(--display); letter-spacing: -0.035em; }
.perfume-intro { color: var(--muted); max-width: 60ch; }
.clone-list { margin-top: 16px; max-width: 560px; }
.note { margin-top: 16px; font-size: 12px; color: var(--muted); }
.related { margin-top: 40px; }
.related h2, .directory h2 { font: 800 24px/1.1 var(--display); letter-spacing: -0.025em; margin: 0 0 14px; }
.related ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; }
.related li a {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--card);
    text-decoration: none;
    font-size: 14px;
}
.related li a:hover { border-color: var(--ink); }
@media (max-width: 720px) {
    .perfume { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
    .perfume-media img { max-width: 220px; }
}

/* Home A–Z directory: plain links that search engines can crawl */
.directory { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--ink); }
.directory-cols { columns: 4 200px; column-gap: 28px; }
.directory-cols > div { break-inside: avoid; margin-bottom: 16px; }
.directory h3 { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.directory ul { list-style: none; margin: 0; padding: 0; }
.directory li a { font-size: 14px; text-decoration: none; }
.directory li a:hover { text-decoration: underline; }
