:root {
    --brand: #b52ea7;
    --brand-dark: #7e1f75;
    --bg: #faf7fa;
    --text: #2b2b2b;
    --muted: #767676;
    --border: #e6e0e5;
    --ok: #1e8a4c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

a { color: var(--brand-dark); }

.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; gap: 20px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--brand); }
.search { display: flex; gap: 6px; }
.search input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; min-width: 200px; }
.search button { padding: 8px 14px; border: none; border-radius: 6px; background: var(--brand); color: #fff; cursor: pointer; }

/* Filtros — versión DESKTOP: chips (nav.filters ya no lleva la
   clase "wrap", para no heredar justify-content/gap de .site-header .wrap) */
.filters-chips {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: .92rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-label {
    color: var(--muted);
    white-space: nowrap;
}

.filters-chips a {
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1e7ef;
    white-space: nowrap;
}
.filters-chips a:hover { background: #e3cde0; }
.filters-chips a.active { background: var(--brand); color: #fff; }

/* Select de "Marca comercial" en desktop: mismo aspecto de píldora
   que los demás chips (35 marcas no caben como chips sueltos) */
.filters-chips .filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: none;
    padding: 4px 26px 4px 10px;
    border-radius: 999px;
    background-color: #f1e7ef;
    color: var(--text);
    font-size: .92rem;
    cursor: pointer;
    max-width: 220px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.filters-chips .filter-select:hover { background-color: #e3cde0; }

/* Filtros — versión MÓVIL: combos (<select>), ocultos en desktop */
.filters-mobile { display: none; }

@media (max-width: 640px) {
    .filters-chips { display: none; }

    .filters-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-width: 1100px;
        margin: 0 auto;
        padding: 0 20px 14px;
    }

    .filter-select {
        width: 100%;
        padding: 10px 36px 10px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background-color: #fff;
        color: var(--text);
        font-size: .95rem;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
        background-repeat: no-repeat;
        background-position: right 12px center;
    }

    /* Link plano (no combo), por si algún filtro futuro vuelve a
       tener una sola opción real — hoy no se usa en el nav */
    .filter-mobile-link {
        display: block;
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #fff;
        color: var(--text);
        text-decoration: none;
        font-size: .95rem;
    }
    .filter-mobile-link:active { background: #f1e7ef; }
}

main.wrap { padding-top: 28px; padding-bottom: 60px; min-height: 60vh; }

h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.lead { color: var(--muted); max-width: 70ch; }
.muted { color: var(--muted); }

.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }

.ahorro-badge { display: inline-block; background: #e7f7ee; color: var(--ok); border: 1px solid #bfe8cf; padding: 8px 14px; border-radius: 8px; margin: 10px 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 18px; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 24px; }
.brand-tile { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-decoration: none; transition: border-color .15s, transform .15s; }
.brand-tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.brand-name { font-weight: 700; color: var(--text); }
.brand-count { font-size: .8rem; color: var(--muted); }

.perfume-list { list-style: none; margin: 20px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.perfume-item { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.perfume-item a { text-decoration: none; color: var(--text); font-weight: 600; }
.perfume-item a:hover { color: var(--brand-dark); }
.perfume-count { font-size: .78rem; color: var(--muted); background: #f1e7ef; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

.why-similar { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 8px; padding: 14px 16px; margin: 16px 0; }
.why-similar h2 { margin: 0 0 6px; font-size: 1rem; }
.why-similar p { margin: 0; }
.why-similar-pending { border-left-color: var(--border); }

.why-similar-seo { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin: 20px 0; }
.why-similar-seo h2 { font-size: 1.3rem; margin: 0 0 12px; }
.why-similar-seo h3 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--brand-dark); }
.why-similar-seo p { margin: 0 0 10px; }
.why-similar-seo ul { margin: 0 0 10px; padding-left: 20px; }
.why-similar-seo li { margin-bottom: 6px; }
.why-similar-seo li strong { color: var(--text); }

.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.card-images { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; background: #fff5fb; }
.card-images img { width: 64px; height: 64px; object-fit: contain; }
.card-images .vs { font-size: .75rem; color: var(--muted); }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.card-body h3 { margin: 4px 0 0; font-size: 1.05rem; }
.card-body h3 a { text-decoration: none; color: var(--text); }
.badge { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; background: var(--brand); color: #fff; padding: 2px 8px; border-radius: 999px; margin-right: 4px; }
.badge-muted { background: #e7e0e5; color: var(--text); }
.price { font-weight: 700; margin: 4px 0; }
.btn { display: inline-block; margin-top: 6px; text-decoration: none; font-size: .9rem; color: var(--brand-dark); font-weight: 600; }

.compare-images { display: flex; gap: 24px; margin: 20px 0; flex-wrap: wrap; }
.compare-images figure { margin: 0; text-align: center; }
.compare-images img { width: 120px; height: 120px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.compare-images figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; max-width: 160px; }

.compare-table { width: 100%; border-collapse: collapse; margin: 18px 0; background: #fff; }
.compare-table th, .compare-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.compare-table th { background: #f6eef4; font-size: .85rem; text-transform: uppercase; letter-spacing: .02em; }

.note { font-size: .85rem; color: var(--muted); background: #fff8e6; border: 1px solid #f0e2b6; padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; }
.note a { color: inherit; text-decoration: underline; }
.note-warning { background: #fdeeee; border-color: #f3caca; }

.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 20px 0; font-size: .8rem; color: var(--muted); }