/* ===================================================================
   courses-public.css — shared styles for /courses and /courses/:slug
   Brand: dark navy + #ff8c00 gold accents
   =================================================================== */

:root {
  --pc-bg-deep:   #0a0a0f;
  --pc-bg-1:      #14141c;
  --pc-bg-2:      #1c1c28;
  --pc-bg-input:  #0f0f17;
  --pc-border:    rgba(255, 255, 255, 0.08);
  --pc-border-soft: rgba(255, 255, 255, 0.05);
  --pc-border-gold: rgba(255, 140, 0, 0.3);

  --pc-text:      #f0f0f5;
  --pc-text-muted:#9a9aab;
  --pc-text-dim:  #6a6a78;

  --pc-gold:      #ff8c00;
  --pc-gold-light:#ffa733;
  --pc-gold-dark: #d97700;
  --pc-gold-glow: rgba(255, 140, 0, 0.18);

  --pc-success:   #10b981;
  --pc-success-bg:rgba(16, 185, 129, 0.12);
  --pc-warn:      #fbbf24;
  --pc-warn-bg:   rgba(251, 191, 36, 0.12);
  --pc-locked:    #6a6a78;
  --pc-locked-bg: rgba(106, 106, 120, 0.1);

  --pc-radius:    12px;
  --pc-radius-lg: 18px;

  --pc-shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --pc-shadow-card-hover: 0 8px 32px rgba(255, 140, 0, 0.15);
}

/* ============= PAGE LAYOUT ============= */

.pc-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============= HERO ============= */

.pc-hero {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 140, 0, 0.10), transparent 60%),
    linear-gradient(180deg, #0e0e16 0%, var(--pc-bg-deep) 100%);
  border-bottom: 1px solid var(--pc-border);
  padding: 60px 24px 50px;
  position: relative;
  overflow: hidden;
}

.pc-hero::before {
  /* Subtle chess board grid texture */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 80% at center, black 30%, transparent 80%);
}

.pc-hero-inner { position: relative; max-width: 1320px; margin: 0 auto; }

.pc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--pc-gold);
  margin-bottom: 14px;
}

.pc-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--pc-gold);
}

.pc-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 700;
  color: var(--pc-text);
  margin: 0 0 16px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.pc-hero h1 .pc-accent { color: var(--pc-gold); }

.pc-hero-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--pc-text-muted);
  max-width: 640px;
  margin: 0;
  line-height: 1.6;
}

/* ============= HERO LIBRARY CTA =============
   Big "Go to My Library" button shown below the hero text,
   only visible to logged-in users (toggled by inline script).
   ============================================== */
.pc-hero-library-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #ff8c00 0%, #ff6347 100%);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  box-shadow:
    0 4px 16px rgba(255, 140, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.pc-hero-library-cta-icon {
  font-size: 18px;
  line-height: 1;
}

.pc-hero-library-cta-arrow {
  font-size: 16px;
  line-height: 1;
  margin-left: 2px;
  transition: transform 0.18s ease;
}

.pc-hero-library-cta:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(255, 140, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  filter: brightness(1.06);
}

.pc-hero-library-cta:hover .pc-hero-library-cta-arrow {
  transform: translateX(4px);
}

.pc-hero-library-cta:active {
  transform: translateY(0);
}

/* Hidden by default — JS shows it only for logged-in users */
.pc-hero-library-cta.is-hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .pc-hero-library-cta {
    margin-top: 22px;
    padding: 12px 22px;
    font-size: 14px;
  }
  .pc-hero-library-cta-icon { font-size: 16px; }
}

/* ============= FILTERS ============= */

.pc-filters {
  background: var(--pc-bg-1);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 14px;
  margin-top: -28px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 10px;
  position: relative;
  z-index: 5;
  box-shadow: var(--pc-shadow-card);
}

