:root {
  --gt-gold: #f2b234;
  --gt-gold-hover: rgba(242, 178, 52, 0.4);
  --gt-dark: #141619;
  --gt-danger: #a94442;
  --gt-border: #e5e5e5;
  --gt-border-dark: #ddd;
  --gt-bg-light: #f5f5f5;
  --gt-bg-white: #fff;
  --gt-bg-offwhite: #fcfcfc;
  --gt-text-main: #333;
  --gt-text-muted: #666;
  --gt-text-light: #888;
  --z-index-lightbox: 10000;
  --z-index-lightbox-close: 10002;
  --z-index-zoom: 100;
}

/* --- Core Utilities --- */
.is-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --- Backdrop & Global Modal Overrides --- */
.modal-backdrop.in {
  opacity: 0.9 !important;
}

#orange-blossom-customization-modal.modal {
  padding: 0 !important;
}

/* Bigger and Higher Contrast Close Button */
.modal-header .close {
  font-size: 4rem;
  opacity: 0.8;
  color: #000;
  font-weight: 700;
  line-height: 0.8;
}

.modal-header .close:hover {
  opacity: 1;
  color: var(--gt-gold);
}

/* --- Main Customization Modal Shell --- */
#orange-blossom-customization-modal .modal-dialog {
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: fixed;
  inset: 0 0 50px 0;
}

#orange-blossom-customization-modal .modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

#orange-blossom-customization-modal .modal-header {
  flex-shrink: 0;
}

#orange-blossom-customization-modal .modal-body {
  flex-grow: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fcfcfc;
  padding: 15px;
}

#orange-blossom-customization-modal .modal-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--gt-border);
  padding: 10px 15px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  gap: 15px;
}

#orange-blossom-customization-modal .modal-footer .btn {
  border: none;
}

#orange-blossom-customization-modal .modal-footer .btn-primary {
  background-color: var(--gt-gold);
  color: var(--gt-dark);
}

#orange-blossom-customization-modal .modal-footer .btn-primary:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* --- Layout Containers --- */
#orange-blossom-customization-modal .customization-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#running-total-container {
  text-align: left;
  flex-grow: 1;
}

#running-total-label {
  font-size: 1.3rem;
  color: #666;
  line-height: 1.3;
  max-width: 300px;
}

#running-total-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
}

#orange-blossom-customization-modal .customization-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- UI Elements --- */
#orange-blossom-customization-modal .step-header {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

#orange-blossom-customization-modal .step-header .step-number {
  color: var(--gt-gold);
  font-size: 1.1em;
  margin-right: 5px;
}

.transition-icon {
  transition: transform 0.3s ease;
}

.section-toggle.collapsed .transition-icon {
  transform: rotate(-90deg);
}

#orange-blossom-customization-modal .info-panel {
  background: #f5f5f5;
  margin: -15px -15px 0;
  padding: 15px;
  border-bottom: 1px solid var(--gt-border);
}

#orange-blossom-customization-modal .panel-header {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gt-border-dark);
}

#orange-blossom-customization-modal .accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#orange-blossom-customization-modal .accordion-item {
  background: white;
  border: 1px solid var(--gt-border-dark);
  border-radius: 8px;
  overflow: hidden;
}

#orange-blossom-customization-modal .accordion-item.active {
  border-color: var(--gt-gold);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
}

#orange-blossom-customization-modal .accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
}

#orange-blossom-customization-modal .accordion-header h4 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

#orange-blossom-customization-modal .accordion-icon {
  font-size: 1.1rem;
  transition: transform 0.3s;
}

#orange-blossom-customization-modal .accordion-item.active .accordion-icon {
  transform: rotate(180deg);
  color: var(--gt-gold);
}

#orange-blossom-customization-modal .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

#orange-blossom-customization-modal .accordion-item.active .accordion-content {
  max-height: 600px;
}

#orange-blossom-customization-modal .accordion-body {
  padding: 15px;
  border-top: 1px solid #f0f0f0;
  font-size: 1.7rem;
  line-height: 1.6;
  color: #444;
}

#orange-blossom-customization-modal .accordion-body ul {
  padding-left: 20px;
  margin: 10px 0 0 0;
  list-style: disc;
}

#orange-blossom-customization-modal .accordion-body li {
  margin-bottom: 12px;
}

