/* ============================================================
   PRODUCT DETAIL PAGE — Views/Store/Product.cshtml, ProductNotFound.cshtml
   Prefix: pdp-. ("pd-similar*" for the similar-products strip lives in store-ux.css.)
   ============================================================ */

:root {
  --pdp-green-900: #0f5c28;
  --pdp-green-700: #1d8a43;
  --pdp-green-100: #e9f7ee;
  --pdp-green-50: #f5fcf7;
  --pdp-ink: #13241b;
  --pdp-text: #2b3a32;
  --pdp-muted: #5f6d66;
  --pdp-border: #e3ebe6;
  --pdp-amber-700: #a15c00;
  --pdp-amber-100: #fff4e0;
  --pdp-red-700: #b42318;
  --pdp-radius: 16px;
  --pdp-focus: 0 0 0 3px rgba(29, 138, 67, 0.32);
}

/* ---------- Breadcrumb ---------- */

.pdp-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
  color: var(--pdp-muted);
}

.pdp-breadcrumb li + li::before {
  content: "›";
  margin-right: 0.3rem;
  color: #a3b1aa;
}

.pdp-breadcrumb a {
  color: var(--pdp-green-700);
  text-decoration: none;
}

.pdp-breadcrumb a:hover { text-decoration: underline; }

.pdp-breadcrumb [aria-current] {
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pdp-text);
}

/* ---------- Layout ---------- */

.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  padding: 1.75rem;
  border: 1px solid var(--pdp-border);
  border-radius: 20px;
  background: #fff;
}

/* ---------- Gallery ---------- */

.pdp-gallery {
  position: sticky;
  top: 96px;
}

.pdp-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pdp-border);
  border-radius: var(--pdp-radius);
  background: #fff;
  overflow: hidden;
}

.pdp-stage-img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.pdp-off-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: #fff0c4;
  color: #8a5500;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
}

.pdp-share {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--pdp-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--pdp-text);
}

.pdp-share:hover { border-color: var(--pdp-green-700); color: var(--pdp-green-900); }
.pdp-share.is-copied { background: var(--pdp-green-700); border-color: var(--pdp-green-700); color: #fff; }

.pdp-thumbs {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.85rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.pdp-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 4px;
  border: 2px solid var(--pdp-border);
  border-radius: 12px;
  background: #fff;
}

.pdp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pdp-thumb[aria-pressed="true"] { border-color: var(--pdp-green-700); }

.pdp-share:focus-visible,
.pdp-thumb:focus-visible,
.pdp-variant:focus-visible,
.pdp-btn:focus-visible,
.pdp-link-btn:focus-visible,
.pdp-stepper button:focus-visible,
.pdp-brand:focus-visible,
.pdp-rating:focus-visible {
  outline: none;
  box-shadow: var(--pdp-focus);
}

/* ---------- Buy box ---------- */

.pdp-info {
  min-width: 0;
}

.pdp-brand {
  display: inline-block;
  margin-bottom: 0.35rem;
  border-radius: 4px;
  color: var(--pdp-green-700);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.pdp-brand:hover { text-decoration: underline; }

.pdp-title {
  margin: 0 0 0.6rem;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--pdp-ink);
}

.pdp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.pdp-pack,
.pdp-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.pdp-pack { background: #f1f5f2; color: var(--pdp-text); }
.pdp-rating { background: #fff7e6; color: #8a5a00; }
.pdp-rating .bi { color: #e8a317; }
.pdp-rating span { font-weight: 600; color: var(--pdp-muted); }

.pdp-price {
  padding: 1rem 1.1rem;
  margin-bottom: 1.1rem;
  border-radius: var(--pdp-radius);
  background: var(--pdp-green-50);
}

.pdp-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}

.pdp-price-now {
  font-family: "Manrope", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--pdp-ink);
  font-variant-numeric: tabular-nums;
}

.pdp-price-mrp { color: var(--pdp-muted); font-size: 1rem; }

.pdp-price-off {
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--pdp-green-700);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}

.pdp-price-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--pdp-muted);
}

