/*
Theme Name: CouponPress
Theme URI: https://example.com/couponpress
Author: Your Name
Author URI: https://example.com
Description: A coupon & deals theme with a custom Coupon post type, Stores and Categories taxonomies, tear-off ticket cards, and one-click code reveal + copy.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: couponpress
Tags: coupons, deals, e-commerce, custom-post-type
*/

/* ---------- Tokens ---------- */
:root {
  --paper: #F8FAFC;          /* page background */
  --white: #FFFFFF;          /* surfaces */
  --ink: #111827;            /* primary text */
  --ink-soft: #6B7280;       /* secondary text */
  --primary: #2563EB;        /* actions / links */
  --primary-dark: #1D4ED8;
  --success: #16A34A;        /* verified / positive (AA on white) */
  --success-bg: #F0FDF4;
  --warning: #F59E0B;        /* badges / expiring */
  --warning-dark: #B45309;
  --error: #DC2626;          /* expired / failures */
  --line: #E5E7EB;
  --stub: #F1F5F9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 8px 24px rgba(17, 24, 39, .07);
  --shadow-lift: 0 2px 4px rgba(17, 24, 39, .06), 0 16px 40px rgba(17, 24, 39, .14);
  --font-display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-code: "IBM Plex Mono", "Courier New", monospace;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 24px;
  min-height: 68px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.35rem; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.site-logo:hover { text-decoration: none; }
.site-logo .tag {
  background: var(--warning); color: var(--ink);
  font-size: .7rem; padding: 2px 8px; border-radius: 999px;
  font-family: var(--font-code); font-weight: 600; letter-spacing: .04em;
}
.main-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a { color: var(--ink-soft); font-weight: 500; }
.main-nav a:hover { color: var(--ink); text-decoration: none; }
.header-search { margin-left: auto; }
.header-search form { display: flex; }
.header-search input[type="search"] {
  border: 1px solid var(--line); border-right: 0;
  border-radius: 999px 0 0 999px; padding: 8px 16px;
  font-family: var(--font-body); font-size: .9rem; min-width: 180px;
  background: var(--paper);
}
.header-search button {
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  border-radius: 0 999px 999px 0; padding: 8px 16px; cursor: pointer;
  font-weight: 600;
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 48px; text-align: center; }
.hero .eyebrow {
  font-family: var(--font-code); font-size: .8rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary-dark);
}
.hero h1 span { background: linear-gradient(transparent 62%, var(--warning) 62%); }
.hero p { color: var(--ink-soft); max-width: 560px; margin: 12px auto 0; }

/* ---------- Coupon grid ---------- */
.coupon-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  padding: 8px 0 56px;
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding: 24px 0 8px;
}
.section-head a { font-weight: 600; white-space: nowrap; }

/* ---------- Ticket card (signature) ---------- */
.ticket {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ticket:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.ticket-main { padding: 22px 22px 18px; flex: 1; }
.ticket-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.store-chip {
  font-size: .78rem; font-weight: 600; color: var(--ink-soft);
  background: var(--stub); border-radius: 999px; padding: 3px 12px;
}
.discount-badge {
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  background: var(--warning); color: var(--ink);
  padding: 4px 12px 4px 16px; border-radius: 4px 999px 999px 4px;
  position: relative;
}
.discount-badge::before {
  content: ""; position: absolute; left: 6px; top: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--white); transform: translateY(-50%);
}
.ticket h3 { margin: 0 0 8px; font-size: 1.12rem; font-weight: 700; }
.ticket h3 a { color: var(--ink); }
.ticket .excerpt { color: var(--ink-soft); font-size: .92rem; margin: 0; }
.ticket .expiry {
  font-family: var(--font-code); font-size: .75rem; color: var(--ink-soft);
  margin-top: 12px;
}
.ticket .expiry.expired { color: var(--error); }

