/* ================================================================
   BIGPIRES — CARRINHO · CHECKOUT · CONTA
   catalog/view/stylesheet/bigpires-checkout.css
   ================================================================ */

/* ================================================================
   1. TOKENS & RESET COMUM
   ================================================================ */

[id^="checkout-"],
[id^="account-"] {
  font-family: 'Palanquin', sans-serif;
  padding-top: 40px;
  padding-bottom: 72px;
}

/* Headings H1 */
[id^="checkout-"] h1,
[id^="account-"] h1 {
  font-family: 'Palanquin', sans-serif;
  color: #6b4fa0;
  font-weight: 400;
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* Headings H2 */
[id^="checkout-"] h2,
[id^="account-"] h2 {
  font-family: 'Palanquin', sans-serif;
  color: #6b4fa0;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

/* Breadcrumb discreto */
[id^="checkout-"] .breadcrumb,
[id^="account-"] .breadcrumb {
  justify-content: center;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

[id^="checkout-"] .breadcrumb-item a,
[id^="account-"] .breadcrumb-item a {
  color: #6b4fa0;
}

/* ── Botão primário — roxo BigPires ── */
[id^="checkout-"] .btn-primary,
[id^="account-"] .btn-primary {
  background-color: #6b4fa0 !important;
  border-color: #6b4fa0 !important;
  font-family: 'Palanquin', sans-serif;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.55rem 1.5rem;
}

[id^="checkout-"] .btn-primary:hover,
[id^="account-"] .btn-primary:hover {
  background-color: #4e3580 !important;
  border-color: #4e3580 !important;
}

/* ── Inputs e selects ── */
[id^="checkout-"] .form-control,
[id^="checkout-"] .form-select,
[id^="account-"] .form-control,
[id^="account-"] .form-select {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.92rem;
  border: none;
  border-bottom: 1px solid #ccc;
  border-radius: 0;
  padding: 0.5rem 0;
  background-color: transparent;
  outline: none;
  box-shadow: none !important;
  transition: border-color 0.2s;
}

[id^="checkout-"] .form-control:focus,
[id^="checkout-"] .form-select:focus,
[id^="account-"] .form-control:focus,
[id^="account-"] .form-select:focus {
  border-bottom-color: #6b4fa0;
  background-color: transparent;
}

[id^="checkout-"] .col-form-label,
[id^="account-"] .col-form-label {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.85rem;
  color: #39323D;
  font-weight: 500;
}

/* ── Fieldset/Legend ── */
[id^="checkout-"] fieldset,
[id^="account-"] fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

[id^="checkout-"] legend,
[id^="account-"] legend {
  font-family: 'Palanquin', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #6b4fa0;
  padding: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid #ede8f5;
  width: 100%;
  padding-bottom: 0.5rem;
}

/* ── Cards com borda ── */
[id^="account-"] .border.rounded,
[id^="checkout-"] .border.rounded {
  border-color: #ddd5ee !important;
  border-radius: 12px !important;
}

/* ================================================================
   2. MINI-CARRINHO DROPDOWN (#cart)
   ================================================================ */

.bp-minicart {
  min-width: 380px;
  max-width: 420px;
  border: 1px solid #ddd5ee !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(107, 79, 160, 0.14) !important;
  padding: 16px !important;
}

.bp-minicart__products {
  display: flex;
  flex-direction: column;
}

.bp-minicart__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f0eafa;
}

.bp-minicart__item:last-child {
  border-bottom: none;
}

.bp-minicart__img {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
}

.bp-minicart__img img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #f0f0f0;
  display: block;
}

.bp-minicart__info {
  flex: 1;
  min-width: 0;
}

.bp-minicart__name {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #39323D;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-minicart__name:hover {
  color: #6b4fa0;
  text-decoration: none;
}

.bp-minicart__option {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
}

.bp-minicart__qty {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.8rem;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.bp-minicart__price {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #39323D;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}

.bp-minicart__remove {
  flex-shrink: 0;
}

.bp-minicart__remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  color: #999;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.bp-minicart__remove-btn:hover {
  background: #fdecea;
  color: #c62828;
}

/* Totais */
.bp-minicart__totals {
  margin-top: 14px;
  border-top: 1px solid #ede8f5;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.bp-minicart__total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Palanquin', sans-serif;
}

.bp-minicart__total-label {
  font-size: 0.85rem;
  color: #555;
  font-weight: 500;
}

.bp-minicart__total-val {
  font-size: 0.88rem;
  color: #39323D;
  font-weight: 500;
}

.bp-minicart__total-row--last .bp-minicart__total-label {
  font-weight: 700;
  color: #39323D;
}

.bp-minicart__total-row--last .bp-minicart__total-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #6b4fa0;
}

/* Acções */
.bp-minicart__actions {
  display: flex;
  gap: 10px;
  border-top: 1px solid #ede8f5;
  padding-top: 14px;
}

.bp-minicart__btn-cart,
.bp-minicart__btn-checkout {
  flex: 1;
  text-align: center;
  font-family: 'Palanquin', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.bp-minicart__btn-cart {
  color: #6b4fa0;
  border: 1px solid #6b4fa0;
  background: transparent;
}

.bp-minicart__btn-cart:hover {
  background: #6b4fa0;
  color: #fff;
  text-decoration: none;
}

.bp-minicart__btn-checkout {
  color: #fff;
  background: #6b4fa0;
  border: 1px solid #6b4fa0;
}

.bp-minicart__btn-checkout:hover {
  background: #4e3580;
  border-color: #4e3580;
  color: #fff;
  text-decoration: none;
}

.bp-minicart__empty {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.9rem;
  color: #888;
  text-align: center;
  padding: 24px 0 8px;
}

/* ================================================================
   3. CARRINHO (#checkout-cart)
   ================================================================ */

/* Layout: tabela + sidebar */
.bp-cart__heading {
  font-family: 'Palanquin', sans-serif;
  color: #6b4fa0;
  font-weight: 400;
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 2rem;
}

.bp-cart__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

/* ── Card da tabela ── */
.bp-cart__card {
  border: 1px solid #ddd5ee;
  border-radius: 12px;
  overflow: hidden;
}

.bp-cart__table-wrap {
  overflow-x: auto;
}

.bp-cart__table {
  width: 100%;
  border-collapse: collapse;
}

/* Headers */
.bp-cart__th {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b4fa0;
  padding: 14px 16px;
  border-bottom: 1px solid #ede8f5;
  text-transform: none;
  white-space: nowrap;
}

.bp-cart__th--remove { width: 72px; text-align: center; }
.bp-cart__th--image  { width: 90px; text-align: center; }

/* Linhas */
.bp-cart__row td {
  padding: 16px;
  border-bottom: 1px solid #f5f3fa;
  vertical-align: middle;
  font-family: 'Palanquin', sans-serif;
  font-size: 0.92rem;
  color: #39323D;
}

.bp-cart__row:last-child td {
  border-bottom: none;
}

/* Remover */
.bp-cart__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 1.2rem;
  line-height: 1;
  color: #888;
  text-decoration: none;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.bp-cart__remove:hover {
  color: #c62828;
  background: #fdecea;
  text-decoration: none;
}

/* Thumbnail */
.bp-cart__thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #f0f0f0;
  display: block;
}

/* Nome do produto */
.bp-cart__product-name {
  font-weight: 600;
  color: #39323D;
  text-decoration: none;
  display: block;
  margin-bottom: 2px;
}

.bp-cart__product-name:hover {
  color: #6b4fa0;
  text-decoration: none;
}

.bp-cart__option {
  font-size: 0.82rem;
  color: #666;
  margin-top: 2px;
}

/* Preço e total */
.bp-cart__td--price,
.bp-cart__td--total {
  font-weight: 500;
  white-space: nowrap;
}

/* Quantidade */
.bp-cart__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bp-cart__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd5ee;
  border-radius: 8px;
  overflow: hidden;
}

