@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #1f2937 100%);
  --glass-bg: rgba(17, 24, 39, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --shadow-neon: 0 0 25px rgba(6, 182, 212, 0.15);
  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: var(--font-body);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background decorative blobs */
body::before, body::after {
  content: "";
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}
body::before {
  top: -50px;
  left: -50px;
  background: var(--accent-cyan);
}
body::after {
  bottom: -50px;
  right: -50px;
  background: var(--accent-rose);
}

/* Header styling */
.glass-header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.glass-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(to right, #22d3ee, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

/* Grid Layout */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.trust-strip {
  max-width: 1100px;
  margin: 0 auto 1rem auto;
  padding: 1rem 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.trust-strip.compact {
  max-width: 840px;
}

.trust-strip strong {
  display: block;
  color: var(--text-primary);
  font-weight: 800;
}

.trust-strip span {
  color: var(--text-secondary);
}

.trust-strip a {
  color: var(--accent-cyan);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.catalog-search {
  display: flex;
  gap: 0.75rem;
  margin: 1.25rem auto 0 auto;
  max-width: 860px;
}

.catalog-search input,
.catalog-search select {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font: inherit;
  padding: 0.85rem 1rem;
}

.catalog-search select {
  min-width: 140px;
  max-width: 260px;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.6);
}

.catalog-search button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #0891b2 100%);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 800;
  padding: 0.85rem 1.2rem;
}

@media (max-width: 720px) {
  .trust-strip {
    align-items: flex-start;
    flex-direction: column;
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .catalog-search {
    flex-direction: column;
  }

  .catalog-search select {
    max-width: none;
  }
}

/* === Catalog page: totals + agent filters polish === */
#total-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

#total-info .count {
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 0.35rem;
}

#total-info .meta {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

/* agent-filters-bar styles removed - the prominent agent filter bar was deemed non-essential in UI and had contrast issues; the max_shipping_first_usd param is still supported via direct URL/API for agents */

.section-heading {
  max-width: 1100px;
  margin: 2.5rem auto 0 auto;
  padding: 0 2rem;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin: 0 0 0.35rem 0;
}

.section-heading p {
  color: var(--text-secondary);
  margin: 0;
}

.agent-intents {
  max-width: 1100px;
  margin: 0 auto;
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1.25rem 2rem 0 2rem;
}

.intent-card {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  display: block;
  padding: 1rem;
  text-decoration: none;
}

.intent-card strong {
  display: block;
  font-weight: 800;
}

.intent-card span {
  color: var(--text-secondary);
  display: block;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.sales-proof-section {
  max-width: 1100px;
  margin: 0 auto;
}

.sales-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  padding: 1.25rem 2rem 0 2rem;
}

.sales-signal-card {
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.07);
  color: var(--text-primary);
  display: block;
  min-height: 8rem;
  padding: 1rem;
  text-decoration: none;
}

.sales-signal-card strong {
  color: var(--accent-green);
  display: block;
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.sales-signal-card span {
  color: var(--text-secondary);
  display: -webkit-box;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.agent-note {
  color: var(--text-secondary);
  margin: 1rem auto 0 auto;
  max-width: 1040px;
  padding: 0 2rem;
}

.agent-note a {
  color: var(--accent-cyan);
  font-weight: 700;
  text-decoration: none;
}

/* Product card design */
.glass-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  overflow: hidden;
}

.product-card {
  gap: 1rem;
  padding: 1rem;
}

.product-image-link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--glass-border);
}

.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.product-image.mug-image-left {
  object-fit: cover;
  object-position: left center;
}

.product-image.mug-image-right {
  object-fit: cover;
  object-position: right center;
}

.agent-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.agent-badges span {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.08);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  text-transform: uppercase;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--glass-highlight) 0%, transparent 100%);
  pointer-events: none;
  border-radius: inherit;
}

.glass-card:hover {
  transform: translateY(-8px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: var(--shadow-card), var(--shadow-neon);
}

/* Typography & Links inside cards */
.agent-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.agent-summary {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: -0.35rem 0 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-emerald);
  margin: 0 0 1.5rem 0;
}

.agent-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 0 1rem 0;
}

.agent-fields div {
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.55rem;
  min-width: 0;
}

.agent-fields dt {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agent-fields dd {
  color: var(--text-primary);
  font-size: 0.82rem;
  margin: 0.15rem 0 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* High Contrast Readable Actions */
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.25rem;
}

.detail-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: #38bdf8; /* High visibility light sky-blue */
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  position: relative;
}