/* Perforated stub with punched notches */
.ticket-stub {
  border-top: 2px dashed var(--line);
  background: var(--stub);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 16px 22px;
  position: relative;
}
.ticket-stub::before, .ticket-stub::after {
  content: ""; position: absolute; top: -11px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
}
.ticket-stub::before { left: -11px; }
.ticket-stub::after { right: -11px; }

.code-row { display: flex; gap: 10px; align-items: stretch; }
.coupon-code {
  flex: 1; font-family: var(--font-code); font-weight: 600;
  letter-spacing: .08em; font-size: .95rem;
  background: var(--white); border: 1.5px dashed var(--success);
  border-radius: 8px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--success); min-width: 0; overflow-wrap: anywhere;
}
.coupon-code[data-hidden="true"] { filter: blur(5px); user-select: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; font-family: var(--font-body);
  font-weight: 700; font-size: .9rem; border-radius: 8px;
  padding: 10px 18px; transition: background .15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--white); color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--ink-soft); }
.deal-note { font-size: .8rem; color: var(--ink-soft); margin: 8px 0 0; text-align: center; }

/* ---------- Single coupon ---------- */
.single-coupon .ticket { max-width: 680px; margin: 40px auto; }
.single-coupon .ticket-main { padding: 32px; }
.single-coupon .content { color: var(--ink); font-size: 1rem; }
.breadcrumbs { font-size: .82rem; color: var(--ink-soft); padding-top: 24px; }

/* ---------- Store / category lists ---------- */
.term-cloud { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 0 40px; }
.term-cloud a {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 16px; font-size: .88rem;
  color: var(--ink); font-weight: 500;
}
.term-cloud a:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
.term-cloud .count { color: var(--ink-soft); font-size: .78rem; }

