/**
 * MadeByPeer Product Page Styles
 * Gemeenschappelijke CSS voor productpagina's
 */

:root {
  --green-dark: #3b6d11;
  --green: #639922;
  --cream: #f7f5f0;
  --near-black: #1a1a1a;
  --white: #ffffff;
  --border: #e4e1d8;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--near-black);
  background: var(--white);
}

img { max-width: 100%; }

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  margin: 0;
}

a { color: inherit; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--green-dark);
  padding: 18px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header a {
  color: var(--white);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  font-size: 13px;
  color: #6b6b67;
  padding: 20px 0 0;
}

.breadcrumb a {
  color: #6b6b67;
  text-decoration: none;
}

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

/* ============================================
   PRODUCT TITLE
   ============================================ */
.product-title {
  padding: 8px 0 20px;
}

.product-title h1 {
  font-size: 34px;
  color: var(--near-black);
}

.product-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #6a6a66;
  margin: 6px 0 0;
}

/* ============================================
   MAIN GRID
   ============================================ */
.product-main {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}

/* ============================================
   MEDIA GALLERY
   ============================================ */
.media-main {
  aspect-ratio: 1/1;
  background: var(--cream);
  border-radius: 12px;
  overflow: hidden;
  border: 0.5px solid var(--border);
}

.media-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbs {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.thumbs button {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  width: 72px;
  height: 72px;
  background: var(--cream);
  cursor: pointer;
  flex: 0 0 auto;
}

.thumbs button.active {
  border-color: var(--green-dark);
}

.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================
   SPECS PILLS
   ============================================ */
.specs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.spec-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  background: var(--white);
}

.spec-pill:hover {
  border-color: var(--green-dark);
}

.spec-pill svg {
  flex-shrink: 0;
}

.spec-pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--near-black);
  color: var(--white);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  width: 200px;
  line-height: 1.5;
  z-index: 5;
}

.spec-pop.wide {
  width: 230px;
}

.spec-pill.open .spec-pop {
  display: block;
}

/* ============================================
   PRICE & ORDER
   ============================================ */
.price {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 14px;
}

.price-unit {
  font-size: 12px;
  font-weight: 400;
  color: #5c5c58;
  margin-left: 4px;
}

.btn-order {
  display: block;
  width: 100%;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background 0.2s;
}

.btn-order:hover {
  background: #2f5a0d;
}

.cart-existing-note {
  font-size: 12px;
  color: var(--green-dark);
  margin: -12px 0 20px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.field-label {
  font-size: 12px;
  color: #5c5c58;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.section-heading {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--near-black);
  margin: 4px 0 14px;
  padding-top: 18px;
  border-top: 0.5px solid var(--border);
}

.qty-select {
  display: block;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
  background-color: var(--white);
  color: var(--near-black);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* ============================================
   COLOR OPTION BUTTONS
   ============================================ */
.option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
}

.option-btn .swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, .15);
  vertical-align: -3px;
}

.option-btn .chev {
  color: #6b6b6b;
  font-size: 12px;
}

/* ============================================
   PERSONALIZATION
   ============================================ */
.personalization {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 20px;
}

.personalization .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.personalization input[type=text] {
  width: 100%;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

.personalization .counter {
  font-size: 12px;
  color: #6b6b6b;
  text-align: right;
  margin-top: 4px;
}

.badge-free {
  font-size: 12px;
  color: var(--green-dark);
  background: #eaf3de;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.badge-price {
  font-size: 12px;
  color: var(--near-black);
  background: var(--cream);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.personalization-disclaimer {
  font-size: 12px;
  color: var(--green-dark);
  margin: 8px 0 0;
  line-height: 1.5;
  display: none;
}

/* ============================================
   DELIVERY & SHIPPING
   ============================================ */
.delivery-block {
  margin-bottom: 14px;
}

.production-note {
  font-size: 12px;
  color: #6a6a66;
  margin: 8px 0 0;
  line-height: 1.5;
}

.shipping-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
}

.carrier-badge {
  font-weight: 500;
}

.shipping-note {
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
  margin: 10px 0 0;
  line-height: 1.5;
}

/* ============================================
   SMALL PRINT (Annuleerbeleid)
   ============================================ */
.small-print {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12px;
  color: #6a6a66;
  line-height: 1.6;
}

.small-print strong {
  color: var(--near-black);
}

/* ============================================
   DESCRIPTION
   ============================================ */
.description {
  max-width: 760px;
  padding-bottom: 60px;
}

.description h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

.description p {
  font-size: 15px;
  line-height: 1.75;
  color: #333;
  margin: 0 0 16px;
}

.description h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin: 24px 0 10px;
}

.description ul {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.75;
  color: #333;
}

/* ============================================
   COLOR MODAL
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, .5);
  z-index: 50;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  width: 300px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 14px;
}

.modal-option {
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 4px;
}

.modal-option .color-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
}

.modal-option .color-main:hover {
  background: var(--cream);
}

.modal-option .swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .15);
  flex-shrink: 0;
}

.modal-option .color-name {
  display: block;
}

.modal-option .color-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-option .check {
  color: var(--green-dark);
  visibility: hidden;
  flex-shrink: 0;
}

.modal-option.selected .check {
  visibility: visible;
}

.modal-option .policy-note {
  font-size: 11px;
  color: #e67e22;
  display: block;
}

.modal-option .info-toggle {
  width: 28px;
  height: 28px;
  border: 2px solid;
  background-color: #f5f5dc;
  color: #888;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  line-height: 28px;
  transition: background .15s, transform .2s;
}

.modal-option .info-toggle:hover {
  background: var(--cream);
  color: #555;
}

.modal-option.details-open .info-toggle {
  transform: rotate(180deg);
}

/* Color details accordion */
.color-details {
  display: none;
  padding: 0 10px 12px;
  animation: slideDown .2s ease-out;
}

.modal-option.details-open .color-details {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.color-details-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

/* Color gallery (swipeable) */
.color-gallery {
  margin-bottom: 10px;
}

.color-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 8px;
  border-radius: 8px;
}

.color-gallery-track::-webkit-scrollbar {
  display: none;
}

.color-gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.color-gallery.has-multiple .color-gallery-slide {
  flex: 0 0 calc(100% - 16px);
}

.color-gallery-slide picture,
.color-gallery-slide img {
  display: block;
  width: 100%;
}

/* Gallery arrow buttons (desktop only) */
.gallery-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background .2s, opacity .2s;
}

.gallery-arrow:hover {
  background: #fff;
}

.gallery-arrow.hidden {
  opacity: 0.3;
  pointer-events: none;
}

.gallery-prev {
  left: 8px;
}

.gallery-next {
  right: 8px;
}

/* Show arrows only on desktop */
@media (min-width: 480px) {
  .color-gallery {
    position: relative;
  }
  
  .color-gallery.has-multiple .gallery-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* On desktop, show full slides without peeking */
  .color-gallery.has-multiple .color-gallery-slide {
    flex: 0 0 100%;
  }
}

.color-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.color-gallery-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: background .2s;
}

.color-gallery-dots .dot.active {
  background: #666;
}

.color-details-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  margin: 0;
}

/* Responsive: breder op desktop */
@media (min-width: 480px) {
  .modal {
    width: 480px;
  }
}

.modal-close {
  margin-top: 6px;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--cream);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--near-black);
  color: rgba(255, 255, 255, .6);
  padding: 24px 0;
  font-size: 13px;
  margin-top: 40px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 760px) {
  .product-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  
  .thumbs {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  
  .product-title h1 {
    font-size: 26px;
  }
  
  .description {
    padding-bottom: 40px;
  }
}