@media (max-width: 900px) {
  .pc-filters { grid-template-columns: 1fr 1fr; }
  .pc-filters .pc-filter-search { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .pc-filters { grid-template-columns: 1fr; }
}

.pc-input,
.pc-select {
  background: var(--pc-bg-input);
  border: 1px solid var(--pc-border);
  color: var(--pc-text);
  padding: 11px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.pc-input:focus,
.pc-select:focus {
  outline: none;
  border-color: var(--pc-gold);
  box-shadow: 0 0 0 3px var(--pc-gold-glow);
}

/* ============= COURSE GRID ============= */

.pc-section {
  padding: 0 24px 60px;
}

.pc-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.pc-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pc-text);
  margin: 0;
}

.pc-section-meta {
  color: var(--pc-text-muted);
  font-size: 13px;
}

.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

/* ============= COURSE CARD ============= */

.pc-card {
  background: var(--pc-bg-1);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.pc-card:hover {
  transform: translateY(-4px);
  border-color: var(--pc-border-gold);
  box-shadow: var(--pc-shadow-card-hover);
}

.pc-card-thumb {
  aspect-ratio: 3 / 2;          /* sync with lesson cards (1536×1024 thumbnails) */
  background: linear-gradient(135deg, #1a1a28 0%, #2a1a10 100%);
  position: relative;
  overflow: hidden;
}

.pc-card-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.3;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 140, 0, 0.04) 0, rgba(255, 140, 0, 0.04) 12px, transparent 12px, transparent 24px);
}

.pc-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;  /* keeps title text at top of image visible */
  display: block;
}

.pc-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(180deg, var(--pc-gold) 0%, var(--pc-gold-dark) 100%);
  color: #000;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 100px;
  letter-spacing: 0.3px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pc-card-badge.b-free   { background: var(--pc-success); color: #fff; }
.pc-card-badge.b-owned  { background: var(--pc-success); color: #fff; }
.pc-card-badge.b-sub    { background: linear-gradient(180deg, #b083f0 0%, #8b5fbf 100%); color: #fff; }

/* [batch3u] MOST POPULAR badge — top-left of card thumb.
   Gold-on-dark, slight pulse hint via shadow. Sits opposite the
   price badge (top-right) so they never collide. */
.pc-most-popular-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(180deg, var(--pc-gold) 0%, var(--pc-gold-dark) 100%);
  color: #0a0e14;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 100px;
  z-index: 2;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
/* Subtle gold ring on the whole card for featured ones */
.pc-card-wrap.is-featured > .pc-card {
  outline: 1px solid rgba(255, 140, 0, 0.35);
  outline-offset: -1px;
}
.pc-card-wrap.is-featured > .pc-card:hover {
  outline-color: var(--pc-gold);
}

.pc-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pc-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--pc-text);
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-card-tagline {
  font-size: 13px;
  color: var(--pc-text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--pc-border-soft);
}

.pc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--pc-bg-2);
  border: 1px solid var(--pc-border-soft);
  border-radius: 100px;
  font-size: 11px;
  color: var(--pc-text-muted);
  font-weight: 500;
}

.pc-chip-icon { color: var(--pc-gold); font-size: 11px; }

.pc-chip.gold {
  border-color: var(--pc-border-gold);
  background: var(--pc-gold-glow);
  color: var(--pc-gold);
}

/* ============= EMPTY / LOADING STATES ============= */

.pc-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--pc-text-muted);
}

.pc-state-icon {
  font-size: 48px;
  opacity: 0.4;
  margin-bottom: 16px;
}

.pc-state h3 {
  color: var(--pc-text);
  font-size: 1.2rem;
  margin: 0 0 8px;
  font-weight: 600;
}

.pc-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--pc-border);
  border-top-color: var(--pc-gold);
  border-radius: 50%;
  animation: pc-spin 0.7s linear infinite;
}

@keyframes pc-spin { to { transform: rotate(360deg); } }

/* ============= BUTTONS ============= */

