/* ===== Product detail page (TopRayan-like) ===== */

.product-detail-page {
  padding-bottom: 80px;
}

.pd-breadcrumb {
  padding-top: 12px;
}

/* Hero layout */
.pd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 280px;
  gap: 20px;
  align-items: start;
  margin-top: 8px;
}

@media (max-width: 1199px) {
  .pd-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .pd-buybox {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (max-width: 767px) {
  .pd-hero {
    grid-template-columns: 1fr;
  }

  .pd-buybox {
    grid-template-columns: 1fr;
  }
}

/* Gallery */
.pd-gallery {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 16px;
  position: relative;
}

.pd-gallery-main {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}

body.night .pd-gallery-main {
  background: #1e1e20;
}

.pd-gallery-main img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.pd-gallery-zoom {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 16px;
  line-height: 1;
}

.pd-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pd-thumbs::-webkit-scrollbar {
  height: 4px;
}

.pd-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

body.night .pd-thumb {
  background: #2a2a2c;
}

.pd-thumb.is-active,
.pd-thumb:hover {
  border-color: var(--red);
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Product info */
.pd-info {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
}

.pd-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.pd-code strong {
  color: var(--text);
  font-weight: 700;
}

.pd-brand-line {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.pd-brand-line a {
  color: var(--red);
}

.pd-brand-line span {
  margin: 0 4px;
  color: #ccc;
}

.pd-title1 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.6;
  margin: 0 0 8px;
  color: var(--text);
}

.pd-title2 {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.pd-tags {
  margin-bottom: 14px;
}

.pd-tag-low {
  display: inline-block;
  background: #fff3e0;
  color: #e65100;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
}

.pd-highlight-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.pd-highlight-list li {
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.pd-highlight-list li span {
  color: var(--muted);
}

/* Offers */
.pd-offers-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.pd-offer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pd-offer {
  position: relative;
}

.pd-offer input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pd-offer label {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  padding-inline-start: 44px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 13px;
  line-height: 1.6;
}

.pd-offer label::before {
  content: "";
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
}

.pd-offer input:checked + label {
  border-color: var(--red);
  background: #fff5f6;
}

body.night .pd-offer input:checked + label {
  background: rgba(223, 30, 47, 0.08);
}

.pd-offer input:checked + label::before {
  border-color: var(--red);
  box-shadow: inset 0 0 0 4px var(--red);
}

.pd-offer-variant {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.pd-offer-guarantee {
  color: var(--text);
}

.pd-offer-guarantee a {
  font-size: 11px;
  margin-right: 4px;
}

.pd-offer-seller {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.pd-offer-installment {
  color: #0496c9;
  font-weight: 600;
}

/* Buy box */
.pd-buybox {
  position: sticky;
  top: calc(var(--header-h, 0px) + 12px);
}

.pd-buy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.pd-price-block {
  margin-bottom: 16px;
}

.pd-price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.pd-price-amounts {
  text-align: left;
}

.pd-price-old {
  font-size: 13px;
  color: var(--muted);
  text-decoration: line-through;
  margin-bottom: 2px;
}

.pd-price-now {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.pd-price-now .unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.pd-discount-badge {
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.pd-price-call {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red);
}

.pd-add-cart {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 16px;
  transition: background 0.15s;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
}

.pd-add-cart:hover {
  background: var(--red-dark);
  color: #fff;
}

a.pd-add-cart {
  color: #fff;
}

.pd-add-cart:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.pd-side-box {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.pd-side-box svg {
  flex-shrink: 0;
}

/* Sticky bar */
.pd-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1010;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 0.25s;
  padding: 10px 0;
}

.pd-sticky.is-visible {
  transform: translateY(0);
}

.pd-sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pd-sticky-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.pd-sticky-summary img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.pd-sticky-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-sticky-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.pd-sticky .pd-price-now {
  font-size: 1.1rem;
}

.pd-sticky .pd-add-cart {
  width: auto;
  min-width: 160px;
  padding: 10px 20px;
  font-size: 0.9rem;
}

@media (max-width: 575px) {
  .pd-sticky-summary {
    display: none;
  }

  .pd-sticky-inner {
    justify-content: stretch;
  }

  .pd-sticky-actions {
    width: 100%;
    justify-content: space-between;
  }

  .pd-sticky .pd-add-cart {
    flex: 1;
  }
}

/* Specs section */
.pd-specs-section {
  margin-top: 28px;
}

.pd-section-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.pd-section-tab {
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
}

.pd-section-tab.is-active {
  color: var(--red);
  border-bottom-color: var(--red);
}

.pd-specs-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.properties-title {
  display: inline;
  font-size: 14px;
  font-weight: 500;
  color: var(--red);
  margin: 0;
}

.pd-specs-box > .properties-title:first-child {
  margin-top: 0;
}

.pd-specs-box > br + .properties,
.pd-specs-box > .properties {
  margin-top: 5px;
}

.properties {
  display: block;
  margin: 5px 0 15px;
  padding: 0;
}

.properties .prp {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  font-size: 14px;
}

.properties .prp:last-child {
  margin-bottom: 0;
}

.properties .prp-title {
  flex: 0 0 22%;
  max-width: 280px;
  background: #f5f5f5;
  color: var(--text);
  padding: 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.properties .prp-value {
  flex: 1 1 auto;
  background: rgba(245, 245, 245, 0.71);
  color: var(--text);
  padding: 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.properties .prp-value > div {
  margin: 0;
}

body.night .properties .prp-title {
  background: #2c2c2e;
}

body.night .properties .prp-value {
  background: rgba(44, 44, 46, 0.71);
}

@media (max-width: 575px) {
  .properties .prp {
    flex-direction: column;
    gap: 0;
  }

  .properties .prp-title {
    flex: none;
    max-width: none;
    width: 100%;
  }
}

/* Related products */
.pd-related {
  margin-top: 36px;
}

.pd-related-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pd-related-head h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

.pd-related-head .line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Trust icons */
.pd-trust {
  margin-top: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 10px;
}

.pd-trust-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  text-align: center;
}

@media (max-width: 991px) {
  .pd-trust-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .pd-trust-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pd-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.pd-trust-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f0f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

body.night .pd-trust-icon {
  background: #1e2a38;
}

/* Image modal */
.pd-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pd-modal.is-open {
  display: flex;
}

.pd-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.pd-modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* Mobile bottom bar */
.pd-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1005;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 575px) {
  .pd-mobile-bar {
    display: flex;
  }

  .product-detail-page {
    padding-bottom: 70px;
  }

  .pd-sticky {
    display: none;
  }
}
