/* ==========================================================================
   Starbong.in — B2B Wholesale Product Detail Stylesheet
   Premium 2026 Warm Minimalist Design Language
   Typography: Inter | Background: #fafaf9 | Primary: #0a0a0a | Accent: #e87b35
   ========================================================================== */

:root {
  --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-page: #fafaf9;
  --bg-card: #ffffff;
  --bg-card-subtle: #f5f5f4;
  --text-main: #0a0a0a;
  --text-body: #3f3f46;
  --text-muted: #71717a;
  --text-light: #a1a1aa;
  
  --primary: #0a0a0a;
  --primary-hover: #262626;
  --primary-active: #404040;
  
  --accent: #e87b35;
  --accent-hover: #d26521;
  --accent-light: #fff7ed;
  --accent-subtle: #ffedd5;
  --accent-glow: rgba(232, 123, 53, 0.22);
  
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  
  --border-warm: rgba(0, 0, 0, 0.05);
  --border-subtle: rgba(0, 0, 0, 0.035);
  --border-dashed: rgba(232, 123, 53, 0.35);
  
  --radius-card: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 9999px;
  
  --shadow-warm-xs: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-warm-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-warm-card: 0 4px 24px -2px rgba(0, 0, 0, 0.04), 0 2px 8px -1px rgba(0, 0, 0, 0.02);
  --shadow-warm-hero: 0 12px 36px -4px rgba(0, 0, 0, 0.05), 0 4px 14px -2px rgba(0, 0, 0, 0.025);
  --shadow-warm-glow: 0 10px 32px -4px rgba(232, 123, 53, 0.22), 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* Global Reset & Page Canvas */
body {
  font-family: var(--font-inter);
  background-color: var(--bg-page);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Top Announcement Bar — Warm subtle gradient */
.announcement-bar {
  background: linear-gradient(90deg, #18181b 0%, #27272a 50%, #1c1917 100%);
  color: #f5f5f4;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-align: center;
  padding: 8px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.announcement-bar .sparkle,
.announcement-bar span:first-child {
  color: #e87b35;
  font-size: 13px;
}
.announcement-bar .sep {
  opacity: 0.4;
  color: #d6d3d1;
}

/* Site Header */
.site-header {
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-warm);
}
.header-brand-text {
  font-family: var(--font-inter);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 20px;
  color: #0a0a0a;
  text-transform: lowercase;
}

/* Main Detail Container */
.detail-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 96px;
  min-height: calc(100vh - 280px);
}

/* Breadcrumb Navigation */
.detail-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 500;
}
.detail-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.detail-breadcrumb a:hover {
  color: var(--text-main);
}
.detail-breadcrumb span {
  color: #d4d4d8;
}
.detail-breadcrumb #breadcrumb-name {
  color: var(--text-main);
  font-weight: 600;
}

/* 2-Column Product Detail Layout */
.detail-wrap,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 48px;
  align-items: start;
}
.detail-wrap > .detail-layout,
.detail-wrap > #product-detail {
  display: contents;
}

/* ==========================================================================
   Product Image Hero Gallery & Thumbnails
   ========================================================================== */

.detail-gallery,
.detail-image-wrap {
  min-height: 520px;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-warm) !important;
  border-radius: var(--radius-card) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-shadow: var(--shadow-warm-hero);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-gallery:hover,
.detail-image-wrap:hover {
  box-shadow: 0 16px 44px -4px rgba(0, 0, 0, 0.07), 0 6px 18px -2px rgba(0, 0, 0, 0.03);
}

.gallery-main-img,
.detail-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-gallery:hover .gallery-main-img,
.detail-image-wrap:hover .detail-image {
  transform: scale(1.035);
}

/* Thumbnails Strip */
.gallery-thumb-strip,
.detail-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 14px 4px 6px;
  margin-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
  -webkit-overflow-scrolling: touch;
}
.gallery-thumb-strip::-webkit-scrollbar,
.detail-thumbnails::-webkit-scrollbar {
  height: 5px;
}
.gallery-thumb-strip::-webkit-scrollbar-thumb,
.detail-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
}

