/* piece-modal.css — Chundra */

#piece-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
}
#piece-modal.is-open { display: flex; }

#pm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

#pm-content {
  position: relative;
  background: #EBE9D4;
  width: 98%;
  max-width: 1200px;
  height: 92vh;
  max-height: 92vh;
  overflow: hidden;
  z-index: 1;
  border-radius: 3px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

#pm-close {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  background: rgba(255,255,255,0.85);
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #555;
  z-index: 10;
  padding: 2px 8px;
  border-radius: 50%;
}
#pm-close:hover { background: #fff; color: #111; }

/* ── Inner layout ── */
#pm-inner {
  display: grid;
  grid-template-columns: 60% 40%;
  height: 100%;
  overflow: hidden;
}

/* ── Gallery / Slider ── */
#pm-gallery {
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#pm-slider-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 0;
  position: relative;
}

#pm-main-img-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

#pm-main-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  display: block;
}

#pm-prev, #pm-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 5;
  transition: background 0.15s;
}
#pm-prev { left: 10px; }
#pm-next { right: 10px; }
#pm-prev:hover, #pm-next:hover { background: rgba(255,255,255,0.3); }

#pm-thumbs {
  display: flex;
  gap: 5px;
  padding: 8px 12px;
  background: #111;
  overflow-x: auto;
  flex-shrink: 0;
  justify-content: center;
}
#pm-thumbs::-webkit-scrollbar { height: 4px; }
#pm-thumbs::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.pm-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 2px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.55;
  flex-shrink: 0;
  transition: opacity 0.15s, border-color 0.15s;
}
.pm-thumb.active, .pm-thumb:hover { opacity: 1; border-color: #594593; }

/* ── Details panel ── */
#pm-details {
  padding: 1.8rem 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow-y: auto;
  height: 100%;
}

#pm-category-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin: 0;
}

#pm-title {
  font-family: "Edu AU VIC WA NT Pre", cursive;
  font-size: 2rem;
  font-weight: 200;
  margin: 0;
  color: #333;
  line-height: 1.2;
}

#pm-subtitle {
  font-style: italic;
  font-size: 1rem;
  color: #777;
  margin: 0;
}

/* Price */
#pm-price-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0;
}
.pm-price { font-size: 1.4rem; color: #333; font-weight: 600; }
.price-original { color: #bbb; text-decoration: line-through; font-size: 1rem; }
.price-sale { font-size: 1.4rem; font-weight: 700; color: #333; }
.price-badge {
  background: #d11040;
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 700;
}

/* Description — no scroll, just flows */
#pm-description {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #555;
}
#pm-description p { margin: 0 0 0.6rem; }
#pm-description p:last-child { margin-bottom: 0; }

/* Specs */
#pm-specs {
  border-top: 1px solid #d8d5c3;
  padding-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.pm-spec { font-size: 0.88rem; color: #666; line-height: 1.5; }
.pm-spec strong { color: #444; }
.pm-spec-note { color: #a07030; font-size: 0.8rem; }

/* Shipping preview */
#pm-shipping-block {
  background: #f2f0e4;
  border-radius: 3px;
  padding: 0.8rem 1rem;
}
.pm-shipping-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  margin: 0 0 0.5rem;
}
#pm-shipping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
#pm-shipping-table td { padding: 0.22rem 0; color: #555; }
#pm-shipping-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: #333;
}
#pm-shipping-custom { font-size: 0.85rem; color: #a07030; line-height: 1.5; }
.pm-shipping-multi {
  font-size: 0.78rem;
  color: #999;
  margin: 0.6rem 0 0;
  font-style: italic;
  line-height: 1.4;
}

/* Actions */
#pm-actions { margin-top: auto; padding-top: 0.5rem; }
#pm-cart-btn {
  cursor: pointer;
  font-size: 1rem;
  border-radius: 6px;
  display: block;
  width: 100%;
  padding: 13px 20px;
  background: #594593;
  color: #fff;
  border: 0;
  text-align: center;
  transition: background 0.2s;
  margin: 0;
}
#pm-cart-btn:hover { background: #318160; }
#pm-cart-btn.in-cart { background: #618764; }
#pm-cart-btn.in-cart:hover { background: #4a6650; }
#pm-sold-msg { color: #888; font-style: italic; padding: 10px 0; margin: 0; }

/* ── Responsive ── */
@media (max-width: 800px) {
  #pm-inner {
    grid-template-columns: 1fr;
    grid-template-rows: 55vh auto;
    overflow-y: auto;
    height: auto;
  }
  #pm-content {
    height: auto;
    max-height: 95vh;
    overflow-y: auto;
  }
  #pm-gallery { height: 55vh; min-height: 55vh; }
  #pm-details {
    height: auto;
    overflow-y: visible;
    padding: 1.2rem 1rem;
  }
  #pm-title { font-size: 1.6rem; }
}

/* ── Shipping preview full table ── */
.pm-shipping-subtitle {
  font-size: 0.65rem;
  color: #aaa;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}
#pm-shipping-table-full {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.3rem;
}
#pm-shipping-table-full th {
  font-size: 0.7rem;
  color: #aaa;
  font-weight: 400;
  text-align: right;
  padding: 0 0 0.3rem;
}
#pm-shipping-table-full th:first-child { text-align: left; }
#pm-shipping-table-full td {
  padding: 0.2rem 0;
  color: #555;
  text-align: right;
}
#pm-shipping-table-full td:first-child {
  text-align: left;
  color: #444;
}
#pm-shipping-table-full tbody tr:not(:last-child) td {
  border-bottom: 1px solid #e8e5d8;
}
#pm-shipping-table-full td:last-child,
#pm-shipping-table-full th:last-child {
  color: #594593;
  font-weight: 600;
}
#pm-shipping-table-full td:last-child[data-na="true"] {
  color: #ccc;
  font-weight: 400;
}
