/* =============================================================================
   pg-theme-v02.css — Design tokens + overrides from paygasus-payment-v02
   Loaded LAST in cascade (after custom-fixes.css). No !important needed.
   ============================================================================= */

/* 1. Design tokens */
:root {
  --bg:           #fafaf7;
  --bg-deep:      #14130f;
  --ink:          #111110;
  --ink-2:        #2a2925;
  --muted:        #5a5852;
  --muted-2:      #8a8880;
  --rule:         rgba(17, 17, 16, 0.12);
  --rule-soft:    rgba(17, 17, 16, 0.06);
  --accent:       #0d6efd;
  --accent-deep:  #0a58ca;
  --paper:        #f4f2eb;
  --cream:        #fff4b8;
  --serif:        "Tiempos Headline", Georgia, "Times New Roman", serif;
  --sans:         "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:         "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --gut:          clamp(1.25rem, 4vw, 2.5rem);
  --radius:       0;
}

/* 2. Body + base */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

/* Card hover — reference style: off-white card lightens to white, no shadow/zoom */
.pg-product-card { background: var(--bg); transition: background-color 0.2s ease; }
.pg-product-card:hover { background: #fff; box-shadow: none; }
.pg-product-card:hover .pg-card__media img { transform: none; }

/* Product-card status flag chips — matches reference shop.js tag() */
.pg-card__chip--save { background: var(--accent); color: #fff; border: 0; }
.pg-card__chip--memberprice { border: 1px solid var(--accent); color: var(--accent); }
.pg-card__chip--gate { border: 1px solid var(--muted-2); color: var(--muted); }

/* Drawer scroll-lock: pin the page in place (preserves position, no jump-to-top)
   while the slide-out cart is open. Restored on close so sticky resumes. */
html.pg-scroll-locked { overflow: hidden; }
html.pg-scroll-locked body { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

/* Cart drawer — nested add-on sub-lines under a product */
.pg-dline__addons { margin-top: 8px; padding-left: 10px; border-left: 1px solid var(--rule, rgba(17,17,16,.12)); display: flex; flex-direction: column; gap: 4px; }
.pg-dline__addon { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-family: var(--font-text, var(--sans)); font-size: 0.78rem; color: var(--muted, #5a5852); }
.pg-dline__addon-price { font-family: var(--mono, "IBM Plex Mono", monospace); font-size: 0.72rem; color: var(--ink, #111110); white-space: nowrap; }

/* theme.css sets body{overflow-x:hidden}, which turns <body> into a scroll
   container and silently breaks position:sticky (the sticky product image).
   `clip` blocks horizontal scroll WITHOUT creating a scroll container, so the
   sticky gallery works again. Scoped to the product page to be safe. */
body.page-product,
body.page-category { overflow-x: clip; }
/* site.css also sets html{overflow-x:hidden} — same sticky-breaker one level
   up. Same clip treatment, same pages. */
html:has(body.page-product),
html:has(body.page-category) { overflow-x: clip; }

/* Catalog pagination (client-side) */
.pg-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 2.5rem 0 0.5rem;
}
.pg-pager__btn {
  min-width: 40px;
  height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--rule, rgba(17,17,16,.12));
  background: #fff;
  color: var(--ink, #111110);
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.pg-pager__btn:hover:not(:disabled):not(.is-active) { border-color: var(--ink, #111110); }
.pg-pager__btn.is-active {
  background: var(--ink, #111110);
  border-color: var(--ink, #111110);
  color: #fff;
  cursor: default;
}
.pg-pager__btn:disabled { opacity: 0.4; cursor: default; }
.pg-pager__nav { font-size: 1.1rem; line-height: 1; }

/* 3. Page wrappers */
#wrapper,
.page-wrapper,
#main,
.container-fluid,
main#content {
  background: var(--bg);
}

/* 4. Typography scale */
h1, h2, h3, h4 {
  font-family: var(--serif);
}
h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
}
h2 {
  font-size: clamp(1.875rem, 2.6vw, 2.5rem);
  font-weight: 400;
  color: var(--ink);
}
h3 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink);
}
body, p, li, td, th {
  font-size: 17px;
  line-height: 1.6;
}

/* 5. Eyebrow / mono labels */
.eyebrow,
.pg-tick,
.label,
.badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* 6. Primary buttons — black */
.btn-primary,
.add-to-cart,
button[data-button-action="add-to-cart"],
.pg-btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 500;
}
.btn-primary:hover,
.add-to-cart:hover,
button[data-button-action="add-to-cart"]:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
  color: var(--bg);
}
.btn-primary:focus,
.add-to-cart:focus {
  box-shadow: 0 0 0 3px rgba(17, 17, 16, 0.2);
  outline: none;
}

/* 7. Ghost / secondary buttons */
.btn-secondary,
.btn-outline-secondary,
.btn-default,
.pg-btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.btn-secondary:hover,
.btn-outline-secondary:hover {
  background: var(--rule-soft);
  color: var(--ink);
  border-color: var(--ink);
}

/* 8. Cards */
.card,
.pg-product-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: none;
}
.card:hover {
  border-color: rgba(17, 17, 16, 0.22);
}

/* 9. Borders + dividers */
hr,
.separator,
.divider {
  border-color: var(--rule);
}

/* 10. Links */
a {
  color: var(--ink);
}
a:hover {
  color: var(--accent);
}

/* 11. Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select,
.form-control {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
}
input:focus,
textarea:focus,
select:focus,
.form-control:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 16, 0.08);
  outline: none;
}

/* 12. Price display */
.price,
.product-price,
.pg-price {
  font-family: var(--mono);
  color: var(--ink);
}

/* 13. Breadcrumb */
.breadcrumb-item,
.breadcrumb-item a {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* 14. Pagination */
.pagination .page-item .page-link {
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: var(--radius);
  background: transparent;
}
.pagination .page-item.active .page-link {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* 15. Product page: "Complete the setup" / "Pairs with" rail */
.pg-rail {
  margin-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--rule);
  padding: clamp(24px, 3vw, 40px) 0;
}

.pg-rail__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pg-rail__dash {
  display: inline-block;
  height: 1px;
  width: 1.75rem;
  background: var(--accent);
  flex-shrink: 0;
}

.pg-rail__title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 1.75rem;
}

.pg-rail__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: transparent;          /* no gray well — empty cells in a partial last row stay blank */
  border: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
/* Hairline dividers drawn by the cards themselves, so empty grid cells show nothing */
.pg-rail__grid > .pg-mini-card {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 560px) {
  .pg-rail__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .pg-rail__grid { grid-template-columns: repeat(3, 1fr); }
}

.pg-mini-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding: 1.25rem;
}

.pg-mini-card__img-link { display: block; }

.pg-mini-card__img {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background: transparent;
}
.pg-mini-card__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.pg-mini-card__slot {
  display: block;
  width: 100%;
  height: 100%;
}

.pg-mini-card__meta {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pg-mini-card__name {
  margin-top: 0.25rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}
.pg-mini-card__name a { color: var(--ink); text-decoration: none; transition: color 150ms; }
.pg-mini-card__name a:hover { color: var(--accent); }

.pg-mini-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1rem;
}

.pg-mini-card__price {
  font-family: var(--font-fine, "Tiempos Fine", Georgia, serif);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink);
}

.pg-mini-card__gate {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.pg-mini-card__add-btn {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 0.5rem 1rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.pg-mini-card__add-btn:hover { background: var(--ink); color: var(--bg); }
.pg-mini-card__add-btn--unlock { border-color: var(--accent); color: var(--accent); }
.pg-mini-card__add-btn--unlock:hover { background: var(--accent); color: #fff; }

/* Mini-card member price */
.pg-mini-card__priceblock { display: flex; flex-direction: column; gap: 0.05rem; }
.pg-mini-card__price-was {
  font-family: var(--font-text, var(--sans));
  font-size: 0.9rem;
  color: var(--muted-2);
  text-decoration: line-through;
  line-height: 1.2;
}

/* Mini-card bundle checkbox */
.pg-mini-card__bundle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--rule-soft);
  padding: 0.75rem 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms;
  font-weight: 400;
  margin: 0;
}
.pg-mini-card__bundle:hover { color: var(--ink); }
.pg-card__bundle { margin: 0.75rem 0 0; }
.pg-mini-card__bundle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

/* 16. Bundle bar — sticky bottom */
#pg-bundle-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border: 1px solid var(--ink);
  background: var(--ink);
  padding: 1rem 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 8px 32px rgba(17,17,16,.3);
}
#pg-bundle-bar.is-visible { display: flex; }

.pg-bundle-bar__info {
  font-family: var(--sans);
  font-size: 1rem;
  color: rgba(255,255,255,.85);
}
#pg-bundle-count, #pg-bundle-total {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: #fff;
}

.pg-bundle-bar__actions { display: flex; align-items: center; gap: 0.75rem; }

#pg-bundle-clear {
  background: transparent;
  border: none;
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  transition: color 150ms;
  padding: 0;
}
#pg-bundle-clear:hover { color: #fff; }

#pg-bundle-add {
  background: #fff;
  border: none;
  padding: 0.625rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
}
#pg-bundle-add:hover { background: var(--accent); color: #fff; }
#pg-bundle-add:disabled { opacity: 0.5; cursor: wait; }
