/* ==========================================================================
   PRODUCT CATALOG GRID & DUAL-HOVER CARDS
   ========================================================================== */

.catalog-section {
  margin-bottom: 40px;
}

.catalog-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
  margin-bottom: 18px;
}

.catalog-section .section-header > div:first-child {
  min-width: 0;
}

.catalog-section .section-header .text-section-title {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-section .section-header .phase-badge-pill,
#catalogCountBadge {
  flex-shrink: 0;
  white-space: nowrap;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.catalog-card {
  background: var(--bg-surface);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius-squircle, 22px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
}

.catalog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.09), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  border-color: rgba(37, 99, 235, 0.35);
}

/* Dual-View Hover Stage */
.card-stage-dual {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 45%, var(--bg-surface) 40%, var(--bg-surface-muted) 100%);
  border: 1px solid rgba(226, 232, 240, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.card-stage-dual svg {
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.12));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.catalog-card:hover .card-stage-dual svg {
  transform: scale(1.08) translateY(-3px);
}

.stage-view-default,
.stage-view-hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.stage-view-hover {
  opacity: 0;
  pointer-events: none;
  background: var(--bg-surface-sunken);
  transform: scale(0.95);
  padding: 12px;
  text-align: center;
}

.catalog-card:hover .stage-view-hover {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.catalog-card:hover .stage-view-default {
  opacity: 0;
}

.hover-detail-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent-teal-text);
  background: var(--accent-teal-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Color Swatches Interaction */
.card-color-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
}

.swatch-pill {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-subtle);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.swatch-pill:hover,
.swatch-pill.active {
  transform: scale(1.3);
  box-shadow: 0 0 0 2px var(--accent-crimson);
}

/* Installment Payment Badges (SnappPay, TorobPay, DigiPay) */
.card-installment-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card-snapppay-breakdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #0369a1;
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(3, 105, 161, 0.25);
  width: fit-content;
}

[data-theme="dark"] .card-snapppay-breakdown {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.3);
}

.card-installment-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.card-installment-pill.is-torobpay {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.card-installment-pill.is-digipay {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
}

[data-theme="dark"] .card-installment-pill.is-torobpay {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .card-installment-pill.is-digipay {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(59, 130, 246, 0.32);
}

/* ==========================================================================
   Product Card Bottom Action Bar (Frame & Buy CTA)
   ========================================================================== */
.catalog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-surface-muted, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  margin-top: 8px;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.catalog-card:hover .catalog-card-footer {
  background: var(--bg-surface, #ffffff);
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-price-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.card-strike-price {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted, #334155);
  text-decoration: line-through;
  line-height: 1.2;
}

.card-main-price {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-primary, #0f172a);
  line-height: 1.25;
  display: flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}

.card-currency-unit {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted, #334155);
}

.card-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  flex-shrink: 0;
}

.card-buy-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}

.card-buy-btn:active {
  transform: scale(0.95);
}

.card-buy-btn.is-out-of-stock {
  background: var(--bg-surface-sunken, #e2e8f0);
  color: var(--text-muted, #334155);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.card-buy-btn-icon {
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-buy-btn-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  display: block;
}

[data-theme="dark"] .catalog-card-footer {
  background: #18181b;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .catalog-card:hover .catalog-card-footer {
  background: #202024;
  border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .card-main-price {
  color: #f8fafc;
}

[data-theme="dark"] .card-buy-btn.is-out-of-stock {
  background: #27272a;
  color: #71717a;
}

.catalog-card .btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-radius: 9999px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  border: none;
  transition: all var(--transition-fast);
}

.catalog-card .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .catalog-card {
    padding: 12px;
    border-radius: var(--radius-lg);
  }
}

@media (hover: none) {
  .hover-detail-badge {
    display: none;
  }
}

/* ==========================================================================
   Dark Theme High-Contrast Adaptations (Model 2: Cyber OLED True Black)
   ========================================================================== */
[data-theme="dark"] .catalog-card {
  background: #09090b;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .catalog-card:hover {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.18), 0 10px 30px rgba(0, 0, 0, 0.8);
  transform: translateY(-4px);
}

[data-theme="dark"] .catalog-card .text-card-title a {
  color: #ffffff !important;
}

[data-theme="dark"] .catalog-card .text-price-primary {
  color: #ffffff !important;
}

[data-theme="dark"] .card-stage-dual {
  background: #0e0e11;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .stage-view-hover {
  background: #18181b;
}

[data-theme="dark"] .card-stage-dual .btn-icon,
[data-theme="dark"] .flash-card-img-box .btn-icon {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}
