/* Téesse – Coffret UI v1.0 */

.teesse-coffret-ui input[type="number"][data-teesse-qty-enhanced="1"]{
  -moz-appearance:textfield !important;
  appearance:textfield !important;
  width:42px !important;
  min-width:42px !important;
  max-width:42px !important;
  height:38px !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-left:1px solid rgba(16,36,67,.18) !important;
  border-right:1px solid rgba(16,36,67,.18) !important;
  border-radius:0 !important;
  background:#fff !important;
  color:#102443 !important;
  text-align:center !important;
  font-size:15px !important;
  font-weight:700 !important;
  line-height:38px !important;
  box-shadow:none !important;
}

.teesse-coffret-ui input[type="number"][data-teesse-qty-enhanced="1"]::-webkit-inner-spin-button,
.teesse-coffret-ui input[type="number"][data-teesse-qty-enhanced="1"]::-webkit-outer-spin-button{
  -webkit-appearance:none !important;
  margin:0 !important;
}

.teesse-coffret-ui .teesse-coffret-qty{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 auto !important;
  width:120px !important;
  min-width:120px !important;
  max-width:120px !important;
  height:40px !important;
  margin:8px 0 0 auto !important;
  border:1px solid rgba(208,164,83,.55) !important;
  border-radius:9px !important;
  overflow:hidden !important;
  background:#fff !important;
  box-sizing:border-box !important;
  position:relative !important;
  z-index:3 !important;
}

.teesse-coffret-ui .teesse-coffret-qty-btn{
  appearance:none !important;
  -webkit-appearance:none !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 38px !important;
  width:38px !important;
  min-width:38px !important;
  max-width:38px !important;
  height:38px !important;
  min-height:38px !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:#f4ead5 !important;
  color:#102443 !important;
  font-size:24px !important;
  font-weight:700 !important;
  line-height:1 !important;
  cursor:pointer !important;
  box-shadow:none !important;
}

.teesse-coffret-ui .teesse-coffret-qty-btn:hover,
.teesse-coffret-ui .teesse-coffret-qty-btn:focus-visible{
  background:#d4a653 !important;
  color:#061326 !important;
  outline:2px solid rgba(255,255,255,.8) !important;
  outline-offset:-3px !important;
}

/* Le bloc quantité doit rester DANS sa carte et ne plus déborder à droite. */
.teesse-coffret-ui .teesse-coffret-qty{
  clear:both !important;
}

/* Sélection des brûle-parfums : visible sur ordinateur comme sur mobile. */
.teesse-coffret-ui .teesse-coffret-choice{
  position:relative !important;
  cursor:pointer !important;
  border:2px solid transparent !important;
  border-radius:12px !important;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease !important;
}

.teesse-coffret-ui .teesse-coffret-choice-selected{
  border-color:#d4a653 !important;
  background:rgba(212,166,83,.11) !important;
  box-shadow:0 0 0 3px rgba(212,166,83,.22) !important;
}

.teesse-coffret-ui .teesse-coffret-choice-selected::after{
  content:'✓' !important;
  position:absolute !important;
  top:8px !important;
  right:8px !important;
  width:28px !important;
  height:28px !important;
  border-radius:50% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:#d4a653 !important;
  color:#08172b !important;
  font-size:18px !important;
  font-weight:900 !important;
  line-height:1 !important;
  z-index:5 !important;
  box-shadow:0 2px 8px rgba(0,0,0,.25) !important;
}

.teesse-coffret-ui .teesse-coffret-choice input[type="radio"]{
  accent-color:#d4a653 !important;
}

@media (max-width: 767px){
  .teesse-coffret-ui .teesse-coffret-qty{
    width:132px !important;
    min-width:132px !important;
    max-width:132px !important;
    height:44px !important;
    margin-top:10px !important;
  }
  .teesse-coffret-ui .teesse-coffret-qty-btn{
    flex-basis:44px !important;
    width:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    height:42px !important;
    min-height:42px !important;
    font-size:26px !important;
  }
  .teesse-coffret-ui input[type="number"][data-teesse-qty-enhanced="1"]{
    width:42px !important;
    min-width:42px !important;
    max-width:42px !important;
    height:42px !important;
    line-height:42px !important;
    font-size:16px !important;
  }
}


