/*
 * sp-packaging.css — solo per la tipologia packaging: anteprima 3D/2D,
 * comandi della scatola e misure libere.
 */

/* ========== ANTEPRIMA 3D / 2D ========== */
.sp-product .sp-stage__hint
{
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    z-index: 2;
    text-align: center;
    color: #b4b9bf;
    font-size: 15px;
    letter-spacing: .3px;
    pointer-events: none;
}

.sp-product .sp-stage__view
{
    position: absolute;
    inset: 0;
    z-index: 1;
}

.sp-product .sp-stage__view.is-hidden
{
    visibility: hidden;
    pointer-events: none;
}

.sp-product .sp-stage__view--3d
{
    cursor: grab;
}

.sp-product .sp-stage__view--3d:active
{
    cursor: grabbing;
}

.sp-product .sp-stage__model
{
    display: block;
    width: 100%;
    height: 100%;
    background: white;
}

.sp-product .sp-stage__view--2d
{
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: auto;
}

.sp-product .sp-stage__view--2d > svg
{
    display: block;
    width: auto;
    height: auto;
    max-width: 92%;
    max-height: 92%;
}

/* ========== COMANDI SOPRA L'ANTEPRIMA ========== */
.sp-product .sp-stage__controls
{
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 3;
    display: flex;
    gap: 14px;
    justify-content: flex-start;
    align-items: stretch;
    pointer-events: none;
}

.sp-product .sp-stage-card
{
    padding: 8px 16px 10px;
    background: rgba(255, 255, 255, .55);
    border: 1px solid #dde0e4;
    border-radius: 8px;
    pointer-events: auto;
    backdrop-filter: blur(2px);
}

.sp-product .sp-stage-card--fold
{
    min-width: 230px;
}

.sp-product .sp-motion-btn .sp-motion-btn__off,
.sp-product .sp-motion-btn.is-off .sp-motion-btn__on
{
    display: none;
}

.sp-product .sp-motion-btn.is-off .sp-motion-btn__off
{
    display: block;
}

.sp-product .sp-stage-card__label
{
    font-size: 11px;
    color: var(--sp-color-text-strong);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: .4px;
  font-weight: bold;
}

.sp-product .sp-view-toggle
{
    display: flex;
    gap: 6px;
}

.sp-product .sp-view-toggle__btn
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    padding: 0;
    border: 1px solid #d4d8dd;
    border-radius: 5px;
    background: #fff;
    color: #8b9097;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
}

.sp-product .sp-view-toggle__btn.is-active,
.sp-product .sp-view-toggle__btn:hover
{
    border-color: var(--sp-color-primary);
    color: var(--sp-color-primary);
}

.sp-product .sp-fold-control
{
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-product .sp-fold-control__label
{
    font-size: 11px;
    cursor: pointer;
    user-select: none;
    transition: color .15s;
}

.sp-product .sp-fold-control__label:hover
{
    color: #6b7176;
}

.sp-product .sp-fold-control__label.is-active
{
    color: #2f6fed;
    font-weight: 700;
}



.sp-product .sp-fold-control__range
{
    flex: 1;
    height: 3px;
    accent-color: var(--sp-color-ink-soft);
}

.sp-product.sp-product--packaging .sp-stage
{
  
    height: calc(100vh - 250px)

}

/* ========== AZIONI SOTTO L'ANTEPRIMA ========== */
.sp-product .sp-preview-actions
{
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.sp-product .sp-preview-actions__btn
{
    align-items: center;
  justify-content: center;
  display: flex;

  flex: 0 1 200px;
  gap: clamp(6px, 2vw, 12px);


    height: clamp(40px, 10vw, 46px);
    padding: 0 clamp(20px, 3vw, 20px);
    border: 1.5px solid #444;
    border-radius: 999px;
    background: #fff;

    cursor: pointer;
    font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, color .15s;


}
.sp-product .sp-preview-actions__btn[data-sp-artwork-button]
{
background: var(--sp-color-primary);
    color: var(--sp-color-surface);
    border: 1.5px solid var(--sp-color-primary);
}
.sp-product .sp-preview-actions__btn svg {
    flex-shrink: 0;
    width: clamp(18px, 5vw, 24px);
    height: clamp(18px, 5vw, 24px);
}
.sp-product .sp-preview-actions__btn:hover
{
    border-color: var(--sp-color-accent);
    color: var(--sp-color-accent);
}
.sp-product .sp-preview-actions__btn[data-sp-artwork-button]:hover
{
    border-color: var(--sp-color-accent-dark);
    color: var(--sp-color-surface);
}

/* ========== MISURE ==========
   Tre campi + bottone non stanno nella colonna standard di 6/12: in questa riga
   l'etichetta si stringe e il corpo prende il resto. */
@media (min-width: 760px)
{
    .sp-product .sp-field[data-sp-field="SIZES"] .sp-field__label
    {
        flex: 0 0 26%;
    }

    .sp-product .sp-field[data-sp-field="SIZES"] .sp-field__info
    {
        margin: 0 12px 0 0;
    }

    .sp-product .sp-field[data-sp-field="SIZES"] .sp-field__body
    {
        flex: 1 1 0;
    }
}

/* Le misure si scrivono: qui il campo ha una linea sotto, per vederlo. */
.sp-product .sp-dimension .sp-input-group
{
    border: 1px solid var(--sp-color-line);
  height: 40px;
  padding-left: 10px;
  border-radius: 3px;
}

.sp-product .sp-dimensions
{
    display: flex;
    align-items: flex-end;
}

.sp-product .sp-dimensions .sp-icon-btn
{
    margin-left: 10px;
    display: none;
}

.sp-product .sp-dimensions__grid
{
    display: flex;
    gap: 9px;
}

.sp-product .sp-dimension
{
    display: block;
    flex: 1;
    min-width: 0;
}

.sp-product .sp-dimension__label
{
    display: block;
    font-size: 11px;
    color: var(--sp-color-ink-soft);
    margin-bottom: 3px;
    font-weight: 700;
}

/* ========== MOBILE ========== */
@media (max-width: 759px)
{
    .sp-product.sp-product--packaging .sp-stage
{
  
    height: calc(100vh - 300px);


}

    .sp-product .sp-preview-actions
    {
        flex-wrap: wrap;
  justify-content: center;
  margin-top:0px;
    }
    .sp-product .sp-stage__hint
    {
        display:none;
    }
    .sp-product .sp-stage__controls
    {
        flex-wrap: wrap;
        gap: 8px;
        left: 8px;
        right: 8px;
        bottom: 10px;
        position:initial;
    }

    .sp-product .sp-stage-card
    {
        padding: 6px 12px 8px;
        position:absolute;
        z-index:2;
        top:0;
         left: 7px;
    right: initial;
       
      
    }

    .sp-product .sp-stage-card.sp-stage-card--fold
    {
        min-width: 0;
        flex: 1 1 100%;
        
          bottom: 0px;
           top: initial;
            left: 7px;
    right: 7px;
    
    }

    .sp-product .sp-stage-card.sp-stage-card--motion
    {
left: initial;
right: 7px;
    }

    .sp-product .sp-dimensions__grid
    {
        flex: 1;
        /*flex-direction: column;*/
        gap: 12px;
    }

    .sp-product .sp-dimension
    {
        width: 100%;
        min-width:33.33%;
    }

    .sp-product .sp-dimensions .sp-icon-btn
    {
        margin-left: 0;
        margin-top: 12px;
        align-self: center;
    }
}