.gallery-thumb,
.detail-thumbnail {
  width: 84px;
  height: 84px;
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-shadow: var(--shadow-warm-xs);
}
.gallery-thumb:hover,
.detail-thumbnail:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm-sm);
}
.gallery-thumb.active,
.detail-thumbnail.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 123, 53, 0.25), 0 4px 12px rgba(232, 123, 53, 0.15);
}
.gallery-thumb img,
.detail-thumbnail img {
  width: 100%;
  height: 50px;
  object-fit: contain;
}
.gallery-thumb span,
.detail-thumbnail span {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 68px;
  margin-top: 3px;
}

/* ==========================================================================
   Product Info Section
   ========================================================================== */

.detail-info,
.detail-copy {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 38px 34px;
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-warm-card);
}

/* Category Badge */
.detail-category-badge,
.detail-copy > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent) !important;
  letter-spacing: 0.8px;
  background: var(--accent-light);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(232, 123, 53, 0.16);
  margin-bottom: 8px;
}

/* Product Title */
.detail-name,
.detail-copy h1 {
  font-family: var(--font-inter) !important;
  font-size: clamp(24px, 2.6vw, 34px) !important;
  font-weight: 800 !important;
  line-height: 1.22 !important;
  margin: 12px 0 16px !important;
  letter-spacing: -0.035em !important;
  color: var(--text-main) !important;
}

/* Pack Info Badge */
.detail-pack-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-body);
  background: var(--bg-card-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
}

/* Wholesale Price Display */
.detail-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  letter-spacing: -0.02em;
}
.detail-price small {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Gated Price Blurred Overlay */
.blurred-price-container.detail-blur {
  background: var(--bg-page);
  border: 1px dashed var(--border-dashed);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}
.blurred-price-container.detail-blur:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}
.blurred-price-text {
  filter: blur(5px);
  user-select: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
}
.price-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
}

/* Description Text */
.detail-desc,
.detail-description {
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-body);
  border-top: 1px solid var(--border-warm);
  padding-top: 20px;
  margin-top: 18px;
  margin-bottom: 24px;
}

/* Specifications Key-Value Modern Grid */
.detail-specs {
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 26px;
}
.detail-specs h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-specs dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}
.detail-specs dl div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-warm-xs);
}
.detail-specs dt {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.detail-specs dd {
  font-weight: 700;
  color: var(--text-main);
  font-size: 13.5px;
  text-align: left;
}

/* Quantity Selection Box & Quick Pills */
.detail-copy > div[style*="background: #f8fafc"],
.detail-info .quantity-container {
  background: var(--bg-page) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  padding: 16px 18px !important;
}

.detail-quick-qty {
  border-radius: 8px !important;
  border-color: var(--border-warm) !important;
  transition: all 0.15s ease !important;
}
.detail-quick-qty:hover {
  background: var(--accent-light) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* CTA Primary & Outline Buttons */
.btn-primary {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}
.btn-primary:hover {
  background: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14) !important;
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 12px !important;
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}
.btn-outline:hover {
  background: var(--bg-card-subtle) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

/* Add Success Notification */
#add-success-msg {
  border-radius: var(--radius-sm) !important;
  background: var(--success-bg) !important;
  border: 1px solid var(--success-border) !important;
  color: #15803d !important;
}

/* Loading & Empty/Error States */
.detail-loading,
.detail-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 96px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-warm);
  box-shadow: var(--shadow-warm-card);
  color: var(--text-muted);
}
.detail-error h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.detail-error p {
  font-size: 15px;
  margin-bottom: 24px;
  color: var(--text-body);
}
.detail-error .btn-primary {
  display: inline-block;
  padding: 12px 24px !important;
  text-decoration: none;
}

/* ==========================================================================
   Mobile Sticky Action Bar
   Frosted Glass with Warm Accent Glow
   ========================================================================== */

.mobile-sticky-product-bar {
  display: none;
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom, 12px));
  left: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(232, 123, 53, 0.28);
  border-radius: 18px;
  box-shadow: var(--shadow-warm-glow);
  padding: 12px 18px;
  z-index: 50;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mobile-sticky-product-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 20px rgba(232, 123, 53, 0.08);
  pointer-events: none;
}