.bp-cart__qty-btn {
  width: 32px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: #6b4fa0;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-cart__qty-btn:hover {
  background: #f0eafa;
}

.bp-cart__qty-input {
  width: 40px;
  text-align: center;
  border: none;
  border-left: 1px solid #ede8f5;
  border-right: 1px solid #ede8f5;
  font-family: 'Palanquin', sans-serif;
  font-size: 0.92rem;
  color: #39323D;
  padding: 0;
  height: 36px;
  background: transparent;
  outline: none;
}

/* Botão de submit escondido (accionado via JS) */
.bp-cart__update-submit {
  display: none;
}

/* ── Rodapé da tabela: módulos + actualizar ── */
.bp-cart__foot {
  border-top: 1px solid #ede8f5;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.bp-cart__modules {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Accordion dos módulos (cupão) — discreto */
.bp-cart__modules .accordion {
  width: auto;
}

.bp-cart__modules .accordion-item {
  border: none;
}

.bp-cart__modules .accordion-button {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.85rem;
  color: #6b4fa0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: none;
  text-decoration: underline;
}

.bp-cart__modules .accordion-body {
  padding: 8px 0 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.bp-cart__modules .accordion-body .form-control {
  max-width: 160px;
  font-size: 0.85rem;
}

.bp-cart__foot-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.bp-cart__link-back {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.85rem;
  color: #666;
  text-decoration: none;
}

.bp-cart__link-back:hover {
  color: #6b4fa0;
  text-decoration: none;
}

.bp-cart__btn-refresh {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.85rem;
  color: #39323D;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.2s;
}

.bp-cart__btn-refresh:hover {
  color: #6b4fa0;
}

/* ── Sidebar de totais ── */
.bp-cart__sidebar {}

.bp-cart__totals {
  border: 1px solid #ddd5ee;
  border-radius: 12px;
  padding: 24px;
}

.bp-cart__totals-title {
  font-family: 'Palanquin', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #39323D;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ede8f5;
}

.bp-cart__totals-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.bp-cart__total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Palanquin', sans-serif;
}

.bp-cart__total-label {
  font-size: 0.9rem;
  color: #555;
}

.bp-cart__total-val {
  font-size: 0.9rem;
  color: #39323D;
  font-weight: 500;
  text-align: right;
}

/* Última linha (Total) */
.bp-cart__total-row--last .bp-cart__total-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #39323D;
}

