:root {
  --detail-bg: #f5f6f7;
  --detail-panel: #fff;
  --detail-border: #e2e5e9;
  --detail-text: #20252b;
  --detail-muted: #66717c;
  --detail-accent: #176b42;
  --detail-accent-soft: #eaf5ee;
}

body {
  background: var(--detail-bg);
  color: var(--detail-text);
}

.wrap {
  width: min(100%, 1320px);
  margin-inline: auto;
  padding: 0 28px 120px;
}

.top {
  position: relative;
  z-index: 5;
  min-height: 68px;
  background: var(--detail-bg);
  border-bottom: 1px solid var(--detail-border);
}

.brand {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
}

.nav {
  align-items: center;
}

.home {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--detail-border);
  border-radius: 8px;
  background: #fff;
  transition: background .16s ease, border-color .16s ease;
}

.home:hover,
.btn.secondary:hover {
  background: #f0f3f4;
  border-color: #cbd2d8;
}

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  align-items: start;
  gap: 28px;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.media {
  position: sticky;
  top: 92px;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--detail-border);
  border-radius: 12px;
  background: #fff;
}

.media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
}

.details {
  align-self: start;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--detail-border);
  border-radius: 12px;
  background: var(--detail-panel);
}

.eyebrow {
  width: fit-content;
  color: var(--detail-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.details h1 {
  margin: 0;
  color: var(--detail-text);
  font-size: 32px;
  line-height: 1.18;
}

.desc {
  color: #4d5862;
  font-size: 15px;
  line-height: 1.65;
}

.old {
  color: #78818a;
  font-size: 14px;
}

.price {
  color: var(--detail-text);
  font-size: 40px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
}

.stock {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 5px;
  background: var(--detail-accent-soft);
  color: var(--detail-accent);
  font-size: 12px;
  font-weight: 750;
}

.field {
  gap: 8px;
}

.field label {
  color: var(--detail-text);
  font-size: 13px;
  font-weight: 750;
}

.input {
  min-width: 0;
  min-height: 46px;
  border: 1px solid #cbd1d8;
  border-radius: 8px;
  background: #fff;
}

.input:focus-visible,
.btn:focus-visible,
.home:focus-visible,
.mp-btn:focus-visible {
  outline: 3px solid rgba(23, 107, 66, .25);
  outline-offset: 2px;
}

.btn {
  min-height: 46px;
  border-radius: 8px;
  transition: background .16s ease, transform .16s ease;
}

.btn:active,
.mp-btn:active {
  transform: translateY(1px);
}

.primary {
  background: var(--detail-accent);
  color: #fff;
}

.primary:hover {
  background: #115735;
}

.secondary {
  border: 1px solid var(--detail-border);
  background: #f5f6f7;
  color: var(--detail-text);
}

#shippingAnchor {
  margin-top: 2px;
}

#shippingAnchor .row {
  align-items: stretch;
}

#pickupDirect {
  min-height: 48px;
  background: var(--detail-accent);
  font-weight: 800;
}

#pickupDirect:hover {
  background: #115735;
}

#shipping,
.shipping {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ship {
  min-height: 62px;
  border: 1px solid var(--detail-border);
  border-radius: 8px;
  background: #fff;
}

.ship:has(input:checked) {
  border-color: var(--detail-accent);
  background: var(--detail-accent-soft);
}

.ship small {
  margin-top: 3px;
  color: var(--detail-muted) !important;
  line-height: 1.4;
}

.details #buy {
  width: 100%;
  min-height: 50px;
  font-size: 15px;
}

.details #buy:disabled {
  background: #e5e8eb;
  color: #66717c;
  cursor: not-allowed;
  opacity: 1;
}

#share,
.mp-fav {
  width: 100%;
}

.mp-fav {
  min-height: 42px;
  border: 1px solid var(--detail-border);
  border-radius: 8px;
  background: #fff;
  color: var(--detail-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.notice {
  padding: 12px;
  border: 1px solid var(--detail-border);
  border-radius: 8px;
  background: #f7f8f9;
  color: #56616c;
  font-size: 12px;
  line-height: 1.5;
}

.error {
  line-height: 1.45;
}

.sticky {
  display: none;
}

.modal {
  background: rgba(18, 24, 29, .56);
  backdrop-filter: blur(3px);
}

.modalbox {
  border: 1px solid var(--detail-border);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(22, 30, 38, .18);
}

.mp-discovery {
  width: min(100%, 1320px);
  margin: 40px auto 96px;
  padding: 0 28px;
}

.mp-section {
  margin-top: 30px;
}

.mp-discovery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--detail-border);
}

