/* ===== CUSTOM PAGE ===== */
.custom-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  padding-top: 70px;
  background: #fff;
  color: #111;
}

/* Gallery - Single image carousel with arrows */
.custom-gallery {
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  background: #ededed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative; /* for arrows */
}

.custom-gallery-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
}

.custom-gallery-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
}

/* Prev / Next arrows */
.custom-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  transition: background 0.2s, transform 0.2s;
  color: #111;
}

.custom-gallery-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.custom-gallery-arrow.prev { left: 16px; }
.custom-gallery-arrow.next { right: 16px; }
.custom-gallery-arrow svg { pointer-events: none; }

/* Dot indicators */
.custom-gallery-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.custom-gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.custom-gallery-dot.active {
  background: #111;
  transform: scale(1.3);
}

/* Lightbox */
.gallery-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s;
}
.gallery-lightbox.open { opacity: 1; visibility: visible; }
.gallery-lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
.gallery-lightbox-close {
  position: absolute; top: 24px; right: 28px;
  color: #fff; font-size: 36px; cursor: pointer;
  background: none; border: none; line-height: 1;
}

/* Form side */
.custom-form {
  padding: 48px 56px 80px;
  display: flex;
  flex-direction: column;
}

.custom-breadcrumb {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: #999;
  letter-spacing: 0.5px;
  margin-bottom: 28px;
  display: flex;
  gap: 6px;
}

.custom-breadcrumb a {
  color: #999;
  text-decoration: none;
  transition: color 0.2s;
}

.custom-breadcrumb a:hover {
  color: #111;
}

.custom-product-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.custom-product-desc {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
}

.custom-product-price {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #111;
  margin-bottom: 8px;
}

.custom-divider {
  height: 1px;
  background: #e5e5e5;
  margin: 24px 0;
}

/* Sections */
.custom-section {
  margin-bottom: 28px;
}

.custom-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 14px;
}

/* Gender buttons */
.custom-gender-btns {
  display: flex;
  gap: 10px;
}

.custom-gender-btn {
  flex: 1;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  padding: 14px 24px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
}

.custom-gender-btn:hover {
  border-color: #111;
  color: #111;
}

.custom-gender-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Carat Weight */
.custom-carat-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.custom-carat-input {
  width: 120px;
  padding: 12px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  border: 1.5px solid #ddd;
  outline: none;
  transition: border-color 0.2s;
}
.custom-carat-input:focus { border-color: #111; }
.custom-carat-unit {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #999;
}

/* Material buttons */
.custom-material-btns, .custom-stone-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.custom-material-btn, .custom-stone-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 12px 24px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: all 0.25s ease;
}

.custom-material-btn:hover, .custom-stone-btn:hover {
  border-color: #111;
  color: #111;
}

.custom-material-btn.active, .custom-stone-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Karat buttons */
.custom-karat-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
  align-items: center;
}

.custom-karat-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 10px 20px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: all 0.25s ease;
}

.custom-karat-btn:hover {
  border-color: #111;
  color: #111;
}

.custom-karat-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.custom-karat-placeholder {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #bbb;
  font-style: italic;
}

/* Ring size select */
.custom-select-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 280px;
}

.custom-select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #111;
  border: 1.5px solid #ddd;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.custom-select:focus {
  border-color: #111;
}

.custom-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #999;
}

/* Engraving */
.custom-engrave-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-engrave-input-row {
  display: flex;
  gap: 10px;
}

.custom-engrave-input {
  flex: 1;
  padding: 12px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  border: 1.5px solid #ddd;
  outline: none;
  transition: border-color 0.2s;
}

.custom-engrave-input:focus {
  border-color: #111;
}

.custom-symbol-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #c00;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-symbol-btn:hover {
  background: #fdfdfd;
  border-color: #111;
  transform: scale(1.05);
}

.custom-font-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-font-btn {
  padding: 6px 12px;
  font-size: 11px;
  border: 1px solid #eee;
  background: #f9f9f9;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-font-btn:hover {
  border-color: #bbb;
}

.custom-font-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.custom-engrave-preview {
  margin-top: 4px;
  height: 60px;
  background: #f0f0f0;
  border: 1px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#engrave-preview-text {
  font-size: 24px;
  color: #333;
  letter-spacing: 1px;
}

/* Summary */
.custom-summary {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: #fafafa;
  border: 1px solid #eee;
}

.custom-summary-line {
  display: flex;
  justify-content: space-between;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #555;
  padding: 6px 0;
}

.custom-summary-line span:first-child {
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}

.custom-summary-line span:last-child {
  font-weight: 500;
  color: #111;
}

/* Add button */
.custom-add-btn {
  width: 100%;
  padding: 18px 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.5px;
  color: #fff;
  background: #111;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  margin-bottom: 16px;
}

.custom-add-btn:hover {
  background: #333;
}

.custom-add-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.custom-back-link {
  display: block;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #999;
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.3px;
}

.custom-back-link:hover {
  color: #111;
}

/* Diamond color swatches */
.custom-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}

.custom-color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.18s;
}

.custom-color-swatch:hover {
  transform: scale(1.1);
}

.swatch-circle {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  transition: box-shadow 0.18s;
}

.swatch-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #888;
  text-transform: uppercase;
  white-space: nowrap;
}

.custom-color-swatch.active .swatch-circle {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111;
}

.custom-color-swatch.active .swatch-label {
  color: #111;
  font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .custom-page {
    grid-template-columns: 1fr;
  }

  .custom-gallery {
    position: relative;
    top: auto;
    height: 100vw;
    gap: 3px;
  }

  /* Hide prev/next arrows on mobile — swipe works instead */
  .custom-gallery-arrow { display: none !important; }

  .custom-form {
    padding: 32px 24px 60px;
  }
}
