/**
 * Appily Forty — Orchard Product Hub
 * Layout: hero crumb + gallery/buy split + trust row + tabs + related
 */

.page-product-forty.a40-product-forty {
  background: var(--a40-warm);
}
.page-product-forty .page-main { padding-top: 0; }

.a40-pd { padding-bottom: 3.5rem; }

/* Reveal */
.a40-pd-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.a40-pd-reveal.is-visible { opacity: 1; transform: none; }

/* Hero crumb band */
.a40-pd-hero {
  position: relative;
  overflow: hidden;
  padding: 1rem 0 1.25rem;
  background: var(--a40-hero-gradient);
  margin-bottom: 1.5rem;
}
.a40-pd-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.a40-pd-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.4;
  animation: a40-pd-blob 14s ease-in-out infinite;
}
.a40-pd-blob--1 { width: 220px; height: 220px; top: -30%; right: 5%; background: var(--a40-blob-warm); }
.a40-pd-blob--2 { width: 180px; height: 180px; bottom: -40%; left: 10%; background: var(--a40-blob-cool); animation-delay: -4s; }
@keyframes a40-pd-blob {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -5px); }
}

.a40-pd-crumb {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
  color: var(--a40-muted);
}
.a40-pd-crumb a {
  color: var(--a40-muted);
  text-decoration: none !important;
  font-weight: 600;
  transition: color 0.2s;
}
.a40-pd-crumb a:hover { color: var(--a40-orange); }
.a40-pd-crumb [aria-current="page"] {
  color: var(--a40-ink);
  font-weight: 700;
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main split */
.a40-pd-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

/* Gallery */
.a40-pd-gallery {
  position: sticky;
  top: 88px;
  margin: 0;
  padding: 1.5rem;
  background: var(--a40-surface);
  border: 1px solid var(--a40-border);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(33, 37, 41, 0.08);
  overflow: hidden;
  text-align: center;
}
.a40-pd-gallery-orbit {
  position: absolute;
  inset: 12%;
  border: 2px dashed rgba(45, 106, 79, 0.12);
  border-radius: 50%;
  animation: a40-pd-orbit 28s linear infinite;
  pointer-events: none;
}
@keyframes a40-pd-orbit { to { transform: rotate(360deg); } }

.a40-pd-badge,
.a40-pd-sale-tag {
  position: absolute;
  z-index: 2;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.a40-pd-badge {
  top: 1rem;
  left: 1rem;
  background: var(--a40-orange);
  color: #fff;
}
.a40-pd-sale-tag {
  top: 1rem;
  right: 1rem;
  background: var(--a40-berry);
  color: #fff;
}

.a40-pd-gallery img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.a40-pd-gallery:hover img { transform: scale(1.03); }

/* Buy card */
.a40-pd-buy-card {
  background: var(--a40-surface);
  border: 1px solid var(--a40-border);
  border-radius: 16px;
  padding: 1.35rem 1.4rem 1.4rem;
  box-shadow: 0 8px 28px rgba(33, 37, 41, 0.06);
}

.a40-pd-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a40-orange);
}
.a40-pd-buy-card h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--a40-ink);
}

.a40-pd-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(64, 145, 108, 0.1);
  color: var(--a40-green-dark);
}
.a40-pd-stock.is-out {
  background: rgba(193, 18, 31, 0.1);
  color: var(--a40-berry);
}

.a40-pd-price {
  margin: 0 0 0.85rem;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.a40-pd-price s {
  font-size: 0.95rem;
  color: var(--a40-muted);
}
.a40-pd-price strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--a40-green-dark);
}

.a40-pd-lede {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--a40-muted);
  line-height: 1.6;
}

.a40-pd-error {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(193, 18, 31, 0.3);
  background: rgba(193, 18, 31, 0.08);
  color: var(--a40-berry);
  font-size: 0.86rem;
}

/* Options */
.a40-pd-option { margin-bottom: 1rem; }
.a40-pd-option-label {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--a40-muted);
}
.a40-pd-option-label strong { color: var(--a40-ink); }

.a40-pd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.a40-pd-pill {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--a40-border);
  border-radius: 999px;
  background: var(--a40-cream);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--a40-muted);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.a40-pd-pill:hover { border-color: var(--a40-orange); color: var(--a40-orange); }
.a40-pd-pill.is-active {
  background: var(--a40-ink);
  border-color: var(--a40-ink);
  color: #fff;
}