/* ---------- Archive / posts fallback ---------- */
.page-title { padding-top: 40px; }
.archive-description { color: var(--ink-soft); max-width: 640px; }
article.post, .page-content {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; margin: 24px 0;
}
.pagination { display: flex; gap: 8px; justify-content: center; padding: 8px 0 56px; flex-wrap: wrap; }
.pagination .page-numbers {
  border: 1px solid var(--line); background: var(--white);
  border-radius: 8px; padding: 8px 14px; color: var(--ink); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination a.page-numbers:hover { border-color: var(--primary); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #C9CDD6; margin-top: 40px;
  padding: 40px 0; font-size: .9rem;
}
.site-footer a { color: #93C5FD; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .header-search { margin-left: 0; width: 100%; }
  .header-search input[type="search"] { width: 100%; }
  .hero { padding: 40px 0 32px; }
}

/* ---------- v2: card top row ---------- */
.ticket-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ticket-top-left { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.discount-headline { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.01em; }
.ticket-logo { flex-shrink: 0; }
.ticket-logo .store-logo-img { max-height: 34px; width: auto; max-width: 110px; object-fit: contain; }
.store-lettermark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ink); color: #FBBF24;
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
}
.pill { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill-yellow { background: var(--warning); color: var(--ink); }
.ticket.is-top-pick { border-color: var(--warning); box-shadow: 0 0 0 2px var(--warning), var(--shadow); }

.btn-wide { flex: 1; }
.btn.is-done { background: var(--primary-dark); }
.ticket-footline {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 10px; font-size: .75rem; color: var(--ink-soft);
  flex-wrap: wrap;
}
.badge { font-weight: 600; }
.badge-verified { color: var(--success); }
.badge-unverified { color: var(--warning-dark); }

/* ---------- v2: store hero ---------- */
.store-hero { background: var(--white); border-bottom: 1px solid var(--line); padding: 40px 0; }
.store-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.store-identity { display: flex; align-items: center; gap: 20px; }
.store-logo-big .store-logo-img { max-height: 64px; width: auto; max-width: 160px; object-fit: contain; }
.store-logo-big .store-lettermark { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 16px; }
.store-hero h1 { margin: 0 0 4px; font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.store-sub { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.best-today {
  background: var(--ink); color: #fff; border-radius: var(--radius);
  padding: 14px 22px; text-align: center;
}
.best-today .best-label { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #C9CDD6; }
.best-today .best-value { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: #FBBF24; }

.disclosure { font-size: .78rem; color: var(--ink-soft); margin: 16px 0 0; text-align: center; }

/* ---------- v2: filter chips ---------- */
.filter-bar { display: flex; gap: 10px; padding: 20px 0 4px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink);
  border-radius: 999px; padding: 7px 18px; font-weight: 600; font-size: .85rem;
  cursor: pointer; font-family: var(--font-body);
}
.chip:hover { border-color: var(--ink-soft); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- v2: about + scorecard ---------- */
.store-about {
  display: grid; grid-template-columns: 2fr 1fr; gap: 24px;
  margin: 40px 0 8px;
}
.store-about-card, .store-scorecard {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}
.store-scorecard dl { margin: 0; }
.store-scorecard dl div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.store-scorecard dl div:last-child { border-bottom: 0; }
.store-scorecard dt { color: var(--ink-soft); font-size: .88rem; }
.store-scorecard dd { margin: 0; font-weight: 700; font-family: var(--font-code); font-size: .88rem; }
@media (max-width: 780px) { .store-about { grid-template-columns: 1fr; } }

/* ---------- v2: store cards grid ---------- */
.store-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  padding: 8px 0 40px;
}
.store-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center; color: var(--ink);
  transition: transform .15s ease, border-color .15s ease;
}
.store-card:hover { transform: translateY(-3px); border-color: var(--primary); text-decoration: none; }
.store-card-logo .store-logo-img { max-height: 40px; width: auto; max-width: 120px; object-fit: contain; }
.store-card-name { font-weight: 700; }
.store-card-count { font-size: .76rem; color: var(--ink-soft); }

/* ---------- v2: FAQ ---------- */
.faq-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  padding: 8px 0 48px;
}
.faq-item {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.faq-item h3 { margin: 0 0 8px; font-size: 1.02rem; }
.faq-item p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
@media (max-width: 640px) { .faq-grid { grid-template-columns: 1fr; } }

/* ---------- v2: home hero ---------- */
.hero-home { background: var(--white); border-bottom: 1px solid var(--line); }
.hero-search {
  display: flex; gap: 10px; max-width: 560px; margin: 24px auto 0;
}
.hero-search input[type="search"] {
  flex: 1; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 18px; font-family: var(--font-body); font-size: 1rem;
  background: var(--paper); min-width: 0;
}
.hero-search input[type="search"]:focus { border-color: var(--primary); outline: none; }
.stat-strip {
  display: flex; justify-content: center; gap: 44px;
  margin-top: 32px; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; }
.stat span { font-size: .78rem; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 640px) { .hero-search { flex-direction: column; } }

/* ---------- v3: badges, voting, success rate ---------- */
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-ink { background: var(--ink); color: #fff; }
.pill-success { background: var(--success); color: #fff; }
.pill-soft { background: var(--stub); color: var(--ink-soft); }
.foot-right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.success-rate { font-weight: 700; color: var(--success); font-family: var(--font-code); font-size: .75rem; }
.vote-row { display: inline-flex; gap: 2px; }
.vote {
  border: 1px solid var(--line); background: var(--white); cursor: pointer;
  border-radius: 6px; padding: 2px 7px; font-size: .8rem; line-height: 1.4;
}
.vote:hover:not(:disabled) { border-color: var(--ink-soft); }
.vote:disabled { opacity: .45; cursor: default; }
.vote.is-voted { opacity: 1; border-color: var(--success); background: var(--success-bg); }

/* ---------- v3: live search dropdown ---------- */
.live-search { position: relative; }
.live-search-results {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 300px; max-width: 92vw;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.ls-group {
  font-family: var(--font-code); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 10px 16px 4px;
}
.ls-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 16px; color: var(--ink); font-size: .9rem;
}
.ls-item span { color: var(--ink-soft); font-size: .78rem; white-space: nowrap; }
.ls-item:hover { background: var(--paper); text-decoration: none; }

/* ---------- v3: store tips + newsletter ---------- */
.store-side { display: flex; flex-direction: column; gap: 24px; }
.store-tips ul { margin: 0; padding-left: 20px; }
.store-tips li { margin: 6px 0; color: var(--ink-soft); font-size: .92rem; }
.newsletter {
  background: var(--ink); color: #fff; border-radius: var(--radius);
  padding: 40px; text-align: center; margin: 24px 0 48px;
}
.newsletter h2 { margin: 0 0 6px; color: #fff; }
.newsletter p { color: #C9CDD6; margin: 0 0 20px; }
.newsletter form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }
.newsletter input[type="email"] {
  flex: 1; border: 0; border-radius: 10px; padding: 13px 16px;
  font-family: var(--font-body); font-size: 1rem; min-width: 0;
}
@media (max-width: 640px) { .newsletter form { flex-direction: column; } }

/* ---------- v4.1: copy modal (Dealspotr-style layout) ---------- */
.cp-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cp-modal[hidden] { display: none; }
.cp-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .6); animation: cpFade .2s ease; }
.cp-modal-dialog {
  position: relative; background: var(--white); border-radius: 18px;
  max-width: 460px; width: 100%; padding: 46px 34px 30px; text-align: center;
  box-shadow: var(--shadow-lift); animation: cpPop .25s cubic-bezier(.2,.9,.3,1.2);
  max-height: 92vh; overflow-y: auto;
}
.cp-modal-close {
  position: absolute; top: 12px; left: 16px; border: 0; background: none;
  font-size: 1.7rem; line-height: 1; cursor: pointer; color: var(--ink-soft); padding: 6px;
}
.cp-modal-close:hover { color: var(--ink); }

.cp-modal-logo-frame {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 150px; min-height: 84px; padding: 12px 20px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px;
}
.cp-modal-logo { max-height: 56px; max-width: 170px; width: auto; object-fit: contain; }
.cp-modal-lettermark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--ink); color: #FBBF24;
  font-family: var(--font-display); font-weight: 800; font-size: 1.7rem;
}
.cp-modal-offer { margin: 0 0 18px; font-size: 1.35rem; }

.cp-copied-tip {
  position: relative; display: inline-block;
  background: var(--ink); color: #fff; font-size: .82rem; font-weight: 600;
  border-radius: 8px; padding: 8px 16px; margin-bottom: 14px;
}
.cp-copied-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0;
}
.cp-copied-tip.is-pulse { animation: cpPulse .4s ease; }
@keyframes cpPulse { 50% { transform: scale(1.06); } }

.cp-modal-code {
  font-family: var(--font-code); font-weight: 600; letter-spacing: .12em;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  background: var(--white); border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 20px; margin: 0 auto 14px; overflow-wrap: anywhere;
  box-shadow: inset 0 1px 3px rgba(17,24,39,.05);
}
.btn-ghost { background: var(--white); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803D; }
.cp-copy-again { margin-bottom: 18px; }
.cp-modal-continue { width: 100%; padding: 15px; font-size: 1.02rem; }
.cp-modal-note { font-size: .8rem; color: var(--ink-soft); margin: 10px 0 0; }
.cp-modal-blocked { color: var(--warning-dark); font-weight: 600; }
body.cp-modal-open { overflow: hidden; }

.cp-modal-vote { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.cp-modal-vote h3 { margin: 0 0 12px; font-size: 1.05rem; }
.cp-vote-buttons { display: flex; gap: 10px; justify-content: center; }
.cp-vote-buttons .btn { padding: 9px 22px; }
.js-modal-vote.is-voted { border-color: var(--success); background: var(--success-bg); }
.cp-vote-thanks { color: var(--success); font-weight: 600; font-size: .88rem; margin: 12px 0 0; }

@keyframes cpFade { from { opacity: 0; } }
@keyframes cpPop { from { opacity: 0; transform: scale(.92) translateY(8px); } }

@media (max-width: 640px) { .cp-modal-dialog { padding: 42px 20px 22px; } }

/* ---------- v4: card actions ---------- */
.ticket-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.card-actions { display: flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--white); cursor: pointer;
  border-radius: 8px; width: 30px; height: 30px; font-size: .95rem; line-height: 1;
  color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s ease, color .15s ease;
}
.icon-btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.icon-btn.is-on { color: var(--error); border-color: var(--error); }

/* ---------- v4: live-search skeleton ---------- */
.ls-skeleton { padding: 12px 16px; display: grid; gap: 8px; }
.ls-skeleton span {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--stub) 25%, #E9EEF5 50%, var(--stub) 75%);
  background-size: 200% 100%; animation: cpShimmer 1.1s linear infinite;
}
@keyframes cpShimmer { to { background-position: -200% 0; } }

