/* ===============================
   PRODUCT DETAIL PAGE - GOENJOY
   =============================== */

/* Root Variables */
:root {
  --primary-blue: #1e40af;
  --accent-green: #28a745;
  --accent-sky: #17a2b8;
  --border-color: #e5e7eb;
  --muted-color: #6b7280;
  --background-light: #f8fafc;
  --text-dark: #0b1220;
  --warning-yellow: #f59e0b;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  --error-bg: #fff1f2;
  --error-border: #fecaca;
  --error-text: #991b1b;
  --transition: all 0.3s ease;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #fff;
  color: var(--text-dark);
  line-height: 1.5;
  font-size: 16px;
}

/* Container */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Card */
.card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
@media (max-width: 480px) {
  .card {
    padding: 16px;
  }
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Header */
.header {
  background: var(--primary-blue);
  color: #fff;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 768px) {
  .header {
    padding: 16px;
    min-height: 64px;
  }
}

/* Product Title dan Badge */
.header .pd-title {
  font-size: clamp(20px, 5vw, 24px);
  line-height: 1.4;
  margin: 0;
  word-break: break-word;
}
.header .badge {
  margin-bottom: 10px;
}
@media (max-width: 768px) {
  .header .pd-title {
    font-size: clamp(18px, 4vw, 20px);
  }
}
@media (max-width: 480px) {
  .header .pd-title {
    font-size: clamp(16px, 3.5vw, 18px);
  }
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  background: #eaf2ff;
  color: var(--primary-blue);
  border: 1px solid #c7d7fe;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-green {
  background: var(--accent-green);
  color: #fff;
}
.btn-sky {
  background: var(--accent-sky);
  color: #fff;
}
.btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.7;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* Muted Text */
.muted {
  color: var(--muted-color);
}

/* Horizontal Rule */
.hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}

/* Toast Notification */
.toast {
  position: sticky;
  top: 20px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.toast-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}
.toast-err {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

/* ===============================
   IMAGE & MEDIA GALLERY
   =============================== */
.media-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.media-main {
  width: 100%;
  min-height: 360px;
  background: var(--background-light);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

/* Thumbnail Grid */
.thumbs-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}
@media (max-width: 768px) {
  .thumbs-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }
}
.thumb {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 1 / 1;
  transition: var(--transition);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb:hover,
.thumb:focus,
.thumb-active {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px var(--primary-blue);
}

/* ===============================
   LIGHTBOX
   =============================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 12px;
}
.lightbox .close,
.lightbox .prev,
.lightbox .next {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.lightbox .close:hover,
.lightbox .prev:hover,
.lightbox .next:hover {
  background: rgba(255, 255, 255, 0.3);
}
.lightbox .close {
  top: 20px;
  right: 20px;
}
.lightbox .prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox .next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* ===============================
   STORE & REVIEW SECTION
   =============================== */
.review-card {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fff;
  transition: var(--transition);
}
.review-card:hover {
  box-shadow: var(--shadow-sm);
}
.store-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--background-light);
  text-decoration: none;
  color: var(--text-dark);
  transition: var(--transition);
}
.store-card:hover {
  background: #f1f5f9;
  box-shadow: var(--shadow-sm);
}
.store-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.store-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.store-badge {
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

/* ===============================
   FORM ELEMENTS
   =============================== */
.pd-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
}
.pd-select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  transition: var(--transition);
}
.pd-select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.2);
}
.pd-btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.pd-btn-row form {
  flex: 1;
  margin: 0;
}
.pd-btn-row .btn {
  width: 100%;
  padding: 12px;
}
@media (max-width: 768px) {
  .pd-btn-row {
    flex-wrap: wrap;
    gap: 10px;
  }
}
@media (max-width: 480px) {
  .pd-btn-row {
    flex-direction: column;
    align-items: stretch;
  }
  .pd-btn-row form {
    width: 100%;
  }
}

/* ===============================
   RATING & DESCRIPTION
   =============================== */
.pd-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.pd-stars {
  color: var(--warning-yellow);
}
.pd-desc {
  line-height: 1.7;
  color: var(--text-dark);
}

/* ===============================
   BUTTON ACTIONS
   =============================== */
.btn-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-actions form {
  flex: 1;
  min-width: 160px;
}
.btn-actions button {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
}

/* ===============================
   Z-INDEX MANAGEMENT
   =============================== */
.product-header,
.header-nav {
  position: relative;
  z-index: 200;
}