.a40-pd-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}
.a40-pd-qty label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--a40-muted);
}
.a40-pd-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--a40-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--a40-surface);
}
.a40-pd-stepper button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.a40-pd-stepper button:hover { background: var(--a40-cream); color: var(--a40-orange); }
.a40-pd-stepper input {
  width: 44px;
  border: 0;
  border-left: 1px solid var(--a40-border);
  border-right: 1px solid var(--a40-border);
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.a40-pd-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.a40-pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}
.a40-pd-btn--cart {
  background: rgba(64, 145, 108, 0.12);
  color: var(--a40-green-dark);
  border: 1px solid rgba(64, 145, 108, 0.25);
}
.a40-pd-btn--cart:hover { background: rgba(64, 145, 108, 0.2); transform: translateY(-2px); }
.a40-pd-btn--buy {
  background: var(--a40-ink);
  color: #fff;
}
.a40-pd-btn--buy:hover { background: var(--a40-green-dark); transform: translateY(-2px); }
.a40-pd-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.a40-pd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  color: var(--a40-muted);
}
.a40-pd-meta strong { color: var(--a40-ink); margin-right: 0.25rem; }

.a40-pd-payments {
  display: flex;
  gap: 0.45rem;
}
.a40-pd-payments span {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--a40-cream);
  border: 1px solid var(--a40-border);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--a40-muted);
}

/* Trust row */
.a40-pd-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.a40-pd-trust-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  background: var(--a40-surface);
  border: 1px solid var(--a40-border);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(33, 37, 41, 0.04);
  transition: transform 0.2s, border-color 0.2s;
}
.a40-pd-trust-card:hover {
  transform: translateY(-3px);
  border-color: rgba(64, 145, 108, 0.3);
}
.a40-pd-trust-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
  line-height: 1;
}
.a40-pd-trust-card strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--a40-ink);
  margin-bottom: 0.25rem;
}
.a40-pd-trust-card p {
  margin: 0;
  font-size: 0.76rem;
  color: var(--a40-muted);
  line-height: 1.45;
}

/* Tabs */
.a40-pd-tabs-wrap { margin-bottom: 2rem; }
.a40-pd-tabs {
  background: var(--a40-surface);
  border: 1px solid var(--a40-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(33, 37, 41, 0.04);
}
.a40-pd-tab-nav {
  position: relative;
  display: flex;
  gap: 0;
  background: var(--a40-cream);
  border-bottom: 1px solid var(--a40-border);
}
.a40-pd-tab-link {
  flex: 1;
  padding: 0.9rem 1rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--a40-muted);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
}
.a40-pd-tab-link.is-active { color: var(--a40-green-dark); }
.a40-pd-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 3px;
  background: linear-gradient(90deg, var(--a40-orange), var(--a40-mint));
  border-radius: 3px 3px 0 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.a40-pd-tabs[data-active-tab="additional"] .a40-pd-tab-indicator {
  transform: translateX(100%);
}

.a40-pd-tab-panel {
  padding: 1.35rem 1.4rem 1.5rem;
  display: none;
}
.a40-pd-tab-panel.is-active { display: block; animation: a40-pd-panel-in 0.35s ease; }
@keyframes a40-pd-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.a40-pd-tab-panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--a40-ink);
}
.a40-pd-tab-panel h2:not(:first-child) { margin-top: 1.25rem; }

.a40-pd-detail-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  color: var(--a40-muted);
  line-height: 1.65;
}
.a40-pd-detail-list li { margin-bottom: 0.35rem; }
.a40-pd-detail-list strong { color: var(--a40-ink); }

.a40-pd-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.a40-pd-spec-table th,
.a40-pd-spec-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--a40-border);
  text-align: left;
}
.a40-pd-spec-table th {
  width: 38%;
  font-weight: 700;
  color: var(--a40-muted);
  background: var(--a40-cream);
}
.a40-pd-spec-table td { color: var(--a40-ink); }

/* Related */
.a40-pd-related h2 {
  margin: 0 0 1.15rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--a40-ink);
}
.a40-pd-related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

/* 404 */
.page-pd-miss .a40-pd-miss { padding: 3rem 0 4rem; }
.a40-pd-miss-inner {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 1.75rem;
  background: var(--a40-surface);
  border: 1px solid var(--a40-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(33, 37, 41, 0.08);
}
.a40-pd-miss-visual {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1;
}
.a40-pd-miss-inner h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}
.a40-pd-miss-inner p {
  margin: 0 0 1.25rem;
  color: var(--a40-muted);
  font-size: 0.9rem;
}
.a40-pd-btn--primary {
  display: inline-flex;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background: var(--a40-ink);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
}

/* Responsive */
@media (max-width: 960px) {
  .a40-pd-main { grid-template-columns: 1fr; }
  .a40-pd-gallery { position: static; }
  .a40-pd-trust { grid-template-columns: 1fr; }
  .a40-pd-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .a40-pd-actions { grid-template-columns: 1fr; }
  .a40-pd-related-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .a40-pd-reveal { transition: none; opacity: 1; transform: none; }
  .a40-pd-blob, .a40-pd-gallery-orbit { animation: none !important; }
  .a40-pd-tab-panel.is-active { animation: none !important; }
}
