
/* Helmet Builder minimal styles (standalone) */

body{
  margin:0;
  background: #111111;
  color:#eee;
}

.wrapper{
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

h1{
  margin: 0 0 18px;
  font-size: 32px;
  font-weight: 700;
}

.builder{
  display:flex;
  gap: 30px;
  align-items:flex-start;
}

.left{
  width: 560px;
}

#helmetStage{
  width: 520px;
  height: 540px;
  position: relative;
  background:#111111;
  border-radius: 6px;
  overflow:hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset;
}

.stage-layer{
  position:absolute;
  left:0;
  top:0;
  width: 520px;
  height: 540px;
  object-fit: contain;
  pointer-events:none;
}

.actions{
  display:flex;
  gap: 10px;
  align-items:center;
  margin: 14px 0 10px;
}

.actions button{
  background:#6b0f13;
  color:#fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 12px;
  border-radius: 18px;
  cursor:pointer;
  font-weight: 700;
}

.actions .meta{
  margin-left: 10px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
}

#controls{
  margin-top: 10px;
}

.control-row{
  display:grid;
  /* Keep each row's thumbnail close to the arrows (avoid the old 1fr "push to far right" behavior) */
  /* label | lock | left | 3-thumbs viewport | right */
  grid-template-columns: 150px 40px 44px 222px 44px;
  gap: 12px;
  align-items:center;
  margin: 10px 0;
}

/* Make sure the right arrow stays to the far right of its column (prevents overlap on tighter viewports) */
.control-row .control-btn.next-btn{ justify-self:end; }

.control-label{
  color:#fff;
  font-weight:700;
  font-size: 14px;
}

.control-btn{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color:#fff;
  cursor:pointer;
  font-size: 16px;
}

.thumb-viewport{
  overflow:hidden;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.35);
  height: 78px;
  /* Show 3 thumbnails per row (selected stays centered via JS scrollIntoView) */
  width: 222px;
  justify-self: start;
}

.thumb-strip{
  display:flex;
  gap: 6px;
  padding: 6px;
  overflow-x:auto;
  scroll-behavior:smooth;
  scrollbar-width: thin;
}

.thumb-frame{
  width: 66px;
  height: 66px;
  background:#333333;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor:pointer;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.thumb-frame.active{
  border-color: #ff6a00;
}

.thumb-frame:focus-visible{
  outline: none;
  border-color: #ff6a00;
}

.thumb{
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events:none;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(1);
}

.right{
  flex:1;
  min-width: 280px;
}

@media (max-width: 980px){
  .builder{flex-direction:column;}
  .left{width:auto;}
}


/* Helmet builder: show selected item under each category */
.current-name{font-weight:400;font-size:12px;color:rgba(255,255,255,0.65);margin-top:4px;}
.control-label{display:flex;flex-direction:column;gap:4px;}


/* Lock button */
.lock-btn{
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  align-self: center;
}
.lock-btn.locked{
  border-color: #ff6a00;
  box-shadow: 0 0 0 2px rgba(255,106,0,0.55);
}
.lock-btn:hover{
  border-color: rgba(255,255,255,0.55);
}


/* Optional: cleaner horizontal scrollbar for WebKit */
.thumb-strip::-webkit-scrollbar{height:8px;}
.thumb-strip::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.18);border-radius:10px;}


/* ===== Responsive overrides for the live helmet builder ===== */

#helmetStage {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#controls {
  max-width: 520px;
  margin: 10px auto 0;
}