.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
  background: var(--pc-bg-2);
  color: var(--pc-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.pc-btn:hover {
  border-color: var(--pc-gold);
  color: var(--pc-gold);
}

.pc-btn-gold {
  background: linear-gradient(180deg, var(--pc-gold) 0%, var(--pc-gold-dark) 100%);
  color: #1a1a1a;
  border-color: var(--pc-gold);
  font-weight: 700;
}

.pc-btn-gold:hover {
  background: linear-gradient(180deg, var(--pc-gold-light) 0%, var(--pc-gold) 100%);
  color: #1a1a1a;
  box-shadow: 0 0 20px var(--pc-gold-glow);
  border-color: var(--pc-gold-light);
}

.pc-btn-large { padding: 14px 28px; font-size: 15px; }

/* ============= DETAIL PAGE ============= */

.pc-detail-hero {
  background:
    radial-gradient(ellipse 60% 100% at 100% 50%, rgba(255, 140, 0, 0.08), transparent 60%),
    linear-gradient(180deg, #0e0e16 0%, var(--pc-bg-deep) 100%);
  border-bottom: 1px solid var(--pc-border);
  padding: 50px 24px 40px;
  position: relative;
}

.pc-detail-hero-grid {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 900px) {
  .pc-detail-hero-grid { grid-template-columns: 1fr; }
}

.pc-detail-meta a {
  color: var(--pc-gold);
  text-decoration: none;
  font-size: 13px;
}

.pc-detail-meta a:hover { text-decoration: underline; }

.pc-detail-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
  color: var(--pc-text);
  margin: 12px 0 14px;
  line-height: 1.2;
}

.pc-detail-tagline {
  font-size: 1.1rem;
  color: var(--pc-text-muted);
  margin: 0 0 24px;
  line-height: 1.5;
}

.pc-detail-thumb {
  aspect-ratio: 3 / 2;          /* sync with lesson cards (1536×1024 thumbnails) */
  background: linear-gradient(135deg, #1a1a28 0%, #2a1a10 100%);
  border-radius: var(--pc-radius);
  border: 1px solid var(--pc-border);
  overflow: hidden;
  position: relative;
}

.pc-detail-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

.pc-purchase-card {
  background: var(--pc-bg-1);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 24px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pc-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pc-price {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--pc-gold);
  font-family: 'Playfair Display', Georgia, serif;
}

.pc-price-currency { color: var(--pc-text-muted); font-size: 1rem; }

/* ============= CHAPTERS LIST ============= */

.pc-content-grid {
  max-width: 1320px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  padding: 0 24px;
}

@media (max-width: 900px) { .pc-content-grid { grid-template-columns: 1fr; } }

.pc-content-card {
  background: var(--pc-bg-1);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.pc-content-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--pc-text);
}

.pc-chapter-list { display: flex; flex-direction: column; gap: 8px; }

.pc-chapter {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--pc-bg-input);
  border: 1px solid var(--pc-border-soft);
  border-radius: 8px;
  transition: all 0.15s;
}

.pc-chapter.unlocked { cursor: pointer; }
.pc-chapter.unlocked:hover {
  border-color: var(--pc-gold);
  background: var(--pc-bg-2);
}

.pc-chapter.locked {
  opacity: 0.65;
}

.pc-chapter-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pc-bg-2);
  border: 1px solid var(--pc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--pc-gold);
}

.pc-chapter.unlocked .pc-chapter-num {
  background: var(--pc-gold-glow);
  border-color: var(--pc-border-gold);
}

.pc-chapter.locked .pc-chapter-num {
  color: var(--pc-locked);
  background: var(--pc-locked-bg);
  border-color: var(--pc-border-soft);
}

.pc-chapter-body { flex: 1; min-width: 0; }
.pc-chapter-title {
  color: var(--pc-text);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 3px;
}
.pc-chapter-meta {
  font-size: 12px;
  color: var(--pc-text-muted);
  display: flex;
  gap: 10px;
  align-items: center;
}

.pc-chapter-icon {
  font-size: 18px;
  color: var(--pc-text-muted);
  flex-shrink: 0;
}

.pc-chapter.unlocked .pc-chapter-icon { color: var(--pc-gold); }

