:root {
    --bg: #f4f8fc;
    --bg-deep: #e9f2f8;
    --panel: rgba(255, 255, 255, 0.84);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --card: rgba(255, 255, 255, 0.92);
    --text: #142f3f;
    --text-strong: #071f2d;
    --muted: #637b8c;
    --muted-2: #8aa0ae;
    --border: rgba(14, 45, 63, 0.12);
    --border-strong: rgba(14, 45, 63, 0.2);

    --blue: #0ea5e9;
    --cyan: #22d3ee;
    --violet: #8b5cf6;
    --pink: #ec4899;
    --orange: #f97316;
    --red: #ff2d55;
    --green: #22c55e;
    --yellow: #facc15;

    --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 18px 44px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 60px rgba(14, 165, 233, 0.16);

    --radius-2xl: 28px;
    --radius-xl: 22px;
    --radius-lg: 17px;
    --radius: 14px;

    --container: 1200px;

    --input-bg: #ffffff;

    --visual-min: 254px;
    --visual-min-partial: 192px;
    --visual-min-slim: 160px;
}

:root.density-normal {
    --visual-min: 188px;
    --visual-min-partial: 145px;
    --visual-min-slim: 119px;
}

:root.density-condensed {
    --visual-min: 136px;
    --visual-min-partial: 110px;
    --visual-min-slim: 94px;
}

:root[data-theme="dark"] {
    --bg: #030712;
    --bg-deep: #06111f;
    --panel: rgba(8, 18, 32, 0.76);
    --panel-strong: rgba(10, 22, 38, 0.92);
    --card: rgba(9, 22, 37, 0.9);
    --text: #d9e7f2;
    --text-strong: #ffffff;
    --muted: #97aaba;
    --muted-2: #70889b;
    --border: rgba(148, 184, 214, 0.14);
    --border-strong: rgba(148, 184, 214, 0.24);

    --shadow-soft: 0 15px 39px rgba(0, 0, 0, 0.28);
    --shadow-card: 0 24px 56px rgba(0, 0, 0, 0.36);
    --shadow-glow: 0 0 76px rgba(139, 92, 246, 0.16);

    --input-bg: #091625;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    font-family:
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    line-height: 1.45;
    background:
        radial-gradient(circle at 16% 4%, rgba(14, 165, 233, 0.22), transparent 28rem),
        radial-gradient(circle at 82% 8%, rgba(139, 92, 246, 0.18), transparent 30rem),
        radial-gradient(circle at 72% 44%, rgba(236, 72, 153, 0.08), transparent 24rem),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    transition: background 0.25s ease, color 0.25s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.36;
    background-image:
        linear-gradient(rgba(148, 184, 214, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 184, 214, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.page {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
    padding: 15px 0 34px;
}

.hero,
.deal-card,
.empty-state,
.error-box,
.ajax-error,
.noscript-box,
.loader {
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(22px);
}

.page-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
}

.page-action-link,
.page-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--border);
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: color 0.18s, border-color 0.18s;
}

.page-action-link:hover,
.page-action-btn:hover {
    color: var(--text-strong);
    border-color: var(--border-strong);
}

.theme-icon {
    display: flex;
    width: 17px;
    height: 17px;
    line-height: 0;
}

.theme-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.mobile-hero-actions,
.mobile-panel-label,
.mobile-options-actions,
.mobile-search-submit {
    display: none;
}

.hero {
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 10px 17px;
    padding: clamp(15px, 2.5vw, 27px);
    border-radius: var(--radius-2xl);
    margin-bottom: 14px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 74% 35%, rgba(139, 92, 246, 0.24), transparent 20rem),
        radial-gradient(circle at 82% 55%, rgba(14, 165, 233, 0.16), transparent 18rem);
}

.hero-copy {
    position: relative;
    z-index: 1;
}

h1 {
    max-width: 680px;
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(2.1rem, 4.7vw, 4rem);
    line-height: 0.92;
}