#orange-blossom-customization-modal .accordion-body li strong {
  font-weight: 800;
}

#orange-blossom-customization-modal .accordion-body hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 10px 0;
}

#orange-blossom-customization-modal .accordion-body .note {
  font-size: 1.3rem;
  color: #666;
  margin-top: 15px;
}

/* === SELECTED NECK DISPLAY & ZOOM === */
#selected-neck-display-container {
  display: none; /* Hidden on mobile by default */
  position: relative;
  width: 100%;
  height: 600px;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

#selected-neck-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: none;
}

#selected-neck-image {
  width: 100%;
  height: 100% !important;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease-in-out;
  opacity: 1;
  display: block; /* Ensure it behaves well in the flex container */
}

#selected-neck-image.fade-out {
  opacity: 0;
}

#zoom-lens {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 2px solid var(--gt-gold);
  border-radius: 8px;
  overflow: hidden;
  pointer-events: none;
  display: none;
  z-index: var(--z-index-zoom);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  background: #fff;
}

#zoom-lens-img {
  position: absolute;
  transform-origin: center;
  max-width: none;
  width: auto;
  height: auto;
  display: block;
}

/* === SHIMMER ANIMATION === */
@keyframes goldShimmer {
  0% {
    transform: translateX(-100%) skewX(-15deg);
  }
  100% {
    transform: translateX(100%) skewX(-15deg);
  }
}

.shimmer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(166, 124, 0, 0.3) 20%,
    rgba(255, 255, 255, 1) 50%,
    rgba(166, 124, 0, 0.3) 80%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  z-index: 50;
  display: none;
}

#selected-neck-wrapper.shimmering .shimmer-overlay {
  display: block;
  animation: goldShimmer 0.5s ease-in-out;
}

/* Visibility rules for status chips */
.component-card.selected .variation-status {
  visibility: visible;
}

/* === NECK GRID STYLES === */
#neck-group .neck-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#neck-group .neck {
  flex-direction: column;
  display: flex;
  flex-grow: 1;
  cursor: pointer;
  border: 2px solid var(--gt-border);
  border-radius: 50px;
  transition: all 0.2s ease-in-out;
  overflow: hidden;
  background-color: #fff;
}

#neck-group .neck.selected {
  border-color: var(--gt-gold);
  box-shadow: 0 0 10px rgba(242, 178, 52, 0.4);
}

#neck-group .neck-bg {
  overflow: hidden;
}

#neck-group .neck-image {
  display: flex;
  justify-content: center;
  position: relative; /* important for absolute positioning the view button */
}

#neck-group .neck-image img {
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    border 0.3s ease-out,
    box-shadow 0.3s ease-out;
  transform-origin: center;
  transform: scale(1);
  border: 2px solid transparent;
  box-shadow: none;
  margin: -140px 0; /* Creates the crop effect */
  width: 90%;
  filter: drop-shadow(5px 7px 5px rgba(0, 0, 0, 0.6));
}

#neck-group .neck-image.selected img {
  filter: drop-shadow(5px 7px 5px var(--gt-gold));
  transform: scale(1.03);
}

#neck-group .view-photos-btn {
  background: rgba(20, 22, 25, 0.85);
  color: var(--gt-gold) !important;
  border: 1px solid var(--gt-gold);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 1.2rem;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#neck-group .view-photos-btn:hover {
  background: var(--gt-gold);
  color: var(--gt-dark) !important;
}

#neck-group .neck-info {
  background-color: var(--gt-dark);
  padding: 1rem 3rem 1.5rem;
  border-bottom-right-radius: 46px; /* Matches outer border-radius */
  border-bottom-left-radius: 46px;
}

#neck-group .neck-title {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

#neck-group .neck-name {
  color: var(--gt-gold);
  font-size: 2rem;
}
#neck-group .neck-price {
  display: none !important;
}

#neck-group .neck-subtitle {
  color: white;
  font-size: 1.5rem;
}
.neck-status-message {
  color: var(--gt-danger);
  font-weight: bold;
  font-size: 1.5rem;
  margin-top: 5px;
  display: none;
}

/* === GENERIC COMPONENT CARDS (Rims, Tone Rings, etc.) === */
.component-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  align-items: stretch;
}