/* ============= AUTHOR / SIDEBAR ============= */

.pc-sidebar { display: flex; flex-direction: column; gap: 20px; }

.pc-author-card {
  background: var(--pc-bg-1);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 22px;
}

.pc-author-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pc-bg-2);
  border: 2px solid var(--pc-border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--pc-text-muted);
  margin-bottom: 12px;
  overflow: hidden;
}

.pc-author-photo img { width: 100%; height: 100%; object-fit: cover; }

.pc-author-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pc-text);
  margin-bottom: 4px;
}

.pc-author-title {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  background: var(--pc-gold-glow);
  color: var(--pc-gold);
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.pc-author-bio {
  font-size: 13px;
  color: var(--pc-text-muted);
  line-height: 1.55;
}

.pc-features-card {
  background: var(--pc-bg-1);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  padding: 22px;
}

.pc-features-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--pc-text-muted);
  margin: 0 0 14px;
}

.pc-feature-list { display: flex; flex-direction: column; gap: 10px; }

.pc-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--pc-text);
}

.pc-feature-icon { color: var(--pc-gold); font-size: 14px; }

/* ============= PGN ATTACHMENT ROWS ============= */

.pc-pgn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--pc-bg-input);
  border: 1px solid var(--pc-border-soft);
  border-radius: 8px;
  margin-bottom: 6px;
}

.pc-pgn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--pc-bg-2);
  border: 1px solid var(--pc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--pc-gold);
  flex-shrink: 0;
}

.pc-pgn-body { flex: 1; min-width: 0; }
.pc-pgn-title { color: var(--pc-text); font-size: 13px; font-weight: 500; }
.pc-pgn-meta { font-size: 11px; color: var(--pc-text-muted); }

/* ============= TOAST ============= */