.bp-cart__total-row--last .bp-cart__total-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6b4fa0;
}

/* Botão finalizar compra */
.bp-cart__go-checkout {
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Palanquin', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6b4fa0, #4e3580);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.bp-cart__go-checkout:hover {
  opacity: 0.9;
  color: #fff;
  text-decoration: none;
}

/* ================================================================
   3. CHECKOUT (#checkout-checkout)
   ================================================================ */

/* Painéis esquerdo e direito */
#checkout-payment-address,
#checkout-register {
  border: 1px solid #ddd5ee;
  border-radius: 12px;
  padding: 28px;
  background: #fff;
  margin-bottom: 16px;
}

#checkout-shipping-method,
#checkout-payment-method,
#checkout-confirm {
  border: 1px solid #ddd5ee;
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  margin-bottom: 16px;
}

/* Títulos dos painéis */
#checkout-payment-address h2,
#checkout-register h2,
#checkout-shipping-method h2,
#checkout-payment-method h2,
#checkout-confirm h2 {
  font-family: 'Palanquin', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #6b4fa0;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #ede8f5;
}

/* Tabela do resumo de encomenda no confirm */
#checkout-confirm table {
  width: 100%;
  font-family: 'Palanquin', sans-serif;
  font-size: 0.88rem;
}

#checkout-confirm table th {
  color: #6b4fa0;
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 1px solid #ede8f5;
}

#checkout-confirm table td {
  padding: 8px 0;
  border-bottom: 1px solid #f5f3fa;
  color: #39323D;
}

#checkout-confirm table tfoot td {
  font-weight: 600;
  border-bottom: none;
}