.mp-discovery-head h2 {
  margin: 0;
  color: var(--detail-text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}

.mp-discovery .mp-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mp-discovery .mp-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--detail-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.mp-discovery .mp-card:hover {
  transform: translateY(-2px);
  border-color: #cbd3d9;
  box-shadow: 0 8px 22px rgba(25, 34, 41, .08);
}

.mp-discovery .mp-card-img {
  aspect-ratio: 1 / 1;
  background: #fff;
}

.mp-discovery .mp-card-img img {
  width: 100%;
  height: 100%;
  padding: 14px;
  object-fit: contain;
}

.mp-discovery .mp-card-body {
  min-height: 168px;
  padding: 13px;
  gap: 8px;
}

.mp-discovery .mp-card-store {
  overflow: hidden;
  color: var(--detail-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-discovery .mp-card-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.6em;
  color: var(--detail-text);
  font-size: 14px;
  font-weight: 650;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.3;
}

.mp-discovery .mp-old {
  color: #78818a;
  font-size: 12px;
}

.mp-discovery .mp-price {
  color: var(--detail-text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.mp-discovery .mp-btn {
  min-height: 42px;
  border-radius: 7px;
  background: var(--detail-accent);
  font-weight: 750;
}

.mp-discovery .mp-btn:hover {
  background: #115735;
}

.mp-discovery-empty {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--detail-border);
  border-radius: 8px;
  background: #fff;
  color: var(--detail-muted);
}

.mp-discovery-empty a {
  color: var(--detail-accent);
  font-weight: 800;
}

@media (max-width: 900px) {
  .wrap {
    padding-inline: 20px;
  }

  .product {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 16px;
  }

  .media {
    position: relative;
    top: auto;
    width: 100%;
    max-height: none;
    aspect-ratio: 1.12 / 1;
    padding: 18px;
  }

  .media img {
    max-height: min(82vw, 620px);
  }

  .details {
    gap: 13px;
    padding: 22px;
  }

  .mp-discovery .mp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 12px 92px;
  }

  .top {
    min-height: 58px;
    gap: 8px;
  }

  .brand {
    font-size: 14px;
  }

  .nav {
    gap: 6px;
  }

  .home {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .product {
    gap: 10px;
    margin-top: 10px;
  }

  .media {
    aspect-ratio: 1 / .92;
    padding: 12px;
    border-radius: 9px;
  }

  .media img {
    max-height: 92vw;
  }

  .details {
    gap: 12px;
    padding: 17px;
    border-radius: 9px;
  }

  .details h1 {
    font-size: 25px;
    line-height: 1.2;
  }

  .desc {
    font-size: 14px;
    line-height: 1.55;
  }

  .price {
    font-size: 33px;
  }

  #shippingAnchor .row {
    gap: 7px;
  }

  #shippingAnchor #calc {
    min-width: 92px;
  }

  .details #buy {
    min-height: 48px;
  }

  .mp-discovery {
    margin: 28px auto 84px;
    padding: 0 12px;
  }

  .mp-section {
    margin-top: 24px;
  }

  .mp-discovery-head {
    margin-bottom: 11px;
    padding-bottom: 9px;
  }

  .mp-discovery-head h2 {
    font-size: 19px;
  }

  .mp-discovery .mp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .mp-discovery .mp-card {
    border-radius: 8px;
  }

  .mp-discovery .mp-card-img img {
    padding: 8px;
  }

  .mp-discovery .mp-card-body {
    min-height: 156px;
    padding: 10px;
    gap: 7px;
  }

  .mp-discovery .mp-card-title {
    font-size: 13px;
  }

  .mp-discovery .mp-price {
    font-size: 18px;
  }

  .mp-discovery .mp-btn {
    min-height: 40px;
  }

  .sticky {
    display: flex;
    position: fixed;
    z-index: 25;
    right: 0;
    bottom: 0;
    left: 0;
    justify-content: center;
    padding: 9px 12px max(9px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--detail-border);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
  }

  .sticky .btn {
    width: min(100%, 620px);
    min-height: 48px;
    border-radius: 8px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.sale-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: -4px 0 -5px;
}

.sale-badge {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 5px;
  background: #176b42;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.sale-saving {
  color: #176b42;
  font-size: 13px;
  font-weight: 750;
}

.old {
  color: #78818a;
  font-size: 14px;
}
