.gdrb-wrap{max-width:1100px;margin:0 auto;padding:18px 14px;}
.gdrb-title{font-size:24px;font-weight:800;color:#1a2b4a;margin:0 0 16px;}
.gdrb-filters{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px;}
.gdrb-sel{flex:1 1 160px;min-width:140px;padding:9px 12px;border:1px solid #d3d9e0;border-radius:8px;background:#fff;font-size:14px;color:#16181d;}
/* v1.0.10 — Hide-expired checkbox, conditionally rendered when
   ACP show-expired is ON. Sits alongside the select filters
   without stealing their flex-grow. */
.gdrb-hide-expired{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;padding:9px 12px;border:1px solid #d3d9e0;border-radius:8px;background:#fff;font-size:13px;color:#16181d;cursor:pointer;user-select:none;}
.gdrb-hide-expired input{margin:0;cursor:pointer;}
.gdrb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px;}
/* v1.0.8 — overflow:hidden as safety net so nothing (long amount
   pill, unbroken model list, etc.) can visually escape the card. */
.gdrb-card{display:flex;flex-direction:column;border:1px solid #e6e9ee;border-radius:12px;background:#fff;padding:14px;box-shadow:0 1px 2px rgba(16,24,40,.04);min-width:0;overflow:hidden;}
/* v1.0.8 — flex-wrap:wrap on the head lets the amount pill drop to
   its own line when the manufacturer name + a long amount would
   otherwise overflow the ~280px grid column. Without it, the mfr
   span was being crushed toward zero width and the browser wrapped
   its text one character per line (the "vertical Springfield
   Armory" bug). */
.gdrb-card__head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:6px;min-width:0;}
/* v1.0.8 — mfr text NEVER wraps mid-word / mid-character. Ellipsis
   if it must share space with the logo/amount at very narrow
   widths, but with flex-wrap on the parent this is rarely hit. */
.gdrb-card__mfr{flex:1 1 auto;min-width:0;font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:#1f3a63;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.gdrb-card__logo{flex:0 0 auto;max-height:28px;max-width:130px;width:auto;object-fit:contain;display:block;}
/* v1.0.8 — long amount text (e.g. "FREE XD-M(R) Elite 10mm
   (XDME94510BHCOSP)") was overflowing the card because the pill
   was flex:0 0 auto + white-space:nowrap. Now it can shrink
   (flex:0 1 auto), wrap inside itself (white-space:normal +
   overflow-wrap:break-word), and is capped at 100% of the card
   width. Combined with the .gdrb-card__head flex-wrap the pill
   also drops to its own line for the worst-case width. */
.gdrb-card__amt{flex:0 1 auto;max-width:100%;font-size:15px;font-weight:800;color:#fff;background:#d97706;border-radius:6px;padding:3px 9px;white-space:normal;overflow-wrap:break-word;word-break:break-word;line-height:1.25;}
.gdrb-card__title{font-size:15px;font-weight:700;color:#16181d;line-height:1.3;margin-bottom:6px;}
/* v1.0.9 — eligible_models rendered as individual chips instead
   of a comma-joined text blob. Container wraps; each chip stays
   horizontal (the same lesson from the v1.0.8 manufacturer bug
   applies — one chip = one horizontal item, never per-character).
   First 5 chips visible; remaining chips get .gdrb-chip--hidden
   until the "+N more" button (also styled as a chip) is clicked,
   at which point browse.phtml's JS removes .gdrb-chip--hidden
   from every chip in the container and removes the button.
   .gdrb-card__models (v1.0.7) is fully replaced by .gdrb-chips.

   Palette matches the existing card chrome — soft slate
   background (same family as .gdrb-btn--soft #eef2f8) with the
   card's brand navy for text. */
.gdrb-chips{display:flex;flex-wrap:wrap;gap:4px 6px;margin:0 0 10px;}
.gdrb-chip{display:inline-block;max-width:100%;padding:2px 8px;border-radius:999px;background:#eef2f8;color:#1f3a63;font-size:11px;font-weight:600;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.gdrb-chip--hidden{display:none;}
/* v1.0.11 — bidirectional chip toggle. Adding .gdrb-chips--expanded
   on the container flips every .gdrb-chip--hidden back to visible
   without touching individual chip classes (state lives on the
   container so the JS can swap it repeatedly). */
.gdrb-chips--expanded .gdrb-chip--hidden{display:inline-block;}
.gdrb-chip--more{border:0;cursor:pointer;background:#dfe7f0;color:#1f3a63;font:inherit;font-size:11px;font-weight:700;}
.gdrb-chip--more:hover{background:#c9d5e5;}

/* v1.0.9 — countdown banner for rebates within 30 days of end_date.
   Two tiers: "soon" (8-30 days) is informational-amber; "urgent"
   (0-7 days + "Last day!") is discount-orange to match the amount
   pill palette. Mutually exclusive with the "Expired" tag; only
   one of the three (countdown / expired / plain-ends-date)
   renders per card, gated in the template. */
.gdrb-countdown{font-size:11px;font-weight:800;letter-spacing:.02em;text-transform:uppercase;border-radius:5px;padding:2px 7px;}
.gdrb-countdown--soon{background:#fff4e5;color:#8a5a00;}
.gdrb-countdown--urgent{background:#fde2c6;color:#b8460a;}

/* v1.0.9 — expired rebate state. Card gets muted opacity + a
   subtle desaturation; the "Expired" tag replaces the countdown
   / plain end-date text. Sorted last by both the DB query and
   the client-side re-sort. */
.gdrb-card--expired{opacity:.55;filter:grayscale(.3);}
.gdrb-card--expired .gdrb-card__amt{background:#94a3b8;}
.gdrb-card__expired-tag{font-size:11px;font-weight:800;letter-spacing:.03em;text-transform:uppercase;border-radius:5px;padding:2px 7px;background:#e5e7eb;color:#4b5563;}
/* v1.0.13 — featured rebate. Warm border + soft top glow to lift
   the card visually without changing the layout. Muted when the
   featured card is ALSO expired (opacity from --expired dominates).
   The featured-tag pill sits in the meta row next to the type badge. */
.gdrb-card--featured{border-color:#f59e0b;box-shadow:0 1px 4px rgba(217,119,6,.18),0 -2px 0 #f59e0b inset;}
.gdrb-card__featured-tag{font-size:11px;font-weight:800;letter-spacing:.03em;text-transform:uppercase;border-radius:5px;padding:2px 7px;background:#fde68a;color:#8a5a00;}
.gdrb-card__meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:auto;padding-top:10px;}
.gdrb-card__type{font-size:11px;font-weight:700;border-radius:5px;padding:2px 7px;background:#eef2f8;color:#1f3a63;}
.gdrb-type--free_item,.gdrb-type--free_shipping{background:#e7f4ec;color:#1a7f37;}
.gdrb-type--cash,.gdrb-type--prepaid_card,.gdrb-type--store_credit{background:#fff4e5;color:#8a5a00;}
.gdrb-card__end{font-size:11px;color:#8a93a0;}
.gdrb-card__actions{display:flex;gap:8px;margin-top:12px;}
.gdrb-btn{flex:1 1 auto;text-align:center;font-size:13px;font-weight:700;border-radius:8px;padding:8px 10px;text-decoration:none;}
.gdrb-btn--primary{background:#1f3a63;color:#fff;}
.gdrb-btn--primary:hover{background:#16305a;}
.gdrb-btn--soft{background:#eef2f8;color:#1f3a63;}
.gdrb-btn--soft:hover{background:#dfe7f0;}
.gdrb-empty,.gdrb-noresults{padding:40px 16px;text-align:center;color:#6b7480;font-size:15px;}
@media(max-width:520px){.gdrb-grid{grid-template-columns:1fr;}}