h1 span {
    background: linear-gradient(-45deg, #f0abfc, #8b5cf6, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.intro {
    max-width: 650px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.38;
}

.search-box {
    grid-column: 1 / -1;
    position: relative;
    z-index: 1;
    padding: 17px 0 0 0px;
    border-radius: 19px;
    border: 0px;
}

.search-box label {
    display: block;
    margin: 0 0 8px 4px;
    color: var(--text-strong);
    font-weight: 900;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, auto) auto;
    gap: 10px;
    align-items: center;
}

.search-row input {
    width: 100%;
    min-width: 0;
    height: 41px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background-color: var(--input-bg);
    color: var(--text);
    outline: none;
}

.search-row input:focus {
    border-color: rgba(139, 92, 246, 0.75);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
}

.search-cat-select {
    height: 41px;
    padding: 0 29px 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background-color: var(--input-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2397aaba' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.search-cat-select:focus {
    border-color: rgba(139, 92, 246, 0.75);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
}

.search-row button[type="submit"] {
    border: 1px solid rgba(139, 92, 246, 0.6);
    border-radius: 14px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    font-weight: 950;
    cursor: pointer;
    height: 41px;
    padding: 0 19px;
    white-space: nowrap;
    transition: filter 0.2s ease;
}

.search-row button[type="submit"]:hover {
    filter: brightness(1.08);
}

.search-row button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: wait;
    filter: none;
}

.hero-stage {
    position: relative;
    z-index: 1;
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 119px;
}

.hero-logo {
    width: 112px;
    height: auto;
    opacity: 0.9;
}

.prefs-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px 0px;
    width: 100%;
}

.hero .prefs-bar {
    position: relative;
    z-index: 1;
}

/* #prefsBar fills remaining space in .search-prefs flex row (desktop) */
.search-prefs > .prefs-bar {
    flex: 1 1 0;
    min-width: 0;
}

.prefs-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* Display group inside #prefsBar: takes full width of prefsBar */
#prefsBar > .prefs-group {
    flex: 1 1 0;
    min-width: 0;
}

.prefs-options {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    width: 100%;
    gap: 7px 14px;
    margin: 8px 10px 0 10px;
}

.search-prefs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    margin-top: 12px;
}

.sort-select {
    height: 41px;
    padding: 0 26px 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background-color: var(--input-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2397aaba' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    margin-right: 14px;
}

.sort-select:focus {
    border-color: rgba(139, 92, 246, 0.75);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.pref-check {
    display: inline-flex!important;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.pref-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pref-check-box {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1.5px solid var(--border-strong);
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.pref-check input:checked + .pref-check-box {
    background: #7c3aed;
    border-color: #7c3aed;
}

.pref-check input:checked + .pref-check-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

.pref-check-label {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
    transition: color 0.15s;
}

.pref-check input:checked ~ .pref-check-label {
    color: var(--text-strong);
}

/* Display hide rules */
.hide-heat .deal-heat-bar { display: none; }
.hide-tags .deal-tags { display: none; }
.hide-detail .deal-detail { display: none; }
.hide-old-price .old-price { display: none; }
.hide-discount .deal-discount { display: none; }
.hide-rating .deal-rating { display: none; }
.hide-comments .deal-comments { display: none; }

.deals-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.deal-card {
    --heat-start: #0ea5e9;
    --heat-end: #2563eb;
    --heat-glow: #0ea5e9;
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent),
        var(--card);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}


.deal-card:hover {
    box-shadow: var(--shadow-card), 0 0 29px rgba(139, 92, 246, 0.12);
}

.deal-card--hot {
    z-index: 0;
    border-color: rgba(255, 45, 85, 0.75);
    animation: hot-glow 2.6s ease-in-out infinite;
}

@keyframes hot-glow {
    0%, 100% {
        box-shadow: var(--shadow-soft),
                    0 0 0 1px rgba(255, 45, 85, 0.35),
                    0 0 34px rgba(255, 45, 85, 0.50),
                    0 0 85px rgba(255, 45, 85, 0.22);
    }
    50% {
        box-shadow: var(--shadow-card),
                    0 0 0 2px rgba(255, 45, 85, 0.65),
                    0 0 60px rgba(255, 45, 85, 0.85),
                    0 0 136px rgba(255, 45, 85, 0.40);
    }
}

.deal-link {
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr);
    gap: 17px;
    padding: 14px 15px 14px 17px;
}

.deal-visual {
    position: relative;
    border-radius: 17px;
    overflow: hidden;
    border: 1px solid var(--border);
    background:white;
}

:root[data-theme="light"] .deal-visual {
    background: #fff;
}

@media (min-width: 661px) {
    .deal-visual { min-height: var(--visual-min); }
    :root.hide-detail .deal-visual,
    :root.hide-tags .deal-visual { min-height: var(--visual-min-partial); }
    :root.hide-detail.hide-tags .deal-visual { min-height: var(--visual-min-slim); }
}

.deal-image {
    position: absolute;
    inset: 8px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}


.deal-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.deal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.deal-temp {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
}

.deal-heat-bar {
    position: relative;
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
}

.deal-heat-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #0ea5e9 0%,
        #22d3ee 6%,
        #22c55e 14%,
        #facc15 24%,
        #f97316 38%,
        #ff2d55 54%,
        #ff2d55 100%
    );
    background-repeat: no-repeat;
}

