/* ── CHECKOUT BANNER ── */
.checkout-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  padding: 0 6%;
}
.checkout-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0 0 12px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
}
.checkout-banner.banner-success .checkout-banner-inner {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-top: none;
}
.checkout-banner.banner-cancel .checkout-banner-inner {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-top: none;
}

/* ── MARKETPLACE HERO ── */
.mp-hero {
  padding: 120px 6% 60px;
  background: linear-gradient(160deg, #1A1D21 0%, #2C3238 55%, #374151 100%);
  position: relative;
  overflow: hidden;
}
.mp-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 60% at 80% 50%, rgba(26,86,219,0.1) 0%, transparent 70%);
}
.mp-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative; z-index: 1;
}
.mp-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0.6rem 0 1rem;
}
.mp-sub {
  font-size: 1.05rem;
  line-height: 1.72;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
  margin-bottom: 2.2rem;
}

/* Filter pills */
.mp-filters {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
}
.mp-filter {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 0.45rem 1.1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.18s;
}
.mp-filter:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.mp-filter.active {
  background: #1A56DB;
  border-color: #1A56DB;
  color: #fff;
}

/* ── BODY ── */
.mp-body {
  background: #F4F5F7;
  padding: 60px 6% 80px;
  min-height: 60vh;
}

/* ── PRODUCT GRID ── */
.mp-grid {
  max-width: 1200px;
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.mp-card {
  background: #FFFFFF;
  border: 1px solid #E2E6EA;
  border-radius: 14px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.2s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}
.mp-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #374151, #6B7280);
  opacity: 0;
  transition: opacity 0.25s;
}
.mp-card:hover {
  box-shadow: 0 8px 32px rgba(10,22,40,0.10);
  transform: translateY(-3px);
  border-color: #9CA3AF;
}
.mp-card:hover::after { opacity: 1; }

/* Card header */
.mp-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.mp-icon {
  width: 44px; height: 44px;
  background: #ECEEF1;
  border: 1px solid #E2E6EA;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.mp-icon [data-lucide] {
  width: 20px; height: 20px;
  stroke: #374151;
  stroke-width: 1.75;
}

/* Category badges */
.mp-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
}
.badge-lwc         { background: #EBF2FF; color: #1A56DB; }
.badge-module      { background: #FFF3E0; color: #C76B00; }
.badge-integration { background: #EDE7F6; color: #5C35B5; }
.badge-automation  { background: #FFF3E0; color: #C76B00; }
.badge-ux          { background: #EBF2FF; color: #1A56DB; }

/* Card content */
.mp-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1A1D21;
  margin-bottom: 0.5rem;
}
.mp-card > p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: #6B7280;
  margin-bottom: 1.2rem;
}

/* Feature list */
.mp-features {
  list-style: none;
  display: flex; flex-direction: column; gap: 0.45rem;
  margin-bottom: 1.6rem;
  flex: 1;
}
.mp-features li {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.83rem;
  color: #374151;
}
.mp-features [data-lucide] {
  width: 14px; height: 14px;
  stroke: #1A56DB;
  stroke-width: 2.5;
  flex-shrink: 0;
}

/* Card footer */
.mp-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1.2rem;
  border-top: 1px solid #E2E6EA;
  gap: 0.75rem;
}
.mp-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1A1D21;
  line-height: 1;
}
.mp-price-note {
  font-size: 0.75rem;
  font-weight: 400;
  color: #6B7280;
  display: block;
  margin-top: 0.2rem;
}
.mp-buy-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: #1A1D21;
  color: #FFFFFF;
  border: none;
  border-radius: 7px;
  padding: 0.6rem 1.1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}