/* Métodos de pagamento */
#checkout-payment-method .form-check-label {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.9rem;
  color: #39323D;
}

#checkout-payment-method .form-check-input:checked {
  background-color: #6b4fa0;
  border-color: #6b4fa0;
}

#checkout-payment-method img {
  max-height: 22px;
  vertical-align: middle;
  margin-left: 6px;
}

/* Botão finalizar encomenda */
#checkout-confirm .btn-primary {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #6b4fa0, #4e3580) !important;
  border: none !important;
  margin-top: 8px;
}

/* ================================================================
   4. CONTA ([id^="account-"])
   ================================================================ */

/* Cards internos da conta (login, register) */
#account-login .border.rounded,
#account-register .border.rounded {
  padding: 28px !important;
  border-color: #ddd5ee !important;
  border-radius: 12px !important;
}

#account-login h2,
#account-register h2 {
  color: #39323D;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Login — limita largura em desktop e centra */
#account-login #content > .row {
  max-width: 900px;
  margin: 0 auto;
}

/* Login — mobile: padding lateral confortável */
@media (max-width: 575.98px) {
  #account-login,
  #account-register {
    padding-top: 24px;
    padding-bottom: 48px;
  }
  #account-login .border.rounded,
  #account-register .border.rounded {
    padding: 20px !important;
  }
}

/* Dashboard da conta */
#account-account h1 {
  margin-bottom: 1rem;
}

#account-account ul.list-unstyled {
  padding: 16px 20px;
  border: 1px solid #ddd5ee;
  border-radius: 10px;
  margin-bottom: 1rem;
}

#account-account ul.list-unstyled li {
  padding: 6px 0;
  border-bottom: 1px solid #f5f3fa;
  font-family: 'Palanquin', sans-serif;
}

#account-account ul.list-unstyled li:last-child {
  border-bottom: none;
}

#account-account ul.list-unstyled li a {
  color: #39323D;
  text-decoration: none;
  font-size: 0.92rem;
}

#account-account ul.list-unstyled li a:hover {
  color: #6b4fa0;
}

/* Listas de encomendas, downloads, etc. */
[id^="account-"] table {
  font-family: 'Palanquin', sans-serif;
}

[id^="account-"] table thead th {
  color: #6b4fa0;
  font-weight: 600;
  border-bottom: 2px solid #ede8f5;
  font-size: 0.85rem;
}

[id^="account-"] table tbody td {
  vertical-align: middle;
  font-size: 0.88rem;
  color: #39323D;
}

/* Links de acção (Ver encomenda, etc.) */
[id^="account-"] table .btn-info,
[id^="account-"] table .btn-light {
  font-family: 'Palanquin', sans-serif;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Paginação */
[id^="account-"] .pagination .page-link {
  font-family: 'Palanquin', sans-serif;
  color: #6b4fa0;
}

[id^="account-"] .pagination .page-item.active .page-link {
  background-color: #6b4fa0;
  border-color: #6b4fa0;
}

/* Checkbox e switch */
[id^="account-"] .form-check-input:checked,
[id^="checkout-"] .form-check-input:checked {
  background-color: #6b4fa0;
  border-color: #6b4fa0;
}

/* Alert success/danger */
[id^="account-"] .alert,
[id^="checkout-"] .alert {
  font-family: 'Palanquin', sans-serif;
  border-radius: 8px;
}

/* ================================================================
   5. RESPONSIVO
   ================================================================ */

@media (max-width: 991.98px) {
  .bp-cart__layout {
    grid-template-columns: 1fr;
  }

  .bp-cart__sidebar {
    order: -1;
  }
}

@media (max-width: 575.98px) {
  .bp-cart__heading {
    font-size: 1.8rem;
  }

  .bp-cart__th--image { display: none; }
  .bp-cart__td--image { display: none; }

  .bp-cart__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .bp-cart__foot-actions {
    margin-left: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  #checkout-payment-address,
  #checkout-register,
  #checkout-shipping-method,
  #checkout-payment-method,
  #checkout-confirm {
    padding: 18px;
  }
}
