/* ==========================================================================
   NOORD THEME: SIDE CART (DRAWER LATERAL)
   Referência: MANORS Golf (manorsgolf.com)
   ========================================================================== */

/* ── Overlay ── */
.side-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.side-cart-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Drawer principal ── */
.side-cart {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100dvh;
  background: var(--color-surface, #ffffff);
  z-index: 9999;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.35s ease, visibility 0.35s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.side-cart.is-open {
  transform: translateX(0);
  visibility: visible;
}

body.side-cart-open {
  overflow: hidden;
}

/* ── Trigger no header (ícone do carrinho) ── */
.side-cart-trigger {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text, #111111);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-cart-trigger__count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-text, #111111);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  height: 16px;
  min-width: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Header ── */
.side-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid var(--color-border, #e0e0da);
  flex-shrink: 0;
}

.side-cart__title {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text, #111111);
}

.side-cart__count {
  font-weight: 400;
}

.side-cart__close {
  background: none;
  border: none;
  color: var(--color-text, #111111);
  cursor: pointer;
  padding: 8px;
  margin: -8px -8px -8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.side-cart__close:hover {
  opacity: 0.5;
}

/* ── Body (scrollável) ── */
.side-cart__body {
  flex: 1;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.side-cart__body::-webkit-scrollbar {
  display: none;
}

/* Estado vazio */
.side-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted, #666666);
  font-size: 14px;
}

.side-cart__continue-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 24px;
  background: var(--color-text, #111111);
  color: #ffffff;
  text-decoration: none;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background 0.2s ease;
}

.side-cart__continue-btn:hover {
  background: #333333;
  color: #ffffff;
}

/* Lista de itens */
.side-cart__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Item do carrinho ── */
.side-cart__item {
  display: flex;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--color-border, #e0e0da);
}

.side-cart__item-image {
  flex-shrink: 0;
  display: block;
  width: 72px;
  height: 90px;
  overflow: hidden;
  background: var(--color-bg, #f5f5f0);
  text-decoration: none;
  border-radius: 3px;
}

.side-cart__item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.side-cart__item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.side-cart__item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.side-cart__item-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text, #111111);
  text-decoration: none;
  line-height: 1.3;
  flex: 1;
}

.side-cart__item-name:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.side-cart__item-remove {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--color-text-muted, #999999);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.side-cart__item-remove:hover {
  color: var(--color-text, #111111);
}

.side-cart__item-variants {
  font-size: 12px;
  color: var(--color-text-muted, #666666);
  line-height: 1.3;
}

.side-cart__item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* Controle de quantidade */
.side-cart__qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border, #e0e0da);
  height: 32px;
}

.side-cart__qty-btn {
  width: 32px;
  height: 100%;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--color-text, #111111);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.side-cart__qty-btn:hover:not(:disabled) {
  background: var(--color-bg, #f5f5f0);
}

.side-cart__qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.side-cart__qty-value {
  width: 32px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text, #111111);
  border-left: 1px solid var(--color-border, #e0e0da);
  border-right: 1px solid var(--color-border, #e0e0da);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-cart__item-price {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text, #111111);
}

.side-cart__item-price .woocommerce-Price-amount {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

/* ── Upsell ── */
.side-cart__upsell {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, #e0e0da);
}

.side-cart__upsell-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted, #666666);
  margin: 0 0 12px 0;
}

.side-cart__upsell-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.side-cart__upsell-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-cart__upsell-image {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-bg, #f5f5f0);
  border-radius: 3px;
}

.side-cart__upsell-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.side-cart__upsell-name {
  font-size: 12px;
  color: var(--color-text, #111111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-cart__upsell-price {
  font-size: 12px;
  color: var(--color-text-muted, #666666);
}

.side-cart__upsell-btn {
  display: block;
  width: 100%;
  padding: 7px 0;
  background: var(--color-text, #111111);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease;
}

.side-cart__upsell-btn:hover {
  background: #333333;
  color: #ffffff;
}

.side-cart__upsell-btn.is-sold-out {
  background: var(--color-border, #e0e0da);
  color: var(--color-text-muted, #999999);
  cursor: not-allowed;
}

.side-cart__upsell-btn--options {
  background: transparent;
  color: var(--color-text, #111111);
  border: 1px solid var(--color-text, #111111);
  text-decoration: none;
  display: block;
}

.side-cart__upsell-btn--options:hover {
  background: var(--color-text, #111111);
  color: #ffffff;
}

/* ── Footer (fixo na base) ── */
.side-cart__footer {
  flex-shrink: 0;
  border-top: 1px solid var(--color-border, #e0e0da);
  background: var(--color-surface, #ffffff);
}

/* Ações: desconto + gift card */
.side-cart__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--color-border, #e0e0da);
}

.side-cart__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text, #111111);
  cursor: pointer;
  transition: background 0.15s ease;
  padding: 0 12px;
}

.side-cart__action-btn:first-child {
  border-right: 1px solid var(--color-border, #e0e0da);
}

.side-cart__action-btn:hover {
  background: var(--color-bg, #f5f5f0);
}

/* Input de cupom */
.side-cart__coupon-wrap {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border, #e0e0da);
  padding: 12px 20px;
}

.side-cart__coupon-input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--color-border, #e0e0da);
  padding: 0 12px;
  font-size: 13px;
  color: var(--color-text, #111111);
  background: var(--color-surface, #ffffff);
  outline: none;
  border-radius: 0;
  font-family: inherit;
}

.side-cart__coupon-input:focus {
  border-color: var(--color-text, #111111);
}

.side-cart__coupon-apply {
  height: 40px;
  padding: 0 16px;
  background: var(--color-text, #111111);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
  font-family: inherit;
}

.side-cart__coupon-apply:hover {
  background: #333333;
}

/* Totais */
.side-cart__totals {
  padding: 16px 20px 12px;
}

.side-cart__total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text, #111111);
  margin-bottom: 6px;
}

.side-cart__shipping-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-muted, #666666);
}

.side-cart__shipping-row.is-free {
  color: #2d7a4a;
  font-weight: 500;
}

/* Botão checkout */
.side-cart__checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  margin: 0 20px;
  height: 52px;
  background: var(--color-text, #111111);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
}

.side-cart__checkout-btn:hover {
  background: #333333;
  color: #ffffff;
}

/* Link ver carrinho */
.side-cart__view-cart {
  display: block;
  text-align: center;
  padding: 12px 20px 16px;
  font-size: 12px;
  color: var(--color-text-muted, #666666);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #cccccc;
  transition: color 0.2s ease;
}

.side-cart__view-cart:hover {
  color: var(--color-text, #111111);
  text-decoration-color: var(--color-text, #111111);
}

/* ── Loading ── */
.side-cart.is-loading .side-cart__body {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .side-cart {
    width: 100vw;
    box-shadow: none;
  }
}