.pdp-save { color: var(--pdp-green-900); font-weight: 700; }

.pdp-label {
  margin: 0 0 0.6rem;
  font-family: "Manrope", sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pdp-muted);
}

.pdp-variants { margin-bottom: 1.1rem; }

.pdp-variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pdp-variant {
  display: flex;
  flex-direction: column;
  min-width: 110px;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--pdp-border);
  border-radius: 12px;
  background: #fff;
  color: var(--pdp-text);
  text-decoration: none;
  line-height: 1.3;
}

.pdp-variant strong { font-size: 0.92rem; color: var(--pdp-ink); }
.pdp-variant span { font-size: 0.84rem; }
.pdp-variant s { margin-left: 0.3rem; color: var(--pdp-muted); }
.pdp-variant small { font-size: 0.72rem; color: var(--pdp-red-700); font-weight: 700; }
.pdp-variant:hover { border-color: #a9d6b7; color: var(--pdp-text); }

.pdp-variant.is-selected {
  border-color: var(--pdp-green-700);
  background: var(--pdp-green-50);
  box-shadow: inset 0 0 0 1px var(--pdp-green-700);
}

.pdp-variant.is-oos { opacity: 0.65; }

/* Delivery */
.pdp-delivery {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--pdp-border);
  border-radius: 14px;
}

.pdp-delivery > .bi {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--pdp-green-100);
  color: var(--pdp-green-700);
}

.pdp-delivery > div {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.pdp-delivery strong { color: var(--pdp-ink); font-size: 0.92rem; }
.pdp-delivery span { color: var(--pdp-muted); font-size: 0.8rem; }

.pdp-delivery.is-ok { border-color: #bfe1ca; background: var(--pdp-green-50); }
.pdp-delivery.is-ok > .bi { background: var(--pdp-green-700); color: #fff; }
.pdp-delivery.is-no { border-color: #f3d9a4; background: var(--pdp-amber-100); }
.pdp-delivery.is-no > .bi { background: #fde7bd; color: var(--pdp-amber-700); }

.pdp-link-btn {
  flex: 0 0 auto;
  padding: 0.3rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--pdp-green-700);
  font-weight: 800;
  font-size: 0.86rem;
}

.pdp-link-btn:hover { background: var(--pdp-green-100); }

/* Stock + CTA */
.pdp-buy { margin-bottom: 1.5rem; }

.pdp-stock {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--pdp-green-900);
}

.pdp-stock.is-low { color: var(--pdp-amber-700); }
.pdp-stock.is-out { color: var(--pdp-red-700); }

.pdp-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.pdp-cta-form { margin: 0; }

.pdp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 52px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pdp-btn--primary { background: var(--pdp-green-700); color: #fff; }
.pdp-btn--primary:hover { background: var(--pdp-green-900); color: #fff; }
.pdp-btn--dark { background: var(--pdp-ink); color: #fff; }
.pdp-btn--dark:hover { background: #000; color: #fff; }
.pdp-btn--outline { border-color: #c7dfcf; background: #fff; color: var(--pdp-green-900); }
.pdp-btn--outline:hover { border-color: var(--pdp-green-700); color: var(--pdp-green-900); }
.pdp-btn--disabled { background: #eef1ef; color: var(--pdp-muted); cursor: not-allowed; }

.pdp-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  border-radius: 12px;
  background: var(--pdp-green-700);
  color: #fff;
  overflow: hidden;
}

.pdp-stepper button {
  width: 52px;
  height: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
}

.pdp-stepper button:hover:not(:disabled) { background: rgba(0, 0, 0, 0.12); }
.pdp-stepper button:disabled { opacity: 0.4; cursor: not-allowed; }

.pdp-stepper .js-product-qty-value {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.pdp-limit {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--pdp-muted);
}

/* Details */
.pdp-details {
  padding-top: 1.25rem;
  border-top: 1px solid var(--pdp-border);
}

.pdp-description {
  margin-bottom: 0.9rem;
  color: var(--pdp-text);
  line-height: 1.6;
}

.pdp-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
  font-size: 0.9rem;
}

.pdp-facts dt { color: var(--pdp-muted); font-weight: 600; }
.pdp-facts dd { margin: 0; color: var(--pdp-ink); font-weight: 600; overflow-wrap: anywhere; }
.pdp-facts a { color: var(--pdp-green-700); }

/* ---------- Reviews ---------- */

.pdp-reviews {
  margin-top: 1.5rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--pdp-border);
  border-radius: 20px;
  background: #fff;
}

.pdp-section-title {
  margin: 0 0 1rem;
  font-family: "Manrope", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pdp-ink);
}

.pdp-reviews-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2rem;
}

.pdp-review-score {
  font-family: "Manrope", sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--pdp-ink);
}

.pdp-review-score small { font-size: 1rem; color: var(--pdp-muted); }
.pdp-review-stars { margin: 0.4rem 0; color: #e8a317; }
.pdp-review-summary p { margin: 0 0 0.75rem; color: var(--pdp-muted); font-size: 0.88rem; }

.pdp-bars {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--pdp-muted);
}

.pdp-bars li {
  display: grid;
  grid-template-columns: 2.2rem 1fr 2rem;
  align-items: center;
  gap: 0.5rem;
}

.pdp-bar {
  height: 8px;
  border-radius: 999px;
  background: #eef1ef;
  overflow: hidden;
}

.pdp-bar span { display: block; height: 100%; border-radius: 999px; background: #e8a317; }

.pdp-review-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdp-review {
  padding: 0.9rem 1rem;
  border: 1px solid var(--pdp-border);
  border-radius: 14px;
}

.pdp-review-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.pdp-review-head > div { flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.25; }
.pdp-review-head strong { color: var(--pdp-ink); font-size: 0.92rem; }
.pdp-review-head time { color: var(--pdp-muted); font-size: 0.76rem; }

.pdp-review-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dfeee5;
  color: var(--pdp-green-900);
  font-weight: 800;
}

.pdp-review-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: var(--pdp-green-700);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}

.pdp-review p { margin: 0; color: var(--pdp-text); line-height: 1.55; }
.pdp-review-more { color: var(--pdp-muted); font-size: 0.84rem; }

.pdp-no-reviews {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  color: var(--pdp-muted);
}

/* ---------- Not found ---------- */

.pdp-missing {
  max-width: 560px;
  margin: 2rem auto;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--pdp-border);
  border-radius: 20px;
  background: #fff;
  text-align: center;
}

.pdp-missing-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--pdp-green-100);
  color: var(--pdp-green-700);
  font-size: 1.9rem;
}

