/* ============================================================
   DEALS PAGE — rules only /deals uses
   ============================================================
   Loaded after gaming-theme.css, and before the first paint only on
   that page (Helpers/PageStyles.cs). A rule belongs here while every
   class it needs is used by this page alone; once another page uses
   one, the rule moves to gaming-theme.css (PageStylesTests).
   ============================================================ */

/* ============================================================
   DEALS PAGE (dl-*)
   ============================================================ */

.dl-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.dl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}
@media (max-width: 640px) {
    .dl-filter-bar { padding: 0.75rem 1rem; gap: 0.6rem; }
    .dl-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.2rem; scrollbar-width: none; flex-basis: 100%; }
    .dl-chips::-webkit-scrollbar { display: none; }
}

.dl-chip-count {
    margin-left: 0.4rem;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
}
.dl-chip.active .dl-chip-count { color: inherit; opacity: 0.8; }

.dl-controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.dl-search, .dl-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: inherit;
    padding: 0.4rem 0.75rem;
    height: 2.1rem;
}
/* The deals search: field and Search button joined, like the site search (gs-*). */
.dl-search-box { display: flex; align-items: stretch; margin: 0; padding: 0; }
.dl-search-field { position: relative; display: flex; flex: 1 1 auto; min-width: 0; }
.dl-search { width: 14rem; padding-right: 2rem; border-right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.dl-search-go {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: none;
    height: 2.1rem;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--accent-cyan);
    color: #031b22;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.dl-search-go:hover { background: #22d3ee; }
.dl-search-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) {
    .dl-controls { width: 100%; }
    .dl-search-box { flex: 1 1 100%; }
    .dl-search { flex: 1 1 auto; width: auto; min-width: 0; height: 2.5rem; font-size: 16px; }   /* 16px: no zoom on focus in iOS */
    .dl-search-go { height: 2.5rem; padding: 0 0.9rem; }
    .dl-select { flex: 1 1 0; min-width: 0; }
}
.dl-search-clear { position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%); width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; background: var(--bg-card); color: var(--text-secondary); font-size: 1rem; line-height: 1; cursor: pointer; }
.dl-search-clear:hover { color: var(--text-primary); background: var(--border-bright); }
.dl-search-clear:focus-visible { outline: 2px solid var(--accent-cyan); }
.dl-inline-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-cyan); cursor: pointer; }
.dl-inline-link:hover { text-decoration: underline; }
.dl-empty-search { min-height: 0; padding: 2rem 1.5rem 1.5rem; }
.dl-search::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.dl-fallback { margin-top: 1.5rem; }
.dl-fallback .gn-section-title { font-size: 1.2rem; }
.dl-fallback-text { margin: 0.35rem 0 1rem; font-size: 0.85rem; color: var(--text-muted); }
.dl-select { cursor: pointer; }
.dl-search:focus-visible, .dl-select:focus-visible { outline: none; border-color: var(--accent-cyan); }

/* Worth it / Every deal, in the hero under the intro. */
.dl-view { display: inline-flex; margin-top: 0.25rem; border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.dl-view-opt { padding: 0.35rem 0.9rem; border-radius: 999px; border: 0; background: transparent; font: inherit; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.dl-view-opt.active { background: var(--accent); color: #fff; }
.dl-view-opt:not(.active):hover { color: var(--text-primary); }
.dl-view-opt:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.dl-intro { margin-bottom: 1rem; }

/* --- Empty / error state (centered card) ------------------ */
.dl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 50vh;
    padding: 3.5rem 1.5rem;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.dl-empty::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 60% at 50% 0%,   rgba(124, 58, 237, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 40% 50% at 100% 100%, rgba(6,   182, 212, 0.15) 0%, transparent 60%);
    z-index: -1;
}

.dl-empty-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.dl-empty-icon-warn { color: var(--score-poor); }

.dl-empty-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.01em;
}

.dl-empty-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 520px;
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.dl-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: center;
}

@media (max-width: 640px) {
    .dl-filter-bar { padding: 0.75rem 1rem; gap: 0.75rem; top: 56px; }
    .dl-chips { gap: 0.3rem; }
    .dl-empty { min-height: 40vh; padding: 2.5rem 1.25rem; }
    .dl-empty-icon { width: 68px; height: 68px; }
}
