/* ============================================================================
   Costco97 — Deals by Location directory (from Deals by Location.dc.html).
   ========================================================================== */

/* The filter toggles [hidden] on cards/pills/groups — never let a display
   rule defeat it (the recurring UA-stylesheet bug). */
.c97dl [hidden] { display: none !important; }

/* ---- Hero ---- */
.c97dl-hero { background: linear-gradient(180deg, var(--c97-blue-tint) 0%, #f7f9fc 60%, #fff 100%); padding-top: 16px; }
.c97dl-hero__inner { max-width: 840px; margin: 0 auto; padding: 44px 22px 46px; text-align: center; }
.c97dl-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c97-blue); background: #fff; border: 1px solid #dbe4f0; padding: 7px 15px; border-radius: var(--c97-r-pill); margin-bottom: 22px; }
.c97dl-h1 { margin: 0; font-size: 58px; line-height: 1.03; font-weight: 600; letter-spacing: -.025em; color: var(--c97-ink); }
.c97dl-sub { margin: 20px auto 0; max-width: 600px; font-size: 20px; line-height: 1.5; font-weight: 300; color: #484850; }
.c97dl-x97 { font-weight: 500; color: var(--c97-ink); }
.c97dl-x97 span { color: var(--c97-navy); }
.c97dl-stats { display: flex; justify-content: center; gap: 44px; margin-top: 34px; flex-wrap: wrap; }
.c97dl-stat__n { font-size: 32px; font-weight: 600; letter-spacing: -.02em; color: var(--c97-blue); }
.c97dl-stat__l { font-size: 13px; color: var(--c97-muted); margin-top: 2px; }
.c97dl-alldeals { max-width: 660px; margin: 38px auto 0; background: #fff; border: 1px solid #dbe4f0; border-radius: var(--c97-r-md); padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; text-align: left; box-shadow: 0 16px 38px -26px rgba(0,42,92,.5); }
.c97dl-alldeals__main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.c97dl-alldeals__icon { flex: none; width: 46px; height: 46px; border-radius: 13px; background: var(--c97-blue-tint); display: flex; align-items: center; justify-content: center; }
.c97dl-alldeals__t { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--c97-ink); }
.c97dl-alldeals__b { font-size: 14px; line-height: 1.45; color: #707070; margin-top: 2px; }
.c97dl-alldeals__btn { flex: none; display: inline-flex; align-items: center; gap: 8px; background: var(--c97-blue); color: #fff; border-radius: var(--c97-r-pill); padding: 13px 22px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.c97dl-alldeals__btn:hover { background: var(--c97-blue-press); color: #fff; text-decoration: none; }
.c97dl-alldeals__btn span { font-size: 17px; line-height: 1; }

/* ---- Sticky filter + A–Z rail ---- */
.c97dl-sticky { position: sticky; top: 58px; z-index: 40; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--c97-line-soft); }
.c97dl-sticky__inner { padding-top: 14px; padding-bottom: 14px; display: flex; flex-direction: column; gap: 13px; }
.c97dl-searchwrap { position: relative; width: 100%; max-width: 620px; margin: 0 auto; }
.c97dl-searchwrap svg { position: absolute; left: 19px; top: 50%; transform: translateY(-50%); }
.c97dl-searchwrap input { width: 100%; border: 1px solid var(--c97-line); border-radius: var(--c97-r-pill); background: #fff; padding: 15px 18px 15px 50px; font-size: 16px; color: var(--c97-ink); outline: none; font-family: inherit; transition: border-color .2s, box-shadow .2s; }
.c97dl-searchwrap input:focus { border-color: var(--c97-blue); box-shadow: 0 0 0 3px rgba(0,96,169,.12); }
.c97dl-searchwrap input::placeholder { color: #a1a1a8; font-weight: 400; }
.c97dl-alpha { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.c97dl-alpha button { width: 27px; height: 30px; border: none; background: transparent; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--c97-blue); font-family: inherit; transition: background .18s, color .18s; }
.c97dl-alpha button:hover:not(:disabled) { background: var(--c97-blue-tint); }
.c97dl-alpha button:disabled { color: #cfcfd6; cursor: default; }

/* ---- Groups ---- */
.c97dl-results { padding-top: 36px; padding-bottom: 20px; }
.c97dl-groups { display: flex; flex-direction: column; gap: 40px; }
.c97dl-group { scroll-margin-top: 130px; }
.c97dl-group__head { display: flex; align-items: center; gap: 18px; margin: 0 0 22px; }
.c97dl-group__letter { font-size: 38px; font-weight: 700; color: var(--c97-blue); letter-spacing: -.03em; line-height: 1; min-width: 34px; }
.c97dl-group__rule { flex: 1; height: 1px; background: var(--c97-line-soft); }
/* Column flow (masonry-style), not a row grid: rows sized by their tallest
   card left dead air under short states. Columns pack tight, auto-balance,
   and read alphabetically downward like a phone directory. */
.c97dl-grid { columns: 322px 3; column-gap: 18px; }
.c97dl-card { border: 1px solid var(--c97-line-soft); border-radius: var(--c97-r-sm); padding: 20px 22px; background: #fff; transition: box-shadow .2s, border-color .2s; break-inside: avoid; margin-bottom: 18px; }
.c97dl-card:hover { box-shadow: 0 10px 30px -18px rgba(0,0,0,.22); border-color: #dbe4f0; }
.c97dl-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 15px; }
.c97dl-card__head h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.c97dl-card__head h3 a { color: var(--c97-ink); }
.c97dl-card__head h3 a:hover { color: var(--c97-blue); text-decoration: none; }
.c97dl-card__head span { flex: none; font-size: 12px; color: var(--c97-muted); font-weight: 500; }
.c97dl-card__cities { display: flex; flex-wrap: wrap; gap: 8px 9px; }
.c97dl-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--c97-ink); padding: 8px 13px; border-radius: var(--c97-r-pill); background: var(--c97-wash); transition: background .2s, color .2s; }
.c97dl-pill:hover { background: var(--c97-blue-tint); color: var(--c97-blue); text-decoration: none; }
.c97dl-pill span { font-size: 11px; color: #a1a1a8; font-weight: 500; }

/* ---- Empty state ---- */
.c97dl-empty { text-align: center; padding: 70px 20px 90px; }
.c97dl-empty svg { margin: 0 auto 14px; display: block; }
.c97dl-empty__t { font-size: 20px; font-weight: 600; color: var(--c97-ink); }
.c97dl-empty p { margin: 8px 0 20px; font-size: 15px; color: var(--c97-muted); }

/* ---- Missing-location note ---- */
.c97dl-notewrap { padding-top: 8px; padding-bottom: 56px; }
.c97dl-note { background: var(--c97-wash); border-radius: var(--c97-r-md); padding: 30px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.c97dl-note__main { max-width: 560px; }
.c97dl-note__t { font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--c97-ink); }
.c97dl-note p { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: #707070; }
.c97dl-note .c97-btn { flex: none; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.c97dl-h1 { font-size: 46px; }
	.c97dl-alpha { justify-content: flex-start; }
}
@media (max-width: 640px) {
	.c97dl-h1 { font-size: 36px; }
	.c97dl-grid { columns: 1; }
	.c97dl-stats { gap: 20px; }
	.c97dl-alldeals { flex-direction: column; align-items: stretch; }
	.c97dl-alldeals__btn { justify-content: center; }
}

/* Ad card in the state grid — occupies one cell, label only when filled,
   collapses to nothing (zero height, align-start) when no ad serves. */
.c97dl-adcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; break-inside: avoid; margin-bottom: 18px; }
.c97dl-adcard .c97-adbar__label { display: none; }
.c97dl-adcard:has(iframe) .c97-adbar__label { display: block; }

/* ---- Tag-directory variant (page-deals-by-category.php) ---- */
.c97dl-card--tags { break-inside: auto; margin-bottom: 0; }
.c97dl-adrow { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.c97dl-adrow .c97-adbar__label { display: none; }
.c97dl-adrow:has(iframe) { margin: 8px 0 34px; }
.c97dl-adrow:has(iframe) .c97-adbar__label { display: block; }
