/* BestPicks Frontend — Pinterest-inspiriert, Phase 2D */
:root {
  --bp-bg: #f5f3ef;
  --bp-card: #ffffff;
  --bp-text: #181818;
  --bp-muted: #5e6166;
  --bp-border: #e7e2db;
  --bp-primary: #ff2b45;
  --bp-primary-hover: #e51f3c;
  --bp-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  --bp-shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.12);
  --bp-p-x: 0px;
  --bp-p-y: 0px;
}

*, *::before, *::after { box-sizing: border-box; }

body.bp-front {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  background: var(--bp-bg);
  color: var(--bp-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.bp-front-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  border-bottom: 1px solid var(--bp-border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.bp-front-logo {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--bp-text);
  text-decoration: none;
}

.bp-front-logo:hover { color: var(--bp-primary); }

.bp-front-lang a {
  color: var(--bp-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.bp-front-lang a.is-active { color: var(--bp-text); }

.bp-sep { color: var(--bp-border); margin: 0 0.35rem; }

.bp-front-mini a {
  color: var(--bp-muted);
  text-decoration: none;
  font-size: 12px;
  margin-left: 0.65rem;
}

.bp-front-mini a:hover { color: var(--bp-primary); }

.bp-front-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}

/* Intro */
.bp-pin-intro {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 2.25rem;
}

.bp-pin-intro-h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.65rem;
  color: var(--bp-text);
}

.bp-pin-intro-sub {
  margin: 0;
  font-size: 0.98rem;
  color: var(--bp-muted);
  line-height: 1.5;
}

.bp-pin-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--bp-muted);
  background: var(--bp-card);
  border-radius: 16px;
  border: 1px solid var(--bp-border);
}

/* Pin stage + orbit */
.bp-pin-stage {
  position: relative;
  min-height: 480px;
  margin: 0 auto 3.5rem;
  transform: translate3d(var(--bp-p-x), var(--bp-p-y), 0);
  will-change: transform;
}

.bp-pin-hero-slot {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 3;
  padding: 0.5rem 0 1rem;
}

.bp-pin-orbit {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
}

.bp-pin-orbit-item {
  position: absolute;
  width: min(200px, 42vw);
  pointer-events: none;
}

.bp-pin-orbit-item .bp-pin-card {
  pointer-events: auto;
}

/* Orbit positions (desktop) */
.bp-pin-orbit-item--0 { top: 2%; left: 2%; }
.bp-pin-orbit-item--1 { top: 8%; right: 3%; }
.bp-pin-orbit-item--2 { top: 38%; left: 0%; }
.bp-pin-orbit-item--3 { top: 32%; right: 0%; }
.bp-pin-orbit-item--4 { bottom: 18%; left: 6%; }
.bp-pin-orbit-item--5 { bottom: 12%; right: 8%; }
.bp-pin-orbit-item--6 { top: 58%; left: 12%; }
.bp-pin-orbit-item--7 { top: 52%; right: 14%; }

/* Pin cards */
.bp-pin-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  -webkit-tap-highlight-color: transparent;
}

.bp-pin-card-surface {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bp-card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--bp-shadow);
  border: 1px solid rgba(231, 226, 219, 0.85);
  transform: rotate(var(--bp-rot, 0deg));
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.bp-pin-card:hover .bp-pin-card-surface,
.bp-pin-card:focus-visible .bp-pin-card-surface {
  transform: translateY(-6px) rotate(calc(var(--bp-rot, 0deg) * 0.35));
  box-shadow: var(--bp-shadow-hover);
}

.bp-pin-card:focus-visible {
  outline: 2px solid var(--bp-primary);
  outline-offset: 3px;
}

@keyframes bp-pin-float {
  0%, 100% {
    transform: translateY(0) rotate(var(--bp-rot, 0deg));
  }
  50% {
    transform: translateY(-7px) rotate(calc(var(--bp-rot, 0deg) * 0.92));
  }
}

.bp-pin-card-surface--float {
  animation: bp-pin-float var(--bp-float-dur, 8s) ease-in-out infinite;
  animation-delay: var(--bp-float-delay, 0s);
}

.bp-pin-card:hover .bp-pin-card-surface--float,
.bp-pin-card:focus-visible .bp-pin-card-surface--float {
  animation-play-state: paused;
}

.bp-pin-card-media {
  display: block;
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, #ece8e2, #f5f3ef);
  overflow: hidden;
}

.bp-pin-card--hero .bp-pin-card-media {
  aspect-ratio: 3 / 4;
}

.bp-pin-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bp-pin-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem 1.05rem;
}

.bp-pin-card-teaser {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  color: var(--bp-text);
}

.bp-pin-card-price {
  margin: 0;
  font-size: 0.82rem;
  color: var(--bp-muted);
}

.bp-pin-card-cta {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bp-primary);
}

.bp-pin-card:hover .bp-pin-card-cta,
.bp-pin-card:focus-visible .bp-pin-card-cta {
  color: var(--bp-primary-hover);
}