.mp-buy-btn:hover { background: #374151; transform: translateY(-1px); }
.mp-buy-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.mp-buy-btn [data-lucide] {
  width: 14px; height: 14px;
  stroke: #fff;
  stroke-width: 2;
}

/* Hidden cards (filter) */
.mp-card.hidden {
  display: none;
}

/* ── ENTERPRISE CTA ── */
.mp-enterprise {
  max-width: 1200px;
  margin: 0 auto;
}
.mp-enterprise-inner {
  background: linear-gradient(135deg, #1A1D21 0%, #374151 100%);
  border-radius: 16px;
  padding: 2.5rem 3rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem;
}
.mp-enterprise-inner h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: #FFFFFF;
  margin-bottom: 0.4rem;
}
.mp-enterprise-inner p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.6);
  max-width: 500px;
}
.mp-enterprise-inner .btn-primary {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── STRIPE LOADING OVERLAY ── */
.stripe-loading {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(26,29,33,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.stripe-loading.visible { opacity: 1; pointer-events: all; }
.stripe-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #1A56DB;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
  .mp-grid { grid-template-columns: repeat(2, 1fr); }
  .mp-enterprise-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 640px) {
  .mp-hero { padding: 100px 4% 50px; }
  .mp-body { padding: 40px 4% 60px; }
  .mp-grid { grid-template-columns: 1fr; }
  .mp-enterprise-inner { padding: 2rem; }
}

/* ── CARD ACTIONS (Details + Buy side by side) ── */
.mp-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1.2rem;
  border-top: 1px solid #E2E6EA;
  gap: 0.75rem;
}
.mp-card-actions { display: flex; gap: 0.5rem; align-items: center; }
.mp-details-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: transparent;
  color: #374151;
  border: 1px solid #E2E6EA;
  border-radius: 7px;
  padding: 0.6rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.mp-details-btn:hover { background: #ECEEF1; border-color: #9CA3AF; }
.mp-details-btn [data-lucide] { width: 14px; height: 14px; stroke: #374151; stroke-width: 2; }

/* ── DRAWER ── */
body.drawer-open { overflow: hidden; }

.product-drawer {
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none;
}
.product-drawer.open { pointer-events: all; }

.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(26,29,33,0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.product-drawer.open .drawer-backdrop { opacity: 1; }

.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(680px, 100vw);
  background: #FFFFFF;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -8px 0 40px rgba(10,22,40,0.15);
}
.product-drawer.open .drawer-panel { transform: translateX(0); }

/* Drawer header */
.drawer-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid #E2E6EA;
  flex-shrink: 0;
}
.drawer-header-left { flex: 1; min-width: 0; }
.drawer-header-left .mp-badge { margin-bottom: 0.6rem; display: inline-block; }
.drawer-header-left h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: #1A1D21;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.drawer-header-left p {
  font-size: 0.92rem;
  color: #6B7280;
  line-height: 1.5;
}
.drawer-close {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: #F4F5F7;
  border: 1px solid #E2E6EA;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.18s;
  margin-top: 2px;
}
.drawer-close:hover { background: #ECEEF1; }
.drawer-close [data-lucide] { width: 16px; height: 16px; stroke: #374151; stroke-width: 2; }

/* Drawer scrollable body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 2rem 2rem;
}
.drawer-section { padding: 1.8rem 0; border-bottom: 1px solid #F4F5F7; }
.drawer-section:last-child { border-bottom: none; }
.drawer-section-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #374151;
  margin-bottom: 1.2rem;
}
.drawer-section-title [data-lucide] { width: 15px; height: 15px; stroke: #1A56DB; stroke-width: 2; }
.drawer-desc { font-size: 0.95rem; line-height: 1.75; color: #4B5563; }

/* Gallery */
.drawer-gallery { margin-bottom: 0.75rem; }
.gallery-main {
  border-radius: 10px;
  overflow: hidden;
  background: #F4F5F7;
  border: 1px solid #E2E6EA;
  position: relative;
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
}
.gallery-main img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-main.gallery-placeholder::before {
  content: 'Preview coming soon';
  font-size: 0.85rem;
  color: #9CA3AF;
}
.gallery-main.gallery-placeholder img { display: none; }
.gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(26,29,33,0.65);
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  backdrop-filter: blur(4px);
}
.drawer-gallery-thumbs {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  margin-top: 0.75rem;
}
.gallery-thumb {
  width: 72px; height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #F4F5F7;
  transition: border-color 0.18s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active { border-color: #1A56DB; }
.gallery-thumb:hover { border-color: #9CA3AF; }

/* Steps */
.drawer-steps { display: flex; flex-direction: column; gap: 0; }
.drawer-step {
  display: flex; gap: 1.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid #F4F5F7;
}
.drawer-step:last-child { border-bottom: none; }
.drawer-step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #ECEEF1;
  border: 2px solid #374151;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1A1D21;
}
.drawer-step h4 { font-size: 0.9rem; font-weight: 600; color: #1A1D21; margin-bottom: 0.25rem; }
.drawer-step p { font-size: 0.85rem; line-height: 1.65; color: #6B7280; }

/* Requirements */
.drawer-requirements { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.drawer-requirements li {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.88rem; color: #374151;
}
.drawer-requirements [data-lucide] { width: 15px; height: 15px; stroke: #1A56DB; stroke-width: 2.5; flex-shrink: 0; }

/* FAQ */
.drawer-faq { display: flex; flex-direction: column; gap: 0; }
.faq-item { border-bottom: 1px solid #F4F5F7; }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0;
  background: none; border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1A1D21;
  cursor: pointer;
  text-align: left;
}
.faq-q [data-lucide] { width: 16px; height: 16px; stroke: #6B7280; transition: transform 0.2s; flex-shrink: 0; }
.faq-item.open .faq-q [data-lucide] { transform: rotate(180deg); }
.faq-a { display: none; padding-bottom: 1rem; }
.faq-item.open .faq-a { display: block; }
.faq-a p { font-size: 0.875rem; line-height: 1.7; color: #6B7280; }

/* Drawer footer */
.drawer-footer {
  flex-shrink: 0;
  padding: 1.4rem 2rem;
  border-top: 1px solid #E2E6EA;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  background: #FAFAFA;
}
.drawer-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1A1D21;
  line-height: 1;
}
.drawer-price-note {
  font-size: 0.78rem;
  color: #6B7280;
  margin-top: 0.2rem;
}
.drawer-buy { padding: 0.75rem 1.6rem; font-size: 0.95rem; }

/* ── CHECKOUT DRAWER ── */
.checkout-drawer {
  position: fixed; inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.checkout-drawer.open {
  pointer-events: auto;
  opacity: 1;
}
.checkout-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}
.checkout-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -8px 0 30px rgba(0,0,0,0.08);
}
.checkout-drawer.open .checkout-panel {
  transform: translateX(0);
}
.checkout-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 2rem 1.2rem;
  border-bottom: 1px solid #E2E6EA;
}
.checkout-panel-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1A1D21;
  margin: 0;
}
.checkout-panel-header p {
  font-size: 0.85rem;
  color: #6B7280;
  margin-top: 0.25rem;
}
.checkout-notice {
  display: flex;
  gap: 0.75rem;
  padding: 1.2rem 2rem;
  background: #F0F7FF;
  border-bottom: 1px solid #DBEAFE;
}
.checkout-notice-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.checkout-notice-icon [data-lucide] {
  width: 18px;
  height: 18px;
  stroke: #1A56DB;
  stroke-width: 2;
}
.checkout-notice p {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #374151;
  margin: 0;
}
.checkout-notice strong {
  color: #1A1D21;
}
#checkout-mount {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.checkout-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.checkout-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  padding: 2rem;
  color: #6B7280;
  font-size: 0.9rem;
  gap: 0.5rem;
}
.checkout-error a {
  color: #1A56DB;
}
body.checkout-open { overflow: hidden; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .drawer-panel { width: 100vw; }
  .drawer-header { padding: 1.5rem 1.2rem 1.2rem; }
  .drawer-body { padding: 0 1.2rem 1.5rem; }
  .drawer-footer { padding: 1.2rem; }
  .checkout-panel { width: 100vw; }
  .checkout-panel-header { padding: 1.5rem 1.2rem 1rem; }
  .checkout-notice { padding: 1rem 1.2rem; }
}
