/* BeerMe - pack buy box on product pages (design tokens from zzztemp/pack-sans-alcool.html) */

.ps-buybox {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #FFFFFF;
  border: 3px solid #2B1A0E;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 8px 8px 0 #F5B800;
  margin-bottom: 18px;
}

.ps-buybox-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-buybox-label {
  /* Same as the product mockup (zzztemp/pack-sans-alcool.html): these labels
     have no dedicated font and inherit Poppins. */
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7A4A1F;
  /* The theme right-aligns form labels: the buy box labels stay on the left. */
  text-align: left;
}

.ps-buybox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* "First box" is a dropdown (see zzztemp/pack-sans-alcool.html) */
.ps-buybox-select {
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid #2B1A0E;
  border-radius: 8px;
  background: #FFF4DC;
  color: #2B1A0E;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.ps-buybox-select:focus {
  outline: 3px solid #F5B800;
  outline-offset: 1px;
}

.ps-buybox-btn {
  cursor: pointer;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  font-family: 'Poppins', system-ui, sans-serif;
  color: #2B1A0E;
  border: 2px solid #2B1A0E;
  background: #FFF4DC;
}

.ps-buybox-btn.active {
  border: 3px solid #2B1A0E;
  background: #F5B800;
}

.ps-buybox-btn-name {
  font-size: 16px;
  font-weight: 700;
}

.ps-buybox-btn-price {
  font-size: 13px;
}

.ps-buybox-note {
  font-size: 14px;
  color: #5A3A20;
}

/* Bottom row: total price, quantity and add to cart on a single line.
   Width budget at 490 px (the product column): price 171 + quantity 82 +
   button 198 + 2x14 gap = 479. On narrower columns the quantity and the button
   wrap together under the price (see .ps-buybox-buy). */
.ps-buybox-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 2px dashed #E5D2AE;
  padding-top: 16px;
}

.ps-buybox-price {
  font-family: 'Oswald', Impact, sans-serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: #2B1A0E;
}

/* From 1200 px the product column is wide enough to hold the price, the
   quantity and the button on one row: the price is slightly reduced to fit. */
@media (min-width: 1200px) {
  .ps-buybox-price {
    font-size: 38px;
  }
}

.ps-buybox-cta {
  flex: 0 1 auto;
  min-height: 56px;
  padding: 16px 20px;
  border-radius: 8px;
  border: 3px solid #2B1A0E;
  background: #F5B800;
  color: #2B1A0E;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.ps-buybox-cta:hover {
  background: #E3AF01;
}

.ps-buybox-cta:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.ps-buybox-guarantees {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #2B1A0E;
}

/* The native attributes stay in the page (they drive price and availability)
   but the buy box replaces them visually. The class is added by the module JS. */
.ps-buybox-on #main .product-variants,
.ps-buybox-on #main .product-variants-item {
  display: none;
}

/* The buy box carries its own add to cart button: keep the native availability
   and quantity but hide the duplicated button. */
.ps-buybox-on #main .product-add-to-cart .add-to-cart {
  display: none;
}

/* Native quantity ("touchspin") moved left of the button: the value stays in
   #quantity_wanted (the field PrestaShop sends on add to cart), only the look
   of the widget is adapted to the buy box. */
.ps-buybox-footer .ps-buybox-buy {
  display: flex;
  flex: 0 1 auto;
  align-items: stretch;
  gap: 14px;
}

/* The button fills the space left by the price and the quantity. */
.ps-buybox-footer .ps-buybox-buy .ps-buybox-cta {
  flex: 1 1 auto;
}

.ps-buybox-footer .ps-buybox-qty {
  display: flex;
  align-items: stretch;
}

.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin {
  display: flex;
  float: none;
  width: auto;
}

.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin input {
  float: none;
  width: 48px;
  height: 58px;
  padding: 0;
  border: 2px solid #2B1A0E;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #FFF4DC;
  color: #2B1A0E;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin .input-group-btn-vertical {
  display: flex;
  flex-direction: column;
  float: none;
  width: auto;
  border: 2px solid #2B1A0E;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}

.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin .input-group-btn-vertical > .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 50%;
  width: 30px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #FFF4DC;
  color: #2B1A0E;
  line-height: 1;
}

.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin .input-group-btn-vertical > .btn:hover {
  background: #F5B800;
}

.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin .input-group-btn-vertical > .bootstrap-touchspin-down {
  border-top: 2px solid #2B1A0E;
}

.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin .input-group-btn-vertical i {
  position: static;
  top: auto;
  left: auto;
}

.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin .input-group-btn-vertical .touchspin-up::after,
.ps-buybox-footer .ps-buybox-qty .bootstrap-touchspin .input-group-btn-vertical .touchspin-down::after {
  font-size: 11px;
  line-height: 1;
}

/* The native label stays above the native block: hidden, the input keeps its
   own aria-label. */
.ps-buybox-on #main .product-add-to-cart .control-label {
  display: none;
}

@media (max-width: 640px) {
  .ps-buybox {
    padding: 16px;
    box-shadow: 5px 5px 0 #F5B800;
  }

  .ps-buybox-group {
    grid-template-columns: 1fr;
  }
}
