/* Quote cart cards and their three independently priced quantity options. */
#brindemais-quote-items.quote-items {
  gap: 12px;
}

#brindemais-quote-items.quote-items > .quote-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(21, 17, 66, 0.1);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21, 17, 66, 0.055);
}

#brindemais-quote-items.quote-items > .quote-item:first-child {
  border-top: 1px solid rgba(21, 17, 66, 0.1);
}

#brindemais-quote-items .quote-item__thumb {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(21, 17, 66, 0.07);
  border-radius: 12px;
  background: #fbf7f0;
}

#brindemais-quote-items .quote-item__info {
  min-width: 0;
  padding: 2px 38px 0 0;
}

#brindemais-quote-items .quote-item__name {
  overflow: visible;
  color: #151142;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
}

#brindemais-quote-items .quote-item__remove {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}

#brindemais-quote-items .quote-item__remove:hover,
#brindemais-quote-items .quote-item__remove:focus-visible {
  border-color: rgba(232, 81, 46, 0.16);
  background: rgba(232, 81, 46, 0.08);
  color: #e8512e;
}

/* Personalization stays compact until the customer asks to inspect it. */
#brindemais-quote-items .quote-item__custom {
  width: min(100%, 430px);
  margin: 9px 0 0;
  padding: 0;
  color: #151142;
  font-size: 0.76rem;
}

#brindemais-quote-items .quote-item__custom summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(21, 17, 66, 0.09);
  border-radius: 9px;
  background: #fbf7f0;
  color: rgba(21, 17, 66, 0.78);
  font-weight: 700;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

#brindemais-quote-items .quote-item__custom summary::-webkit-details-marker {
  display: none;
}

#brindemais-quote-items .quote-item__custom summary::after {
  width: 6px;
  height: 6px;
  margin-left: 1px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}

#brindemais-quote-items .quote-item__custom[open] summary::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

#brindemais-quote-items .quote-item__custom-count {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(178, 176, 255, 0.24);
  color: #403b83;
  font-size: 0.65rem;
  font-weight: 800;
}

#brindemais-quote-items .quote-item__custom-list {
  display: grid;
  gap: 0;
  margin: 7px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(21, 17, 66, 0.08);
  border-radius: 10px;
  background: #fff;
  list-style: none;
}

#brindemais-quote-items .quote-item__custom-list li {
  display: grid;
  grid-template-columns: minmax(90px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid rgba(21, 17, 66, 0.06);
  line-height: 1.35;
}

#brindemais-quote-items .quote-item__custom-list li:last-child {
  border-bottom: 0;
}

#brindemais-quote-items .quote-item__custom-label {
  color: rgba(21, 17, 66, 0.52);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

#brindemais-quote-items .quote-item__custom-value,
#brindemais-quote-items .quote-item__custom-list a {
  min-width: 0;
  color: #151142;
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

#brindemais-quote-items .quote-item__custom-list a {
  color: #d44727;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Shared quantity panel: full width below product details. */
.quote-item .quote-item__quantities {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  grid-column: 1 / -1;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(21, 17, 66, 0.08);
  border-radius: 12px;
  background: #fbf9f5;
}

.quote-item .quote-item__quantities-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.quote-item .quote-item__quantities-head strong {
  color: #151142;
  font-size: 0.76rem;
  font-weight: 800;
}

.quote-item .quote-item__quantities-head span {
  color: rgba(21, 17, 66, 0.48);
  font-size: 0.67rem;
  font-weight: 600;
  text-align: right;
}

.quote-item .quote-item__qty-option {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr auto;
  gap: 3px 5px;
  color: #151142;
  line-height: 1.2;
}

.quote-item .quote-item__qty-name {
  font-size: 0.7rem;
  font-weight: 800;
}

.quote-item .quote-item__qty-required {
  color: #e8512e;
  font-weight: 800;
}