/* v1.1 - ordinateur : le compteur passe SOUS l'image et le nom, sans recouvrement. */
@media (min-width: 768px){
  .teesse-coffret-ui .ts-fondant-row{
    display:grid !important;
    grid-template-columns:54px minmax(0,1fr) !important;
    grid-template-areas:
      "fondant-image fondant-name"
      "fondant-qty fondant-qty" !important;
    column-gap:8px !important;
    row-gap:10px !important;
    align-items:center !important;
    overflow:hidden !important;
  }

  .teesse-coffret-ui .ts-fondant-row > img{
    grid-area:fondant-image !important;
    margin:0 !important;
  }

  .teesse-coffret-ui .ts-fondant-row > .ts-fondant-name{
    grid-area:fondant-name !important;
    min-width:0 !important;
    width:auto !important;
    overflow-wrap:anywhere !important;
  }

  .teesse-coffret-ui .ts-fondant-row > .teesse-coffret-qty{
    grid-area:fondant-qty !important;
    justify-self:center !important;
    width:120px !important;
    min-width:120px !important;
    max-width:120px !important;
    margin:0 !important;
  }
}

/* v1.1 - mobile : conserver la présentation qui fonctionnait déjà. */
@media (max-width: 767px){
  .teesse-coffret-ui .ts-fondant-row{
    overflow:visible !important;
  }
  .teesse-coffret-ui .ts-fondant-row > .teesse-coffret-qty{
    margin-left:auto !important;
  }
}


/* v1.2 - mobile : forcer exactement la même composition sur les 2 coffrets.
   Cela neutralise les anciennes règles propres au coffret classique. */
@media (max-width: 767px){

  .teesse-coffret-ui .ts-choice-grid{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
  }

  .teesse-coffret-ui .ts-choice{
    width:100% !important;
    min-width:0 !important;
  }

  .teesse-coffret-ui .ts-card{
    display:grid !important;
    grid-template-columns:82px minmax(0,1fr) !important;
    gap:10px !important;
    align-items:center !important;
    width:100% !important;
    box-sizing:border-box !important;
  }

  .teesse-coffret-ui .ts-card img{
    width:82px !important;
    height:82px !important;
    aspect-ratio:1/1 !important;
    object-fit:cover !important;
    margin:0 !important;
  }

  .teesse-coffret-ui .ts-fondants{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
  }

  .teesse-coffret-ui .ts-fondant-row{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    gap:8px !important;
    width:100% !important;
    min-width:0 !important;
    padding:10px !important;
    box-sizing:border-box !important;
    overflow:visible !important;
  }

  .teesse-coffret-ui .ts-fondant-row > img{
    width:54px !important;
    height:54px !important;
    flex:0 0 54px !important;
    object-fit:cover !important;
    margin:0 !important;
  }

  .teesse-coffret-ui .ts-fondant-row > .ts-fondant-name{
    flex:1 1 auto !important;
    min-width:0 !important;
    width:auto !important;
    margin:0 !important;
    line-height:1.2 !important;
    overflow-wrap:anywhere !important;
  }

  .teesse-coffret-ui .ts-fondant-row > .teesse-coffret-qty{
    flex:0 0 132px !important;
    width:132px !important;
    min-width:132px !important;
    max-width:132px !important;
    margin:0 0 0 auto !important;
    align-self:center !important;
  }
}

/* Très petits écrans : le sélecteur descend proprement sous le nom au lieu d'écraser la photo. */
@media (max-width: 380px){
  .teesse-coffret-ui .ts-fondant-row{
    display:grid !important;
    grid-template-columns:54px minmax(0,1fr) !important;
    grid-template-areas:
      "fondant-image fondant-name"
      "fondant-qty fondant-qty" !important;
    row-gap:8px !important;
  }

  .teesse-coffret-ui .ts-fondant-row > img{
    grid-area:fondant-image !important;
  }

  .teesse-coffret-ui .ts-fondant-row > .ts-fondant-name{
    grid-area:fondant-name !important;
  }

  .teesse-coffret-ui .ts-fondant-row > .teesse-coffret-qty{
    grid-area:fondant-qty !important;
    justify-self:end !important;
    margin:0 !important;
  }
}