.detail-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-cyan);
  transition: width 0.2s ease;
}

.detail-link:hover {
  color: #06b6d4;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.detail-link:hover::after {
  width: 100%;
}

.buy-btn {
  background: linear-gradient(135deg, var(--accent-rose) 0%, #e11d48 100%);
  border: none;
  color: #fff;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
  filter: brightness(1.1);
}

.buy-btn-disabled,
.buy-btn:disabled {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.75;
  filter: none;
  transform: none;
}

.catalog-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto 3rem auto;
  padding: 0 2rem;
}

.pager-btn {
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 700;
  padding: 0.7rem 1.1rem;
}

.pager-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pager-status {
  color: var(--text-secondary);
  font-weight: 700;
}

.buy-btn:active {
  transform: translateY(0);
}

/* Modal styling */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  background: #111827;
  border: 1px solid var(--glass-border);
  padding: 2.5rem;
  border-radius: 24px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.show .modal-content {
  transform: translateY(0);
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.close-button:hover {
  color: var(--text-primary);
}

#checkout-link.hidden {
  display: none;
}

#checkout-link {
  display: inline-block;
  margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--accent-emerald) 0%, #059669 100%);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.3s ease;
  width: 80%;
}

#checkout-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  filter: brightness(1.1);
}

/* Footer Styling */
.glass-footer {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 1400px;
  margin: 4rem auto 2rem auto;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.glass-footer p {
  margin: 0;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================
   TEMPORARY FIX (Priority A) - STRONGER VERSION
   Force-hide the old broken size/shipping blocks
   that still show $6.99 flat for both 11oz and 15oz.
   Using very broad + high specificity rules because
   this UI is likely injected by older JS.
   ============================================ */
.shipping-info-box,
.shipping-info-item,
.variant-shipping,
.size-shipping-info,
.shipping-selector,
div[class*="shipping-info"],
div[class*="variant-shipping"],
[class*="shipping-info-item"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Extra aggressive targeting for the specific structure the user sees */
div:has(> strong:contains("11oz size")),
div:has(> strong:contains("15oz size")) {
    display: none !important;
}

/* Mug mockups side focus & fallback crop styling */
.product-image.mug-image-left,
.product-image.mug-left {
  object-fit: cover;
  object-position: left center;
  transform: scale(1.05);
}

.product-image.mug-image-right,
.product-image.mug-right {
  object-fit: cover;
  object-position: right center;
  transform: scale(1.05);
}

.product-image.mug-fallback-crop {
  object-fit: contain;
  background-color: transparent;
}

/* ============================================================
   Clean data-driven Variant Selector styles (for product_detail)
   Single source of truth: server provides price + shipping per variant
   ============================================================ */

.size-pill {
  background: #1f2937;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 52px;
  text-align: center;
}

.size-pill:hover {
  border-color: #60a5fa;
  background: #273449;
}

.size-pill.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.color-swatch-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.color-swatch-wrapper.active,
.color-swatch-wrapper:hover {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #1f2937;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.color-name {
  font-size: 0.65rem;
  color: #9ca3af;
  max-width: 52px;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shipping info box populated by JS from server data */
#variant-shipping-box {
  font-family: var(--font-body);
  border-left: 3px solid #60a5fa;
}

#current-total-box {
  border-left: 3px solid #34d399;
  font-weight: 600;
}

/* ============================================================
   Phase 2: Variants & Landed Cost Table
   ============================================================ */
.agent-variants-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.75rem;
}

.agent-variants-table th {
  padding: 0.75rem 0.5rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 2px solid #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.agent-variant-row {
  border-bottom: 1px solid #1e293b;
  font-size: 0.75rem;
  transition: background-color 0.2s ease;
}

.agent-variant-row:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.agent-variant-row td {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid #1e293b;
}

.agent-variant-row:last-child td {
  border-bottom: none;
}

/* Specific styling for direct quote links inside tables */
.table-quote-link {
  display: inline-block;
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.table-quote-link:hover {
  background: rgba(96, 165, 250, 0.2);
  color: #fff;
  border-color: #60a5fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.15);
}

/* Shipping confidence badges */
.confidence-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.confidence-badge.verified {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.confidence-badge.in-progress {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Responsive Table Wrapper for small screens */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .agent-variants-table th, 
  .agent-variant-row td {
    padding: 0.5rem 0.35rem;
    font-size: 0.7rem;
  }
}