.deal-heat-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    z-index: 1;
}

.deal-age {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 760;
    white-space: nowrap;
}

.deal-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--text-strong);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.18;
}

.current-price {
    font-size: 1.7rem;
    font-weight: 800;
}

.current-price i,
.old-price i {
    font-style: normal;
}

.old-price {
    color: var(--muted-2);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    font-weight: 600;
    font-size: 1.45em;
    margin: 0px 8px;
}

.deal-discount {
    font-weight: 700;
    font-size: 1.45em;
}

.deal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid currentColor;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.15s;
}

.tag:hover {
    opacity: 0.75;
}

.tag--secondary {
    color: #64748B;
    border-color: #CBD5E122;
    background: #F8FAFC11;
}


.deal-detail {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.deal-footer {
    margin-top: auto;
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    align-items: center;
    min-height: 44px;
}

.deal-footer-prices {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 3px 0;
}

.deal-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 900;
    border-left: 1px solid var(--border);
    padding: 3px 7px;
}

.stars-wrap {
    position: relative;
    display: inline-block;
    line-height: 1;
}

.stars-base,
.stars-fill {
    font-size: 1rem;
    letter-spacing: -0.08em;
    line-height: 1;
    display: block;
    white-space: nowrap;
}

.stars-base {
    color: rgba(148, 163, 184, 0.35);
}

.stars-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--rating-percent);
    color: var(--muted);
    overflow: hidden;
}

.deal-rating b {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
}

.deal-comments {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    border-left: 1px solid var(--border);
    padding: 3px 7px;
    font-size: 1rem;
}

.deal-share {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    border-left: 1px solid var(--border);
    padding: 3px 7px;
}

.loader {
    width: fit-content;
    margin: 15px auto 0;
    padding: 12px 15px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 600;
}

.loader[hidden] {
    display: none;
}

.loader span {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: #a78bfa;
    animation: spin 0.8s linear infinite;
}

.empty-state,
.error-box,
.ajax-error,
.noscript-box {
    padding: 24px;
    border-radius: var(--radius-xl);
    text-align: center;
}

.empty-state h2 {
    margin: 0 0 7px;
    color: var(--text-strong);
}

.empty-state p,
.noscript-box {
    margin: 0;
    color: var(--muted);
}

.error-box,
.ajax-error {
    margin-bottom: 14px;
    color: #fb7185;
}