.pdp-missing h1 {
  font-family: "Manrope", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--pdp-ink);
}

.pdp-missing p { color: var(--pdp-muted); }

.pdp-missing-search {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  margin: 1.25rem auto 1rem;
}

.pdp-missing-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 0.9rem;
  border: 1.5px solid var(--pdp-border);
  border-radius: 10px;
}

.pdp-missing-search input:focus { outline: none; border-color: var(--pdp-green-700); box-shadow: var(--pdp-focus); }

.pdp-missing-search button {
  height: 46px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 10px;
  background: var(--pdp-green-700);
  color: #fff;
  font-weight: 800;
}

.pdp-missing-link { color: var(--pdp-green-700); font-weight: 700; text-decoration: none; }

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .pdp { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.25rem; }
  .pdp-gallery { position: static; }
  .pdp-stage { max-width: 520px; margin: 0 auto; width: 100%; }
  .pdp-thumbs { justify-content: center; }
  .pdp-reviews-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}

@media (max-width: 575px) {
  .pdp { padding: 1rem; border-radius: 16px; }
  .pdp-breadcrumb [aria-current] { max-width: 22ch; }
  .pdp-price-now { font-size: 1.7rem; }
  .pdp-reviews { padding: 1.1rem; }
  .pdp-facts { grid-template-columns: 1fr; gap: 0.1rem; }
  .pdp-facts dd { margin-bottom: 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pdp-btn { transition: none; }
}
