/* ===================================================
   ROOT / LAYOUT
=================================================== */

.clc-configurator-root {
  max-width: 1400px;
  margin: 40px auto;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI,
    Roboto, Helvetica Neue, Arial, sans-serif;
}

.hm-configurator {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===================================================
   MODEL VIEWER
=================================================== */

.hm-viewer {
  position: relative;
}

.hm-viewer model-viewer {
  width: 100%;
  height: 700px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fafafa, #e2e2e2);
  border: 1px solid #dcdcdc;
}

/* ===================================================
   SIDEBAR
=================================================== */

.hm-side {
  position: sticky;
  top: 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 25px 25px 25px 35px;

  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e6e8ea;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);

  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

/* ===================================================
   GROUPS / TITLES
=================================================== */

.hm-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hm-title {
  font-size: 16px;
  font-weight: 600;
  color: #0c0d0e;
}

/* ===================================================
   OPTIONS CONTAINER
=================================================== */

.hm-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

/* ===================================================
   BASE OPTION (TEXT BUTTON — DEFAULT)
   - Always renders as an outlined tile (never a filled pill)
   - Active state uses outline + checkmark (matches thumb tiles)
=================================================== */

.hm-option {
  position: relative;

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

  padding: 10px 16px;
  min-height: 44px;

  background: #ffffff;
  color: #0c0d0e;

  font-size: 14px;
  font-weight: 500;

  border: 1px solid #d2d2d7;
  border-radius: 8px;

  cursor: pointer;
  user-select: none;

  transition: background 0.15s ease,
    border-color 0.15s ease;
}

.hm-option:hover {
  background: #f1f2f3;
}

/* Active = outlined with check (no fill) */
.hm-option.active {
  background: #ffffff;
  color: #0c0d0e;
  border: 2px solid #0c0d0e;
}

/* Check indicator */
.hm-option.active::after {
  content: "✓";
  position: absolute;
  top: -8px;
  right: -8px;

  width: 20px;
  height: 20px;

  border-radius: 50%;
  background: #0c0d0e;
  color: #ffffff;

  font-size: 12px;
  font-weight: 600;

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

  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* ===================================================
   THUMBNAIL-AWARE OPTION
   (Activated purely by structure — if .hm-option-thumb exists)
=================================================== */

.hm-option.has-thumb {
  flex-direction: column;
  gap: 8px;

  padding: 10px;
  width: 110px;
  min-height: 110px;

  background: #ffffff;
}

/* ===================================================
   THUMBNAIL
=================================================== */

.hm-option-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: #e6e8ea;
  border: 1px solid #d5d8dc;

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

  overflow: hidden;
  flex-shrink: 0;
}

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

/* ===================================================
   LABEL
=================================================== */

.hm-option-label {
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  color: inherit;
}


/* ===================================================
   PRICE BAR
=================================================== */

.clc-price-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.clc-price-value {
  font-size: 22px;
  font-weight: 600;
  color: #0c0d0e;
}

/* ===================================================
   LOADING OVERLAY
=================================================== */

.clc-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  z-index: 5;
}

.clc-loading-inner {
  font: 14px/1.4 sans-serif;
  color: #444;
  text-align: center;
}

.clc-loading-inner span {
  font-size: 12px;
}

/* ===================================================
   MOBILE
=================================================== */

@media (max-width: 900px) {
  .hm-configurator {
    grid-template-columns: 1fr;
  }

  .hm-side {
    position: relative;
    top: 0;
    max-height: none;
  }
}