.footer {
    padding: 24px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer a {
    color: #a78bfa;
    font-weight: 600;
}

.footer #contactBtn {
    display: inline;
    min-height: auto;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    font-weight: 600;
    color: white;
    background: none;
    border: none;
    backdrop-filter: none;
}

.footer #contactBtn:hover {
    color: #a78bfa;
    opacity: 0.75;
    border-color: transparent;
}

:root[data-theme="light"] .footer #contactBtn {
    color: var(--text-strong);
}

:root[data-theme="light"] .footer #contactBtn:hover {
    color: var(--text);
    opacity: 1;
}

#themeToggle {
    --theme-toggle-bg: linear-gradient(135deg, #f59e0b, #ea580c);
    --theme-toggle-border: rgba(251, 146, 60, 0.7);
    --theme-toggle-shadow: rgba(249, 115, 22, 0.38);
    position: fixed;
    right: 14px;
    bottom: 62px;
    z-index: 300;
    width: 39px;
    height: 39px;
    min-height: 0;
    padding: 0;
    justify-content: center;
    gap: 0;
    color: #fff7ed;
    background: var(--theme-toggle-bg);
    border: 1px solid var(--theme-toggle-border);
    box-shadow: 0 7px 20px var(--theme-toggle-shadow);
    backdrop-filter: none;
    transition: filter 0.18s, box-shadow 0.18s, transform 0.18s;
}

:root[data-theme="light"] #themeToggle {
    --theme-toggle-bg: linear-gradient(135deg, #111827, #312e81);
    --theme-toggle-border: rgba(49, 46, 129, 0.65);
    --theme-toggle-shadow: rgba(49, 46, 129, 0.34);
    color: #e0e7ff;
}

#themeToggle:hover {
    border-color: var(--theme-toggle-border);
    filter: brightness(1.1);
    box-shadow: 0 10px 27px var(--theme-toggle-shadow);
}

.deal-age i {
    font-style: normal;
}

.footer.is-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    margin: 0;
    padding: 8px 17px;
    background: var(--panel);
    border: none;
    border-top: 1px solid var(--border);
    backdrop-filter: blur(22px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

.share-popup {
    position: fixed;
    z-index: 200;
    bottom: 51px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--panel-strong);
    border: 1px solid var(--border-strong);
    border-radius: 17px;
    padding: 15px 15px 12px;
    backdrop-filter: blur(28px);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.share-popup[hidden] {
    display: none;
}

.share-popup-title {
    margin: 0 0 3px;
    font-weight: 900;
    font-size: 0.88rem;
    color: var(--text-strong);
    padding-right: 24px;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 37px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}

.share-option:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.share-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.18);
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.share-popup-close:hover {
    background: rgba(148, 163, 184, 0.32);
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0px 0px;
    padding-top: 0;
}

.filter-group {
    flex: 1 1 140px;
}

