/* ============================================================
   FitaFlow — Carrinho v2 (visual claro premium, mobile-first)
   Segue a linguagem visual da home-v2 (branco + violeta/rosa).
   ============================================================ */

.storefront-cart .storefront__main { padding: 26px 0 56px; }

.ffcart { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.ffcart__wrap { display: flex; flex-direction: column; gap: 22px; }

/* ===== Paineis (cards brancos grandes) ===== */
.ffcart__panel {
  background: #FFFFFF;
  border: 1px solid rgba(139, 92, 246, .16);
  border-radius: 26px;
  padding: clamp(22px, 3vw, 36px);
  box-shadow: 0 14px 40px rgba(19, 26, 69, .08);
}
.ffcart__heading { margin-bottom: 20px; }
.ffcart__heading h1,
.ffcart__heading h2 {
  margin: 12px 0 0;
  font-family: Sora, sans-serif;
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: -0.02em;
  color: #131A45;
}

/* ===== Avisos ===== */
.ffcart__notice {
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(236, 72, 153, .07);
  border: 1px solid rgba(236, 72, 153, .28);
  color: #BE185D;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 16px;
}
.ffcart__notice p { margin: 0; }
.ffcart__notice p + p { margin-top: 6px; }
.ffcart__notice--success {
  background: rgba(16, 185, 129, .08);
  border-color: rgba(16, 185, 129, .32);
  color: #047857;
}

/* ===== Carrinho vazio ===== */
.ffcart__empty {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 34px 18px;
  border: 1.5px dashed rgba(139, 92, 246, .3);
  border-radius: 20px;
}
.ffcart__empty p { margin: 0; color: #4A4E75; font-size: 15px; font-weight: 600; }

/* ===== Item do carrinho ===== */
.ffcart__items { display: flex; flex-direction: column; gap: 14px; }
.ffcart-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(139, 92, 246, .14);
  border-radius: 20px;
  background: linear-gradient(180deg, #FFFFFF, #FBFAFF);
  box-shadow: 0 8px 24px rgba(19, 26, 69, .05);
  transition: box-shadow .3s, border-color .3s;
}
.ffcart-item:hover { border-color: rgba(139, 92, 246, .3); box-shadow: 0 14px 34px rgba(19, 26, 69, .09); }
.ffcart-item.is-unavailable { opacity: .68; }
.ffcart-item__media {
  width: 132px; height: 132px;
  border-radius: 18px;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, rgba(139, 92, 246, .1), rgba(236, 72, 153, .1));
  border: 1px solid rgba(139, 92, 246, .18);
}
.ffcart-item__media img,
.ffcart-item__media video {
  display: block;
  width: 100%; height: 100%;
  padding: 5px;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  border-radius: 15px;
}
.ffcart-item__copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ffcart-item__copy strong { font-family: Sora, sans-serif; font-size: 18px; color: #131A45; letter-spacing: -0.01em; }
.ffcart-item__copy > span { color: #6B6F96; font-size: 13px; line-height: 1.55; max-width: 46ch; }
.ffcart-item__price {
  margin: 8px 0 0;
  font-family: Sora, sans-serif;
  font-size: 21px; font-weight: 800; color: #131A45;
}
.ffcart-item__flag {
  align-self: flex-start; margin-top: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(236, 72, 153, .1); color: #DB2777;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.ffcart-item__hint { color: #B45309; font-size: 12px; margin-top: 4px; }
.ffcart-item__controls { display: flex; align-items: center; gap: 16px; justify-self: end; }
.ffcart-item__update { display: flex; align-items: center; gap: 12px; }
.ffcart-item__remove { display: flex; }

/* stepper de quantidade (sobrescreve tema escuro) */
.storefront-cart .quantity-picker {
  border: 1px solid rgba(139, 92, 246, .28);
  background: #FFFFFF;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(19, 26, 69, .05);
}
.storefront-cart .quantity-picker button {
  width: 40px; height: 46px;
  color: #7C3AED; font-size: 19px; font-weight: 800;
  background: transparent; cursor: pointer;
  transition: background .2s;
}
.storefront-cart .quantity-picker button:hover { background: rgba(139, 92, 246, .08); }
.storefront-cart .quantity-picker input {
  width: 52px; height: 46px;
  color: #131A45; font-weight: 800; font-size: 15px;
  background: transparent;
  -moz-appearance: textfield; appearance: textfield;
}
.storefront-cart .quantity-picker input::-webkit-outer-spin-button,
.storefront-cart .quantity-picker input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* link remover */
.ffcart-link {
  border: 0; background: transparent; padding: 0;
  color: #EC4899; font-weight: 800; font-size: 13.5px; cursor: pointer;
  transition: color .2s;
}
.ffcart-link:hover { color: #BE185D; text-decoration: underline; }

/* ===== Botoes ===== */
.ffcart-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 20px;
  border-radius: 13px; border: 1px solid transparent;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 14px;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .22s, box-shadow .22s, background .22s, border-color .22s, color .22s;
}
.ffcart-btn:hover { transform: translateY(-2px); }
.ffcart-btn--grad {
  color: #FFFFFF;
  background: linear-gradient(90deg, #7C3AED 0%, #C026D3 55%, #EC4899 100%);
  box-shadow: 0 12px 28px rgba(192, 38, 211, .35);
}
.ffcart-btn--grad:hover { box-shadow: 0 16px 34px rgba(192, 38, 211, .48); }
.ffcart-btn--soft {
  color: #131A45;
  background: #FFFFFF;
  border-color: rgba(139, 92, 246, .3);
  box-shadow: 0 6px 18px rgba(19, 26, 69, .06);
}
.ffcart-btn--soft:hover { border-color: #A78BFA; color: #7C3AED; }
.ffcart-btn--full { width: 100%; }
.ffcart-btn--big { min-height: 54px; font-size: 15px; border-radius: 15px; }
.ffcart-btn.is-disabled,
.ffcart-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.ffcart-btn[hidden] { display: none; }

/* ===== Grid da finalizacao ===== */
.ffcart__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}
.ffcart-box {
  background: #FBFAFF;
  border: 1px solid rgba(139, 92, 246, .16);
  border-radius: 20px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
}
.ffcart-box h3 { margin: 0; font-family: Sora, sans-serif; font-size: 18px; color: #131A45; letter-spacing: -0.01em; }
.ffcart-box__sub { margin: -6px 0 0; color: #6B6F96; font-size: 13px; line-height: 1.55; }
.ffcart-box__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ffcart-box__actions .ffcart-btn { flex: 1 1 auto; }
.ffcart-box__stack { display: flex; flex-direction: column; gap: 12px; }

/* campos */
.ffcart-field { display: flex; flex-direction: column; gap: 7px; }
.ffcart-field span { color: #4A4E75; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
.ffcart-field input {
  width: 100%; min-height: 48px; padding: 0 15px;
  border-radius: 13px;
  border: 1px solid rgba(139, 92, 246, .3);
  background: #FFFFFF; color: #131A45;
  font-weight: 700; font-size: 14.5px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.ffcart-field input::placeholder { color: #6B6F96; font-weight: 600; }
.ffcart-field input:focus { border-color: #A78BFA; box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }

/* feedback do frete (JS injeta estados) */
.ffcart .shipping-feedback { min-height: 20px; font-size: 13px; font-weight: 600; color: #6B6F96; }
.ffcart .shipping-feedback[data-state="loading"] { color: #7C3AED; }
.ffcart .shipping-feedback[data-state="success"] { color: #047857; }
.ffcart .shipping-feedback[data-state="error"] { color: #BE185D; }

/* opcoes de frete (JS injeta .shipping-option) */
.ffcart .shipping-results { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ffcart .shipping-option,
.ffcart .shipping-empty {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, .22);
  background: #FFFFFF;
  color: #131A45;
}
.ffcart .shipping-empty { color: #6B6F96; font-size: 13px; }
.ffcart .shipping-option { display: grid; gap: 10px; }
.ffcart .shipping-option.is-selected {
  border-color: #A78BFA;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .14), 0 10px 24px rgba(139, 92, 246, .14);
  background: linear-gradient(180deg, #FFFFFF, #F6F2FF);
}
.ffcart .shipping-option.is-unavailable { opacity: .6; }
.ffcart .shipping-option__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ffcart .shipping-option__top strong { font-family: Sora, sans-serif; font-size: 14.5px; }
.ffcart .shipping-option__top span { display: block; margin-top: 3px; color: #6B6F96; font-size: 12.5px; }
.ffcart .shipping-option__badge {
  display: inline-flex; align-items: center;
  min-height: 26px; padding: 0 11px; border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, .3);
  background: rgba(139, 92, 246, .08);
  color: #7C3AED; font-size: 11.5px; font-weight: 800; white-space: nowrap;
}
.ffcart .shipping-option__badge.is-off { border-color: rgba(236, 72, 153, .3); background: rgba(236, 72, 153, .08); color: #DB2777; }
.ffcart .shipping-option__price { font-family: Sora, sans-serif; font-weight: 800; font-size: 17px; color: #131A45; }
.ffcart .shipping-option__meta { margin: 0; color: #6B6F96; font-size: 12px; }

/* botoes .btn injetados pelo JS dentro das opcoes de frete */
.ffcart .shipping-option .btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid transparent;
  font-weight: 800; font-size: 13px; cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  box-shadow: none;
}
.ffcart .shipping-option .btn--primary {
  color: #fff;
  background: linear-gradient(90deg, #7C3AED, #EC4899);
  box-shadow: 0 8px 20px rgba(192, 38, 211, .3);
}
.ffcart .shipping-option .btn--soft {
  color: #131A45; background: #FFFFFF;
  border-color: rgba(139, 92, 246, .3);
}
.ffcart .shipping-option .btn--soft:hover { border-color: #A78BFA; color: #7C3AED; }
.ffcart .shipping-option .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Resumo ===== */
.ffcart-box--summary { background: #FFFFFF; border-color: rgba(139, 92, 246, .2); box-shadow: 0 10px 28px rgba(19, 26, 69, .06); }
.ffcart-summary { display: flex; flex-direction: column; }
.ffcart-summary__line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(139, 92, 246, .12);
  color: #4A4E75; font-size: 14px; font-weight: 600;
}
.ffcart-summary__line strong { color: #131A45; font-weight: 800; }
.ffcart-summary__discount { color: #DB2777 !important; }
.ffcart-summary__line--total { border-bottom: 0; padding-bottom: 4px; }
.ffcart-summary__line--total span { color: #131A45; font-family: Sora, sans-serif; font-weight: 800; font-size: 16px; }
.ffcart-summary__line--total strong { font-family: Sora, sans-serif; font-size: 25px; letter-spacing: -0.02em; }

/* selo de confianca */
.ffcart-trust {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(139, 92, 246, .09), rgba(236, 72, 153, .07));
  border: 1px solid rgba(139, 92, 246, .22);
}
.ffcart-trust__dot {
  flex-shrink: 0; width: 9px; height: 9px; border-radius: 999px; margin-top: 5px;
  background: #7C3AED;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .18);
}
.ffcart-trust strong { display: block; color: #6D28D9; font-size: 13.5px; font-family: Sora, sans-serif; }
.ffcart-trust small { display: block; margin-top: 3px; color: #6B6F96; font-size: 12.5px; line-height: 1.5; }

/* ===== Gate de login ===== */
.ffcart-gate {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  background: #FBFAFF;
  border: 1px solid rgba(139, 92, 246, .2);
}
.ffcart-gate strong { display: block; font-family: Sora, sans-serif; color: #131A45; font-size: 16px; }
.ffcart-gate p { margin: 8px 0 14px; color: #6B6F96; font-size: 13.5px; line-height: 1.6; }

/* ===== CTA final ===== */
.ffcart__cta { display: flex; gap: 14px; margin-top: 20px; }
.ffcart__cta .ffcart-btn--grad { flex: 1.55; }
.ffcart__cta .ffcart-btn--soft { flex: 1; }
.ffcart__cta .ffcart__clear { flex: 1; display: flex; }
.ffcart__cta .ffcart__clear .ffcart-btn { width: 100%; }
.ffcart-gate .ffcart__cta { margin-top: 0; }

/* ============================================================
   Responsivo
   ============================================================ */
@media (max-width: 1080px) {
  .ffcart__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ffcart-box--summary { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .storefront-cart .storefront__main { padding: 14px 0 40px; }
  .ffcart { padding: 0 14px; }
  .ffcart__wrap { gap: 14px; }
  .ffcart__panel { border-radius: 20px; padding: 20px 16px; }
  .ffcart__heading { margin-bottom: 14px; }

  .ffcart__grid { grid-template-columns: 1fr; gap: 12px; }

  .ffcart-item {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    align-items: start;
  }
  .ffcart-item__media { width: 100px; height: 100px; border-radius: 14px; }
  .ffcart-item__media img,
  .ffcart-item__media video { width: 100%; height: 100%; padding: 3px; }
  .ffcart-item__copy strong { font-size: 15.5px; }
  .ffcart-item__copy > span { font-size: 12px; }
  .ffcart-item__price { font-size: 18px; margin-top: 5px; }
  .ffcart-item__controls {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed rgba(139, 92, 246, .2);
  }
  .ffcart-item__update { flex: 1; gap: 10px; }
  .ffcart-item__update .ffcart-btn { flex: 1; min-height: 44px; padding: 0 12px; font-size: 13px; }
  .storefront-cart .quantity-picker button { width: 36px; height: 44px; }
  .storefront-cart .quantity-picker input { width: 40px; height: 44px; font-size: 14px; }

  .ffcart__cta { flex-direction: column; gap: 10px; margin-top: 16px; }
  .ffcart__cta .ffcart-btn { width: 100%; }
  .ffcart-btn--big { min-height: 52px; }
  .ffcart-summary__line--total strong { font-size: 22px; }
}

@media (max-width: 380px) {
  .ffcart-item__update { flex-wrap: wrap; }
  .ffcart-item__update .ffcart-btn { min-width: 100%; }
}