@media (max-width: 760px){
  .actions{
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .actions .meta{
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  #controls{
    max-width: 100%;
  }

  .control-row{
    grid-template-columns: 118px 34px 38px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .control-label{
    font-size: 12px;
  }

  .current-name{
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .control-btn{
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .lock-btn{
    width: 32px;
    height: 28px;
  }

  .thumb-viewport{
    width: 100%;
    min-width: 0;
    height: 72px;
  }

  .thumb-strip{
    padding: 5px;
  }

  .thumb{
    width: 60px;
    height: 60px;
    border-radius: 9px;
  }
}

@media (max-width: 560px){
  #helmetStage{
    width: 100%;
    height: auto;
    aspect-ratio: 52 / 54;
    padding: 0.75rem;
    border-radius: 14px;
  }

  .stage-layer{
    width: 100%;
    height: 100%;
  }

  .actions{
    margin: 12px 0 8px;
  }

  .actions button{
    padding: 8px 10px;
    border-radius: 16px;
    font-size: 14px;
  }

  .control-row{
    grid-template-columns: 1fr 32px 34px minmax(0, 1fr) 34px;
    gap: 6px;
    margin: 8px 0;
  }

  .control-label{
    min-width: 0;
  }

  .lock-btn{
    width: 30px;
    height: 26px;
    font-size: 13px;
  }

  .control-btn{
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 13px;
  }

  .thumb-viewport{
    height: 64px;
    border-radius: 9px;
  }

  .thumb-strip{
    gap: 5px;
    padding: 4px;
  }

  .thumb{
    width: 54px;
    height: 54px;
    border-radius: 8px;
  }
}

@media (max-width: 420px){
  .control-row{
    grid-template-columns: 92px 28px 30px minmax(0, 1fr) 30px;
    gap: 5px;
  }

  .control-label{
    font-size: 11px;
  }

  .current-name{
    font-size: 10px;
  }

  .lock-btn{
    width: 26px;
    height: 24px;
    font-size: 11px;
  }

  .control-btn{
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .thumb-viewport{
    height: 58px;
  }

  .thumb{
    width: 48px;
    height: 48px;
  }
}


/* Zoomed thumbnail behavior */
.thumb-decal {
   transform: translate(-50%, -50%) scale(5.0) translate(10%, 28%);
}

.thumb-stripe {
  transform: translate(-50%, -50%) scale(5.0) translate(-30%, 20%);
}

.thumb-shell {
   transform: translate(-50%, -50%) scale(2.0) translate(10%, 20%);
}

.thumb-facemask {
  transform: translate(-50%, -50%) scale(7.0) translate(-8%, -2%);
}

.thumb-bumper {
  transform: translate(-50%, -50%) scale(16.0) translate(-31%, 0%);
}

.thumb-chinstrap {
  transform: translate(-50%, -50%) scale(10.0) translate(6%, -10%);
}

.thumb-pad {
  transform: translate(-50%, -50%) scale(12.0) translate(-14%, -20%);
}



/* ===== Stronger button styling (always-visible orange outline) ===== */
.actions button,
.control-btn,
.lock-btn {
  border: 1px solid rgba(255, 71, 0, 0.55);
  background: rgba(255,255,255,0.03);
  color: #ffffff;
  font-weight: 600;
}

/* Hover = slightly stronger */
.actions button:hover,
.control-btn:hover,
.lock-btn:hover {
  border-color: rgba(255, 71, 0, 0.8);
  background: rgba(255, 71, 0, 0.12);
}

/* Active click = filled orange */
.actions button:active,
.control-btn:active,
.lock-btn:active {
  background: var(--orange);
  color: #000;
  border-color: var(--orange);
  transform: scale(0.97);
}

/* Locked state stays emphasized */
.lock-btn.locked {
  background: rgba(255, 71, 0, 0.18);
  border-color: var(--orange);
}

@media (max-width: 560px){
  .thumb-frame{
    width: 54px;
    height: 54px;
    border-radius: 8px;
  }

  .thumb-viewport{
    height: 62px;
  }

  .thumb-strip{
    align-items: center;
  }
}

@media (max-width: 420px){
  .thumb-frame{
    width: 48px;
    height: 48px;
    border-radius: 7px;
  }

  .thumb-viewport{
    height: 56px;
  }
}