.filter-group select {
    height: 32px;
    padding: 0 26px 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background-color: var(--input-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2397aaba' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.filter-group select:focus {
    border-color: rgba(139, 92, 246, 0.75);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

/* ── Custom Select Component ── */
.custom-select {
    position: relative;
    display: block;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    width: 100%;
    height: 41px;
    padding: 0 10px 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background-color: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.custom-select--lg .custom-select-trigger {
    height: 46px;
    border-radius: 14px;
    font-size: 0.9rem;
    padding: 0 12px 0 14px;
}

.custom-select-trigger:focus,
.custom-select.is-open .custom-select-trigger {
    outline: none;
    border-color: rgba(139, 92, 246, 0.75);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.custom-select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-arrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    color: var(--muted);
    transition: transform 0.2s ease;
}

.custom-select.is-open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: fixed;
    min-width: 153px;
    max-height: 238px;
    overflow-y: auto;
    background: var(--panel-strong);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 5px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(28px);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.custom-select-dropdown.opens-up {
    transform-origin: bottom center;
    transform: translateY(6px) scale(0.98);
}

.custom-select-dropdown.is-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

.custom-select-dropdown::-webkit-scrollbar {
    width: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 999px;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 32px;
    padding: 4px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

.custom-select-option:hover {
    background: rgba(139, 92, 246, 0.1);
}

.custom-select-option.is-selected {
    color: var(--text-strong);
    background: rgba(139, 92, 246, 0.12);
}

.custom-select-check {
    flex: 0 0 14px;
    font-size: 0.78rem;
    font-weight: 900;
    color: #a78bfa;
    visibility: hidden;
}

.custom-select-dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 2px currentColor;
    margin-top: 2px;
}

.custom-select-option.is-selected .custom-select-check {
    visibility: visible;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 18, 0.55);
    backdrop-filter: blur(6px);
}

.page-loader[hidden] {
    display: none;
}

.page-loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 27px 37px;
    background: var(--panel-strong);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    backdrop-filter: blur(28px);
    box-shadow: var(--shadow-card);
}

.page-loader-spinner {
    width: 37px;
    height: 37px;
    border-radius: 50%;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: #a78bfa;
    animation: spin 0.8s linear infinite;
}

.page-loader-label {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.propose-popup {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(6px);
}

.propose-popup[hidden] {
    display: none;
}

.propose-popup-card {
    position: relative;
    width: min(480px, calc(100% - 32px));
    background: var(--panel-strong);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(28px);
    box-shadow: var(--shadow-card);
}

.propose-popup-title {
    margin: 0 0 17px;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--text-strong);
    padding-right: 30px;
}

.propose-popup-subtitle {
    margin: -10px 0 15px;
    font-size: 0.85rem;
    color: var(--muted);
}

.contact-email {
    margin: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}

.contact-email a {
    color: #a78bfa;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.propose-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.propose-form input {
    height: 43px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background-color: var(--input-bg);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    width: 100%;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.propose-form input:focus {
    border-color: rgba(139, 92, 246, 0.75);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
}

.propose-submit {
    height: 43px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.26);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.propose-submit:hover {
    filter: brightness(1.1);
}

.propose-submit:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.propose-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 27px;
    height: 27px;
    border: none;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.18);
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-size: 1.1rem;
    line-height: 1;
}

.propose-popup-close:hover {
    background: rgba(148, 163, 184, 0.32);
}

.propose-msg {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    display: none;
}

.propose-msg.is-success {
    display: block;
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.propose-msg.is-error {
    display: block;
    background: rgba(251, 113, 133, 0.12);
    color: #fb7185;
    border: 1px solid rgba(251, 113, 133, 0.3);
}

.propose-btn {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 300;
    display: inline-flex;
    align-items: center;
    padding: 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border: 1px solid rgba(139, 92, 246, 0.6);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 7px 20px rgba(124, 58, 237, 0.45);
    cursor: pointer;
    transition: padding 0.28s ease, box-shadow 0.18s, filter 0.18s, transform 0.18s;
}

.propose-btn-label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.28s ease;
}

.propose-btn:hover {
    gap: 7px;
    padding: 11px 15px;
    filter: brightness(1.1);
    box-shadow: 0 10px 27px rgba(124, 58, 237, 0.55);
}