.quote-item .quote-item__qty-meta {
  color: rgba(21, 17, 66, 0.42);
  font-size: 0.59rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quote-item .quote-item__qty-wrap,
.quote-preview-modal .quote-item__qty-wrap {
  display: flex;
  grid-column: 1 / -1;
  width: 100%;
  height: 38px;
  align-items: center;
  overflow: hidden;
  gap: 0;
  border: 1px solid rgba(21, 17, 66, 0.14);
  border-radius: 9px;
  background: #fff;
  padding: 0;
}

.quote-item .quote-qty-btn,
.quote-preview-modal .quote-qty-btn {
  width: 28px;
  height: 100%;
  flex: 0 0 28px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  color: #151142;
  font-size: 1rem;
}

.quote-item .quote-qty-btn:hover,
.quote-preview-modal .quote-qty-btn:hover {
  background: rgba(232, 81, 46, 0.08);
  color: #e8512e;
}

.quote-item .quote-item__qty,
.quote-preview-modal .quote-item__qty {
  min-width: 0;
  width: 42px;
  height: 100%;
  flex: 1 1 42px;
  border: 0;
  border-right: 1px solid rgba(21, 17, 66, 0.1);
  border-left: 1px solid rgba(21, 17, 66, 0.1);
  border-radius: 0;
  background: #fff;
  padding: 0 3px;
  color: #151142;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  -moz-appearance: textfield;
}

.quote-item .quote-item__qty-feedback {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  color: #e8512e;
  font-size: 0.68rem;
  line-height: 1.35;
}

.quote-item .quote-item__qty-feedback:empty {
  display: none;
}

.quote-item.has-quantity-error .quote-item__quantities {
  border-color: rgba(232, 81, 46, 0.38);
  background: #fff8f5;
}

.quote-item.has-quantity-error .quote-item__qty-wrap {
  border-color: #e8512e;
  box-shadow: 0 0 0 2px rgba(232, 81, 46, 0.08);
}

/* Preview uses the same quantity panel beneath a self-contained product
   header. Keeping the identity row separate prevents long names from being
   squeezed by the quantity-control grid. */
.quote-preview-modal .quote-preview-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.quote-preview-modal .quote-preview-item__product {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.quote-preview-modal .quote-preview-item__name {
  display: block;
  min-width: 0;
  color: #151142;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.quote-preview-modal .quote-item__quantities {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .quote-preview-modal .quote-preview-item > .quote-item__quantities {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quote-preview-modal .quote-item__qty-option,
  .quote-preview-modal .quote-item__qty-wrap {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 520px) {
  #brindemais-quote-items.quote-items > .quote-item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  #brindemais-quote-items .quote-item__thumb {
    width: 52px;
    height: 52px;
  }

  #brindemais-quote-items .quote-item__info {
    padding-right: 30px;
  }

  #brindemais-quote-items .quote-item__remove {
    top: 10px;
    right: 10px;
  }

  .quote-item .quote-item__quantities {
    gap: 6px;
    padding: 10px;
  }

  .quote-item .quote-item__quantities-head {
    display: block;
  }

  .quote-item .quote-item__quantities-head span {
    display: block;
    margin-top: 2px;
    text-align: left;
  }

  .quote-item .quote-qty-btn,
  .quote-preview-modal .quote-qty-btn {
    width: 24px;
    flex-basis: 24px;
  }

  #brindemais-quote-items .quote-item__custom-list li {
    grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1.2fr);
    gap: 8px;
  }
}

/* Mobile cart preview: bottom sheet with a scrollable item area and compact,
   touch-friendly quantity rows. */
@media (max-width: 767px) {
  .quote-preview-modal {
    align-items: flex-end;
    padding: 8px 0 0;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .quote-preview-modal__dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 8px);
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    border-radius: 18px 18px 0 0;
  }

  .quote-preview-modal__header {
    align-items: center;
    gap: 12px;
    padding: 14px 16px 12px;
  }

  .quote-preview-modal__eyebrow {
    margin-bottom: 1px;
    font-size: 0.65rem;
  }

  .quote-preview-modal__header h2 {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .quote-preview-modal__close {
    width: 40px;
    height: 40px;
  }

  .quote-preview-modal__items {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 14px;
  }

  .quote-preview-modal .quote-preview-item {
    width: 100%;
    gap: 10px;
    padding: 14px 0;
  }

  .quote-preview-modal .quote-preview-item__product {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
  }

  .quote-preview-modal .quote-preview-item__thumb {
    width: 56px;
    height: 56px;
  }

  .quote-preview-modal .quote-preview-item__name {
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .quote-preview-modal .quote-preview-item > .quote-item__quantities {
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    flex: 0 0 100%;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 2px;
    padding: 10px;
  }

  .quote-preview-modal .quote-item__quantities-head {
    display: block;
    margin-bottom: 1px;
  }

  .quote-preview-modal .quote-item__quantities-head span {
    display: block;
    margin-top: 2px;
    text-align: left;
  }

  .quote-preview-modal .quote-item__qty-option {
    grid-template-columns: minmax(0, 1fr) minmax(126px, 44%);
    grid-template-rows: auto auto;
    gap: 1px 10px;
    align-items: center;
    min-height: 42px;
  }

  .quote-preview-modal .quote-item__qty-name {
    grid-column: 1;
    grid-row: 1;
  }

  .quote-preview-modal .quote-item__qty-name:nth-last-child(2) {
    grid-row: 1 / span 2;
    align-self: center;
  }

  .quote-preview-modal .quote-item__qty-meta {
    grid-column: 1;
    grid-row: 2;
  }

  .quote-preview-modal .quote-item__qty-wrap {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 100%;
    height: 42px;
    justify-self: stretch;
  }

  .quote-preview-modal .quote-qty-btn {
    width: 34px;
    flex-basis: 34px;
  }

  .quote-preview-modal .quote-item__qty {
    width: 48px;
    flex-basis: 48px;
    padding: 0 2px;
    font-size: 16px;
  }

  .quote-preview-modal__footer {
    flex-direction: column-reverse;
    flex: 0 0 auto;
    gap: 8px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .quote-preview-modal__footer .bm-btn-primary,
  .quote-preview-modal__footer .bm-btn-ghost {
    width: 100%;
    min-height: 44px;
    margin: 0;
    justify-content: center;
  }
}