.component-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 2px solid var(--gt-border-dark);
  border-radius: 12px;
  transition: all 0.2s ease-in-out;
  background: #fff;
  overflow: hidden;
  height: auto; /* Let it be auto height */
}

.component-card.selected {
  border-color: var(--gt-gold);
  box-shadow: 0 0 10px rgba(242, 178, 52, 0.4);
}

.component-card input[type="checkbox"],
.component-card input[type="radio"] {
  display: none;
}

.component-image {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: #fff;
  min-height: 100px;
}

.component-image img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.component-card.selected .component-image img {
  transform: scale(1.1);
}

.component-info {
  background-color: var(--gt-dark);
  padding: 1rem 1.2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.component-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.component-name {
  color: var(--gt-gold);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.component-description {
  color: #999;
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: normal;
}

.component-price {
  color: var(--gt-gold);
  font-size: 1.3rem;
  font-weight: 500;
  white-space: nowrap;
}

.component-card .variation-status {
  padding: 3px 8px;
  background: var(--gt-gold);
  color: var(--gt-dark);
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: auto;
  align-self: flex-start;
  visibility: hidden;
}

.component-card.selected .variation-status {
  visibility: visible;
}

/* === LIGHTBOX STYLES === */
.ob-lightbox {
  position: fixed;
  z-index: var(--z-index-lightbox); /* Must be higher than Bootstrap Modal (1050) */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);

  /* Hidden state */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;

  /* Smooth fade */
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;

  display: flex;
  justify-content: center;
  align-items: center;
}

.ob-lightbox.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.ob-lightbox-content {
  display: none; /* JS handles the clone */
}

.ob-lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: var(--z-index-lightbox-close);
  line-height: 1;
}

.ob-lightbox-close:hover {
  color: var(--gt-gold);
}

/* === HELP MODAL LAYOUTS === */
.gt-help-modal {
  overflow-y: auto !important;
}

.gt-help-modal .modal-content {
  height: auto;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gt-help-modal .modal-body {
  overflow-y: auto;
  flex-grow: 1;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}

.help-item {
  margin-bottom: 25px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

.help-item:last-child {
  border-bottom: none;
}

.help-img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

.help-text h4 {
  margin-top: 0;
  color: var(--gt-danger);
  font-weight: 700;
}

/* === MOBILE OVERRIDES === */
@media (max-width: 991px) {
  #orange-blossom-customization-modal .info-panel {
    display: none;
  }
}

/* === DESKTOP LAYOUT (992px+) === */
@media (min-width: 992px) {
  #orange-blossom-customization-modal .modal-dialog {
    width: 900px;
    margin: 40px auto;
    position: relative;
    inset: auto;
  }

  #orange-blossom-customization-modal .modal-content {
    border-radius: 12px;
    height: 85vh;
  }

  #orange-blossom-customization-modal .modal-body {
    padding: 25px;
    overflow: hidden;
  }

  #orange-blossom-customization-modal .customization-container {
    flex-direction: row;
    height: 100%;
    gap: 30px;
  }

  #orange-blossom-customization-modal .info-panel {
    flex: 1;
    max-width: 45%;
    overflow-y: auto;
    margin: -25px 0 -25px -25px;
    padding: 25px;
    border: 1px solid var(--gt-border);
    border-radius: 12px 0 0 12px;
    display: block !important;
  }

  #selected-neck-display-container {
    display: flex !important;
  }

  #orange-blossom-customization-modal .customization-options {
    flex: 1;
    max-width: 65%;
    overflow-y: auto;
    padding: 10px 10px;
    gap: 25px;
  }

  /* Desktop specific text adjustments */
  #running-total-label {
    font-size: 1.4rem;
  }
  #running-total-price {
    font-size: 2.2rem;
  }
  #orange-blossom-customization-modal .panel-header {
    font-size: 1.5rem;
  }
  #orange-blossom-customization-modal .step-header {
    font-size: 1.4em;
  }

  .component-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px;
  }
}

/* Standard Bootstrap Modal Center (Desktop) */
@media (min-width: 768px) {
  .modal.fade.in {
    display: flex !important;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.85) !important;
  }

  .modal-dialog {
    margin: auto;
    width: 600px;
    max-height: 90vh;
  }

  #orange-blossom-customization-modal .modal-dialog {
    width: 900px;
  }
}