.propose-btn:hover .propose-btn-label {
    max-width: 200px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 661px) {
    :root.density-normal .deals-list { gap: 7px; }
    :root.density-normal .deal-link { padding: 10px 12px 10px 14px; gap: 12px; grid-template-columns: 256px minmax(0, 1fr); }
    :root.density-normal .deal-body { gap: 6px; }
    :root.density-normal .deal-header { gap: 8px; }
    :root.density-normal .deal-title { font-size: 1rem; }
    :root.density-normal .deal-temp { font-size: 1.3rem; }
    :root.density-normal .current-price { font-size: 1.3rem; }
    :root.density-normal .old-price { font-size: 1.1rem; }
    :root.density-normal .deal-discount { font-size: 1.1rem; }
    :root.density-normal .deal-footer { min-height: 36px; }

    :root.density-condensed .deals-list { gap: 3px; }
    :root.density-condensed .deal-link { padding: 7px 8px 7px 10px; gap: 8px; grid-template-columns: 280px minmax(0, 1fr); }
    :root.density-condensed .deal-body { gap: 4px; }
    :root.density-condensed .deal-header { gap: 7px; }
    :root.density-condensed .deal-title { font-size: 0.88rem; }
    :root.density-condensed .deal-temp { font-size: 1rem; }
    :root.density-condensed .current-price { font-size: 1rem; }
    :root.density-condensed .old-price { font-size: 0.88rem; }
    :root.density-condensed .deal-discount { font-size: 0.88rem; }
    :root.density-condensed .deal-footer { min-height: 27px; }
}

@media (max-width: 860px) {
    .deal-link {
        grid-template-columns: 153px minmax(0, 1fr);
    }

    .deal-title,
    .deal-temp {
        font-size: 1.1rem;
    }
}