/* ---------- v4: mobile bottom nav ---------- */
.bottom-nav { display: none; }
@media (max-width: 640px) {
  body { padding-bottom: 64px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: var(--white); border-top: 1px solid var(--line);
    justify-content: space-around; padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--ink-soft); font-size: .68rem; padding: 4px 14px; min-width: 64px;
  }
  .bottom-nav a:hover, .bottom-nav a[aria-current="page"] { color: var(--primary); text-decoration: none; }
  .bottom-nav .bn-icon { font-size: 1.15rem; line-height: 1; }
  .cp-modal-dialog { padding: 28px 20px 20px; }
}

/* ---------- v5: related offers in modal ---------- */
.cp-modal-related { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; text-align: left; }
.cp-modal-related h3 { margin: 0 0 10px; font-size: 1rem; text-align: center; }
.cp-related-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; color: var(--ink); font-size: .88rem;
}
.cp-related-item:hover { background: var(--stub); text-decoration: none; }
.cp-related-item strong {
  flex-shrink: 0; min-width: 74px; text-align: center;
  background: var(--stub); border-radius: 6px; padding: 4px 8px;
  font-size: .78rem; color: var(--ink);
}

/* ---------- v5: expired cards ---------- */
.ticket.is-expired { opacity: .62; }
.ticket.is-expired:hover { opacity: 1; }
.ticket.is-expired .discount-headline { color: var(--ink-soft); }

/* ---------- v5: deal loading spinner ---------- */
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: cpSpin .7s linear infinite;
}
@keyframes cpSpin { to { transform: rotate(360deg); } }

/* ---------- v5: search extras ---------- */
.pill-primary { background: var(--primary); color: #fff; }
.ls-empty { padding: 4px 16px 8px; font-size: .82rem; color: var(--ink-soft); }
button.ls-item { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; font-family: var(--font-body); font-size: .9rem; }
.ls-item.is-active { background: var(--stub); }

/* ---------- v5.1: copy-flow fixes ---------- */
/* Glassmorphism dialog (with solid fallback for browsers without backdrop-filter) */
.cp-modal-backdrop { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@supports (backdrop-filter: blur(1px)) {
  .cp-modal-dialog { background: rgba(255, 255, 255, .88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
}
.cp-modal-heading { margin: 6px 0 14px; font-size: 1.3rem; }
.cp-check { line-height: 0; }
.cp-check svg { width: 54px; height: 54px; }
.cp-copy-fail { color: var(--error); font-weight: 600; font-size: .85rem; margin: 0 0 8px; }
.cp-count { font-family: var(--font-code); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.ticket.is-expired .js-fav, .ticket.is-expired .js-share { opacity: .5; }