.bp-pin-card--hero {
  width: 100%;
  max-width: 340px;
}

.bp-pin-card--hero .bp-pin-card-surface {
  border-radius: 22px;
}

.bp-pin-card--hero .bp-pin-card-body {
  padding: 1rem 1.15rem 1.2rem;
}

.bp-pin-card--hero .bp-pin-card-teaser {
  font-size: 1rem;
  -webkit-line-clamp: 4;
}

/* Lower grid */
.bp-pin-feed-more {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bp-border);
}

.bp-pin-feed-more-h {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--bp-text);
}

.bp-pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.35rem;
}

.bp-pin-card--grid .bp-pin-card-media {
  aspect-ratio: 1 / 1;
}

.bp-pin-card--grid .bp-pin-card-teaser {
  -webkit-line-clamp: 2;
  font-size: 0.88rem;
}

/* Product page */
.bp-pin-product.bp-product {
  max-width: 960px;
  margin: 0 auto;
}

.bp-product-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.25rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

@media (max-width: 800px) {
  .bp-product-hero { grid-template-columns: 1fr; }
}

.bp-product-image img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--bp-border);
  display: block;
  box-shadow: var(--bp-shadow);
}

.bp-product-title {
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  margin: 0 0 0.5rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.bp-product-price {
  color: var(--bp-muted);
  margin: 0 0 1rem;
  font-size: 1.02rem;
}

.bp-product-lead { margin: 0 0 1rem; color: var(--bp-text); }

.bp-product-benefits {
  margin: 0 0 1.5rem;
  padding-left: 1.1rem;
  color: var(--bp-text);
}

.bp-product-benefits li { margin-bottom: 0.35rem; }

.bp-product-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.bp-btn {
  display: inline-block;
  padding: 0.82rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.bp-btn-primary {
  background: var(--bp-primary);
  color: #fff;
}

.bp-btn-primary:hover { background: var(--bp-primary-hover); }

.bp-btn-secondary {
  background: var(--bp-text);
  color: #fff;
}

.bp-btn-secondary:hover {
  background: #333;
}

@media (max-width: 640px) {
  .bp-product-ctas .bp-btn { width: 100%; }
}

.bp-product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.bp-product-gallery img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--bp-border);
}

.bp-product-why {
  max-width: 640px;
  margin-bottom: 2rem;
}

.bp-product-why h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.bp-affiliate-note {
  font-size: 14px;
  color: var(--bp-muted);
  max-width: 640px;
  padding: 1rem 1.1rem;
  background: var(--bp-card);
  border: 1px solid var(--bp-border);
  border-radius: 14px;
}

.bp-product-cta-hint {
  font-size: 13px;
  color: var(--bp-muted);
  margin-top: 0.75rem;
  max-width: 520px;
  line-height: 1.45;
}

/* Footer */
.bp-front-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
  border-top: 1px solid var(--bp-border);
  text-align: left;
  color: var(--bp-muted);
  font-size: 13px;
}

.bp-front-footer-brand {
  font-weight: 700;
  color: var(--bp-text);
  margin: 0 0 0.35rem;
  font-size: 14px;
}

.bp-front-footer-aff {
  font-size: 12px;
  margin: 0.5rem 0 0;
  line-height: 1.45;
}

.bp-front-footer-links a {
  color: var(--bp-muted);
  margin: 0 0.35rem 0 0;
}

.bp-front-footer-links a:hover { color: var(--bp-primary); }

.bp-front-copy { margin: 0.75rem 0 0; font-size: 12px; }

/* Legal */
.bp-legal { max-width: 720px; margin: 0 auto; text-align: left; }
.bp-legal-body { font-size: 15px; color: var(--bp-text); line-height: 1.65; }
.bp-legal-body p, .bp-legal-html p { margin: 0 0 1rem; }
.bp-legal-block { margin-bottom: 1.75rem; }
.bp-legal-block h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.bp-legal-pre { white-space: pre-wrap; }

.bp-404 { text-align: center; padding: 3rem 1rem; }

/* Tablet: simplify orbit */
@media (max-width: 960px) {
  .bp-pin-stage {
    min-height: auto;
  }
  .bp-pin-orbit {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
    pointer-events: auto;
  }
  .bp-pin-orbit-item {
    position: static;
    width: 100%;
    pointer-events: auto;
  }
  .bp-pin-hero-slot {
    padding-bottom: 0.25rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .bp-pin-orbit {
    grid-template-columns: 1fr;
  }
  .bp-pin-card--hero {
    max-width: 100%;
  }
  .bp-front-header {
    padding: 0.55rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bp-pin-stage {
    transform: none !important;
  }
  .bp-pin-card-surface--float {
    animation: none !important;
  }
  .bp-pin-card:hover .bp-pin-card-surface,
  .bp-pin-card:focus-visible .bp-pin-card-surface {
    transform: rotate(var(--bp-rot, 0deg));
  }
}