@media (max-width: 660px) {
    html {
        font-size: 80%;
    }

    .page {
        width: min(100% - 18px, var(--container));
        padding-top: 10px;
    }

    .hero {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 7px;
        padding: 10px;
    }

    h1 {
        font-size: clamp(0.9rem, 4.5vw, 1.2rem);
        line-height: 1;
    }

    .hero-copy {
        order: 2;
        flex: 1 1 0;
        min-width: 0;
    }

    .hero-copy h1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .intro {
        display: none;
    }

    :root.has-js .mobile-hero-actions {
        position: relative;
        z-index: 1;
        order: 3;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        margin-left: auto;
    }

    .mobile-hero-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        min-height: 0;
        padding: 0;
        border: 1px solid var(--border-strong);
        border-radius: 999px;
        background: var(--input-bg);
        color: var(--text);
        font-size: 0.82rem;
        font-weight: 800;
        cursor: pointer;
        box-shadow: 0 7px 17px rgba(15, 23, 42, 0.12);
    }

    .mobile-hero-toggle span {
        display: none;
    }

    .mobile-hero-toggle svg {
        width: 14px;
        height: 14px;
        flex: 0 0 auto;
    }

    .mobile-hero-toggle.is-active {
        color: #fff;
        border-color: rgba(139, 92, 246, 0.65);
        background: linear-gradient(135deg, #7c3aed, #4f46e5);
    }

    .search-box {
        flex: 0 0 100%;
        width: 100%;
        order: 4;
        padding-top: 4px;
    }

    :root.has-js .hero .search-box:not(.is-open) {
        display: none;
    }

    /* Search mode : masquer #prefsBar dans le form */
    :root.has-js .search-box.is-open:not(.show-options) .search-prefs > .prefs-bar {
        display: none;
    }

    /* Options mode : masquer la zone recherche, laisser #prefsBar visible */
    :root.has-js .search-box.show-options .search-row,
    :root.has-js .search-box.show-options .search-filters,
    :root.has-js .search-box.show-options .search-prefs > .prefs-group {
        display: none;
    }

    :root.has-js .search-box.show-options .search-prefs {
        border-top: none;
        padding-top: 0;
        margin-top: 0;
    }

    .search-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .search-cat-select {
        width: 100%;
    }

    .search-row button[type="submit"] {
        display: none;
    }

    .hero-stage {
        order: 1;
        flex: 0 0 auto;
        align-self: center;
        justify-content: flex-start;
        min-height: 0;
    }

    .hero-logo {
        width: 42px;
    }

    .search-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-top: 7px;
    }

    .filter-group {
        min-width: 0;
    }

    .filter-group:last-child {
        grid-column: 1;
    }

    .mobile-search-submit {
        grid-column: 2;
        grid-row: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        padding: 0 10px;
        border: 1px solid rgba(139, 92, 246, 0.6);
        border-radius: 10px;
        background: linear-gradient(135deg, #7c3aed, #4f46e5);
        color: #fff;
        font-size: 0.9rem;
        font-weight: 950;
        cursor: pointer;
    }

    /* #prefsBar en colonne dans le panneau options mobile */
    .search-box .search-prefs > .prefs-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .search-box .search-prefs {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-top: 7px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    .prefs-group,
    .prefs-group:last-child {
        width: 100%;
        margin: 0;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-panel-label {
        display: block;
        color: var(--muted);
        font-size: 0.63rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .prefs-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pref-check {
        width: 100%;
    }

    :root.has-js .mobile-options-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    .mobile-menu-action {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 36px;
        padding: 0 10px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: rgba(148, 163, 184, 0.1);
        color: var(--text);
        font: inherit;
        font-size: 0.9rem;
        font-weight: 800;
        text-align: left;
        cursor: pointer;
    }

    .mobile-menu-icon {
        display: flex;
        width: 15px;
        height: 15px;
        color: #a78bfa;
        flex: 0 0 auto;
    }

    .mobile-menu-icon svg {
        display: block;
        width: 100%;
        height: 100%;
        fill: currentColor;
    }

    #themeToggle,
    .propose-btn,
    .prefs-group--density {
        display: none;
    }

    .deal-link {
        grid-template-columns: 40% minmax(0, 1fr);
        padding: 0px;
        gap: 10px;
    }

    .deal-visual {
        min-height: 110px;
    }

    /* Toujours masqués sur mobile (trop chargé) */
    .deal-detail,
    .deal-tags,
    .deal-heat-bar,
    .deal-share,
    .deal-comments {
        display: none;
    }

    /* Réduction % masquée sur mobile */
    .deal-discount {
        display: none;
    }

    /* Masquer les options correspondantes dans le panneau Options */
    .pref-check[data-display="heat"],
    .pref-check[data-display="tags"],
    .pref-check[data-display="detail"],
    .pref-check[data-display="discount"],
    .pref-check[data-display="comments"] {
        display: none!important;
    }

    /* 1 étoile + note uniquement */
    .stars-wrap {
        display: none;
    }

    .deal-rating::before {
        content: "★";
        color: var(--muted);
        font-size: 1rem;
    }

    /* Police réduite pour tous les éléments de la carte */
    .deal-title { font-size: 14px; }
    .deal-temp { font-size: 15px; }
    .deal-age { font-size: 14px; font-weight: 500; }
    .deal-rating { padding:0px; border-left: 0px;}
    .current-price { font-size: 15px; }
    .old-price { font-size: 15px; margin: 0 3px; }
    .deal-rating b,
    .stars-base,
    .stars-fill { font-size: 15px; }
    .deal-comments { font-size: 15px; }

    /* Prix barré, étoiles, commentaires sur la même ligne */
    .deal-footer {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        min-height: 26px;
        gap: 0;
    }

    .deal-header{
        min-height: 26px;
    }

    .deal-image {
        inset: 2px 7px;
        height: 131px;
    }

    .deal-body {
        gap: 7px;
        padding: 7px 7px 7px 0;
    }

    .deal-footer-prices {
        flex: 1 1 0;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 4px;
        padding: 0;
    }

    .deal-card--big-price .deal-rating {
        display: none;
    }
}

@media (max-width: 430px) {
    .brand {
        font-size: 18px;
    }

    .brand-logo {
        width: 42px;
        height: 42px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .intro {
        font-size: 0.96rem;
    }

    .deal-visual {
        border-radius: 0px;
        height: 146px;
    }

    .deal-card {
        border-radius: 10px;
    }

    .footer{
        display: none;
    }

    .deal-title{
        font-size: 14px;
        font-weight: 400;
        -webkit-line-clamp: 4;
    }
    .deal-temp {
        font-size: 15px;
    }

    .current-price {
        font-size: 15px;
    }
}