.pc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--pc-bg-1);
  border: 1px solid var(--pc-border);
  border-left: 3px solid var(--pc-gold);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--pc-text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 2000;
  max-width: 420px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.pc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pc-toast.t-error    { border-left-color: #ef4444; }
.pc-toast.t-success  { border-left-color: var(--pc-success); }

/* ============= VIDEO MODAL ============= */

.pc-video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.pc-video-overlay.is-open { display: flex; }

.pc-video-frame {
  width: 100%;
  max-width: 1100px;
  background: #000;
  border-radius: var(--pc-radius);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  position: relative;
}

.pc-video-frame video {
  width: 100%;
  display: block;
  background: #000;
  aspect-ratio: 16 / 9;
}

.pc-video-header {
  padding: 12px 18px;
  background: var(--pc-bg-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--pc-border);
}

.pc-video-header-title {
  font-weight: 600;
  color: var(--pc-text);
  font-size: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-video-close {
  background: transparent;
  border: 1px solid var(--pc-border);
  color: var(--pc-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-video-close:hover {
  border-color: var(--pc-gold);
  color: var(--pc-gold);
}

/* ============= UTILITIES ============= */

.pc-text-gold { color: var(--pc-gold); }
.pc-text-muted { color: var(--pc-text-muted); }
.pc-mb-2 { margin-bottom: 12px; }
.pc-mt-3 { margin-top: 16px; }

/* Hide auth-injected dashboard buttons (matches admin-pages pattern) */
.nav-container > .dashboard-button,
.nav-container > a.dashboard-button,
.header .nav-right,
.nav-container > .nav-right { display: none !important; }


/* PHASE 3.7 — CART BUTTON ON CARDS */
/* Catalog v3 wraps each card in a relative-positioned div so the cart
   button can sit absolutely-positioned outside the card's <a> link
   (HTML doesn't allow <button> inside <a>). */

.pc-card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.pc-card-cart-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 140, 0, 0.4);
  color: var(--pc-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 6px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.15s ease;
}

.pc-card-cart-btn:hover:not(:disabled) {
  background: var(--pc-gold);
  color: #0a0a0f;
  border-color: var(--pc-gold);
  transform: translateY(-1px);
}

.pc-card-cart-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.pc-card-cart-btn.is-added {
  background: var(--pc-success);
  color: #0a0a0f;
  border-color: var(--pc-success);
}

@media (max-width: 480px) {
  .pc-card-cart-btn {
    font-size: 11px;
    padding: 5px 8px;
  }
}
/* END PHASE 3.7 */

/* ============================================================
   v10 → v11 — Batch 3i-hotfix-v3
   v10 used position:absolute, which docked to the wrong ancestor
   (since .pc-card-wrap had no CSS → button anchored to nearest
   relative ancestor → ended up at random spots). Plus short cards
   left the button floating with empty space above.

   v11: button is a FULL-WIDTH BLOCK at the bottom of the card,
   in normal flow. Acts like a CTA bar attached to the card.
   Pattern same as e-commerce listings (Amazon-style add-to-cart).
   ============================================================ */

/* Make wrapper a flex column so card + button stack vertically */
.pc-card-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pc-card-wrap > .pc-card {
  flex: 1;                    /* card fills available height */
}

/* RESET v10 absolute + apply new bar layout */
.pc-card-cart-btn {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: auto;

  /* Full-width CTA bar attached to card bottom */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: -1px 0 0 0;         /* overlap card border so they merge cleanly */
  padding: 12px 16px;

  /* Round only the bottom — joins the card visually */
  border-radius: 0 0 var(--pc-radius, 12px) var(--pc-radius, 12px);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(0, 0, 0, 0.25);

  /* Red gradient */
  background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.pc-card-cart-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ef5a4a 0%, #cf432f 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(231, 76, 60, 0.40),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pc-card-cart-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pc-card-cart-btn.is-added {
  background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
  color: #fff;
}

.pc-card-cart-btn-icon {
  font-size: 14px;
  line-height: 1;
}

/* Reset v10's padding-bottom: 56px hack — no longer needed since button
   is now outside the card body in normal flow */
.pc-card-body {
  padding-bottom: 20px;
}

@media (max-width: 480px) {
  .pc-card-cart-btn {
    font-size: 13px;
    padding: 11px 14px;
  }
}

/* ===================================================================
   v15 — MOBILE LAYOUT FIX  [2026-05-18]

   Problem: On mobile, .pc-section (24px) + nested .pc-container (24px)
   were stacking → 48px horizontal padding per side, eating ~25% of a
   380px viewport. Combined with any 1–2px horizontal overflow from
   floating widgets (cart badge, drawer overlay, box-shadows), the
   browser would expose a horizontal scroll and the page felt visually
   pushed to the right.

   Fix:
   1. overflow-x: hidden on html/body kills any accidental h-scroll.
   2. On ≤600px, .pc-container becomes a passthrough (padding:0),
      so .pc-section alone controls horizontal indent (14px).
   3. Force single-column grid + tighter gap so cards breathe properly.
   4. Tighter hero/filters padding to match.
   =================================================================== */

/* Hard guard against any horizontal scroll caused by fixed/sticky widgets */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

@media (max-width: 600px) {
  /* Hero — generous vertical, tighter horizontal */
  .pc-hero {
    padding: 44px 16px 40px;
  }

  /* Don't double up padding on mobile — container becomes passthrough.
     .pc-section alone now owns the horizontal indent. */
  .pc-section {
    padding: 0 14px 48px;
  }
  .pc-container {
    padding: 0;
  }

  /* Card grid — one column, tighter gap */
  .pc-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  /* Filters bar — keep readable, less padding */
  .pc-filters {
    padding: 12px;
    margin-top: -24px;
    gap: 8px;
  }

  /* Section header — tighter margin */
  .pc-section-header {
    margin-bottom: 16px;
  }
}

/* Very small phones (iPhone SE, narrow Androids) — squeeze a bit more */
@media (max-width: 380px) {
  .pc-section { padding: 0 10px 40px; }
  .pc-hero    { padding: 36px 12px 32px; }
}
/* END v15 — MOBILE LAYOUT FIX */