/* ==========================================================================
   Media Queries: max-width 768px & 640px
   ========================================================================== */

@media (max-width: 860px) {
  .detail-wrap,
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 768px) {
  /* Add body bottom padding to account for mobile dock + sticky bar */
  body {
    padding-bottom: calc(148px + env(safe-area-inset-bottom, 16px));
  }

  .detail-main {
    padding: 20px 16px 40px;
  }

  .detail-gallery,
  .detail-image-wrap {
    min-height: 360px;
    padding: 24px;
    border-radius: 18px !important;
  }

  .gallery-main-img,
  .detail-image {
    max-height: 320px;
  }

  .detail-info,
  .detail-copy {
    padding: 28px 20px;
    border-radius: 18px;
  }

  .mobile-sticky-product-bar {
    display: flex;
  }
}

@media (max-width: 640px) {
  .detail-gallery,
  .detail-image-wrap {
    min-height: 290px;
    padding: 18px;
    border-radius: 16px !important;
  }

  .gallery-main-img,
  .detail-image {
    max-height: 260px;
  }

  .gallery-thumb-strip,
  .detail-thumbnails {
    padding: 10px 2px 4px;
    gap: 8px;
  }

  .gallery-thumb,
  .detail-thumbnail {
    width: 72px;
    height: 72px;
    padding: 6px;
    border-radius: 10px;
  }
  .gallery-thumb img,
  .detail-thumbnail img {
    height: 42px;
  }

  .detail-name,
  .detail-copy h1 {
    font-size: 22px !important;
  }

  .detail-specs {
    padding: 18px 14px;
    border-radius: 14px;
  }
  .detail-specs dl {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mobile-sticky-product-bar {
    left: 10px;
    right: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    gap: 12px;
  }
}

/* ==========================================================================
   Unified shell + sticky action bar behaviour (appended polish layer)
   ========================================================================== */

/* Keep the detail page on the same dark glass header as the storefront */
.site-header {
  background: var(--glass-header-bg) !important;
  border-bottom: 1px solid var(--glass-header-border) !important;
}
.header-brand-text {
  color: #fafaf9 !important;
}

/* Leave room for the bottom dock and the sticky CTA */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(200px + env(safe-area-inset-bottom, 16px)) !important;
  }
}

/* Show the sticky CTA only after the inline "Add to Quote" button is out of view */
.mobile-sticky-product-bar {
  opacity: 0;
  transform: translateY(140%);
  pointer-events: none;
  transition: transform 0.28s var(--ease-smooth), opacity 0.2s var(--ease-smooth);
}
.mobile-sticky-product-bar.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Gated price label must wrap inside the detail box instead of clipping */
.detail-blur .price-lock-overlay {
  padding: 0 18px;
  text-align: center;
}
.detail-blur .lock-label {
  white-space: normal;
  line-height: 1.3;
}

/* Detail action row: keep the primary CTA flexible and let the secondary
   link size to its content instead of the global 100%-width mobile rule. */
.detail-copy .btn-outline,
.detail-info .btn-outline {
  width: auto !important;
  flex: 0 0 auto;
}
#add-to-quote-btn {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0;
}

/* Match the storefront wordmark scale on phones (this file loads after
   storefront.css, so the legacy 20px rule would otherwise win). */
@media (max-width: 640px) {
  .header-brand-text {
    font-size: 17px !important;
    letter-spacing: -0.035em !important;
  }
}
@media (max-width: 380px) {
  .header-brand-text {
    font-size: 15.5px !important;
  }
}

/* Gated price card: readable label on the white overlay */
.detail-blur .price-lock-overlay {
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  border-radius: 12px;
}
.detail-blur .lock-label {
  color: var(--accent) !important;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.detail-blur .lock-icon {
  font-size: 14px;
}

/* Sticky CTA: the global 100%-width mobile button rule must not stretch it
   across the bar (it would cover the live price label). */
#mob-sticky-add-btn {
  width: auto !important;
  flex: 0 0 auto;
}
.mobile-sticky-product-bar > div {
  min-width: 0;
}
.mobile-sticky-product-bar {
  background: rgba(255, 255, 255, 0.97);
}
