/**
 * Flore Mar — Carrito de compras
 * Encolado condicionalmente solo en is_cart()
 * Tokens: heredados de style.css (sin prefijo --fm-*)
 */

/* ── LAYOUT FULL-WIDTH (anula right-sidebar Storefront) ─────── */
/* Selectores dobles: con y sin .right-sidebar para máxima cobertura */
body.fm-full-width #primary,
body.fm-full-width .content-area,
body.right-sidebar.fm-full-width #primary,
body.right-sidebar.fm-full-width .content-area {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.fm-full-width #secondary,
body.right-sidebar.fm-full-width #secondary { display: none !important; }
body.fm-full-width .col-full,
body.right-sidebar.fm-full-width .col-full { max-width: 100% !important; padding: 0; }
/* Footer: limpiar float residual para que no quede recortado */
body.fm-full-width .fm-footer,
body.fm-full-width footer.site-footer,
body.right-sidebar.fm-full-width .fm-footer,
body.right-sidebar.fm-full-width footer.site-footer {
  clear: both;
  width: 100%;
}

/* ── INDICADOR DE PASOS ─────────────────────────────────────── */
.fm-checkout-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.4rem 5%;
  background: #fff;
  border-bottom: 1px solid var(--light-gray);
  gap: 0;
}
.fm-cs-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.fm-cs-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--light-gray);
  color: var(--warm-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Jost', sans-serif;
  transition: all .2s;
}
.fm-cs-step.is-active .fm-cs-circle {
  background: var(--sage);
  color: #fff;
}
.fm-cs-step.is-done .fm-cs-circle {
  background: var(--sage-light);
  color: var(--sage-dark);
}
.fm-cs-step span {
  font-size: 0.72rem;
  color: var(--warm-gray);
  font-family: 'Jost', sans-serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.fm-cs-step.is-active span { color: var(--sage-dark); font-weight: 500; }
.fm-cs-step.is-done span   { color: var(--sage); }
.fm-cs-line {
  width: 60px;
  height: 1.5px;
  background: var(--light-gray);
  margin: 0 0.8rem 1.4rem;
  flex-shrink: 0;
}
.fm-cs-line.is-done { background: var(--sage-light); }

/* ── CARRITO VACÍO ──────────────────────────────────────────── */
.fm-cart-empty {
  max-width: 480px;
  margin: 4rem auto;
  padding: 2rem 5% 4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.fm-cart-empty-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--blush-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage);
  margin-bottom: 0.5rem;
}
.fm-cart-empty h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--charcoal);
  margin: 0;
}
.fm-cart-empty p {
  font-size: 0.92rem;
  color: var(--warm-gray);
  line-height: 1.6;
  margin: 0;
}
.fm-cart-empty-btn {
  display: inline-block;
  background: var(--sage);
  color: #fff;
  padding: 0.85rem 2.2rem;
  border-radius: 100px;
  font-size: 0.88rem;
  font-family: 'Jost', sans-serif;
  text-decoration: none;
  transition: background .2s, transform .15s;
  margin-top: 0.5rem;
}
.fm-cart-empty-btn:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
}

/* ── LAYOUT PRINCIPAL ───────────────────────────────────────── */
.fm-cart-page {
  background: var(--cream);
  min-height: 50vh;
  padding: 2.5rem 5% 5rem;
}
.fm-cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

/* ── TÍTULO ─────────────────────────────────────────────────── */
.fm-cart-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--charcoal);
  margin: 0 0 1.5rem;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.fm-cart-qty-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  color: var(--warm-gray);
  font-weight: 300;
}

/* ── ÍTEMS ──────────────────────────────────────────────────── */
.fm-cart-form { margin: 0; }
.fm-cart-items { display: flex; flex-direction: column; gap: 0.8rem; }
.fm-cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto auto;
  gap: 1.2rem;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 1.1rem;
  border: 1px solid var(--light-gray);
  transition: box-shadow .2s;
}
.fm-cart-item:hover { box-shadow: 0 4px 22px rgba(0,0,0,0.06); }

/* Imagen */
.fm-ci-img-wrap {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  background: linear-gradient(145deg, #eef4ef, #f4ede8);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fm-ci-img-wrap a { display: flex; width: 100%; height: 100%; }
.fm-ci-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  display: block;
}

/* Detalles */
.fm-ci-details { min-width: 0; }
.fm-ci-cat {
  font-size: 0.68rem;
  color: var(--warm-gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  font-family: 'Jost', sans-serif;
}
.fm-ci-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--charcoal);
}
.fm-ci-name a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}
.fm-ci-name a:hover { color: var(--sage-dark); }
.fm-ci-details .variation {
  font-size: 0.78rem;
  color: var(--warm-gray);
  margin-top: 0.3rem;
}
.fm-ci-details .variation dt,
.fm-ci-details .variation dd { display: inline; margin: 0; }
.fm-ci-details .variation dt::after { content: ': '; }
.fm-ci-details .variation dd::after { content: ' · '; }
.fm-ci-details .variation dd:last-child::after { content: ''; }

/* ── CONTROL QTY PILL +/− ───────────────────────────────────── */
.fm-qty-pill {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--light-gray);
  border-radius: 100px;
  overflow: hidden;
  background: #fff;
  transition: border-color .2s;
}
.fm-qty-pill:focus-within { border-color: var(--sage); }
.fm-qty-btn {
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--charcoal);
  font-family: 'Jost', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  user-select: none;
  padding: 0;
}
.fm-qty-btn:hover {
  background: var(--blush-light);
  color: var(--sage-dark);
}
.fm-qty-btn:active { transform: scale(0.94); }
.fm-qty-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.fm-qty-pill .qty {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 0.9rem;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  color: var(--charcoal);
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}
.fm-qty-pill .qty::-webkit-inner-spin-button,
.fm-qty-pill .qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fm-ci-single-qty {
  font-size: 0.88rem;
  color: var(--warm-gray);
  font-family: 'Jost', sans-serif;
  padding: 0 0.6rem;
}

/* ── PRECIO Y ELIMINAR ──────────────────────────────────────── */
.fm-ci-price-wrap { text-align: right; flex-shrink: 0; min-width: 80px; }
.fm-ci-subtotal {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
  margin-bottom: 0.4rem;
}
.fm-ci-subtotal .woocommerce-Price-amount { font-family: inherit; }
.fm-ci-remove {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--warm-gray);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: 'Jost', sans-serif;
  transition: color .2s;
}
.fm-ci-remove:hover { color: #9B5555; }

/* ── ACCIONES (seguir comprando + actualizar) ───────────────── */
.fm-cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.2rem;
  gap: 1rem;
}
.fm-btn-keep-shopping {
  font-size: 0.82rem;
  color: var(--warm-gray);
  text-decoration: none;
  font-family: 'Jost', sans-serif;
  letter-spacing: 0.02em;
  transition: color .2s;
}
.fm-btn-keep-shopping:hover { color: var(--sage-dark); }
.fm-btn-update-cart {
  font-size: 0.78rem;
  font-family: 'Jost', sans-serif;
  background: transparent;
  color: var(--warm-gray);
  border: 1.5px solid var(--light-gray);
  border-radius: 100px;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  transition: all .2s;
}
.fm-btn-update-cart:not([disabled]):hover {
  border-color: var(--sage);
  color: var(--sage-dark);
}
.fm-btn-update-cart[disabled] { opacity: 0.4; cursor: default; }

/* ── CUPÓN ──────────────────────────────────────────────────── */
.fm-cart-main .coupon,
.fm-cart-main .woocommerce-form-coupon,
.fm-cart-main form.checkout_coupon {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--light-gray);
  align-items: center;
  flex-wrap: wrap;
}
.fm-cart-main .coupon label {
  font-size: 0.8rem;
  color: var(--warm-gray);
  font-family: 'Jost', sans-serif;
  white-space: nowrap;
}
.fm-cart-main .coupon .input-text,
.fm-cart-main .input-text[name="coupon_code"] {
  flex: 1;
  min-width: 180px;
  border: 1.5px solid var(--light-gray);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-family: 'Jost', sans-serif;
  color: var(--charcoal);
  background: #fff;
  outline: none;
  transition: border-color .2s;
}
.fm-cart-main .coupon .input-text:focus { border-color: var(--sage); }
.fm-cart-main .coupon .button,
.fm-cart-main button[name="apply_coupon"] {
  background: transparent;
  color: var(--warm-gray);
  border: 1.5px solid var(--light-gray);
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  font-size: 0.82rem;
  font-family: 'Jost', sans-serif;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.fm-cart-main .coupon .button:hover,
.fm-cart-main button[name="apply_coupon"]:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

/* ── SIDEBAR: Resumen del pedido ────────────────────────────── */
.fm-cart-sidebar { position: sticky; top: 100px; align-self: start; }
/* Anular float: right + width: 48% que aplica woocommerce.css en .cart-collaterals .cart_totals */
.fm-cart-sidebar .cart-collaterals { width: 100% !important; float: none !important; }
.fm-cart-sidebar .cart_totals {
  background: #fff;
  border: 1px solid var(--light-gray);
  border-radius: 16px;
  padding: 1.6rem;
  width: 100% !important;
  float: none !important;
  box-sizing: border-box;
  margin-bottom: 1rem;
}
.fm-cart-sidebar .cart_totals h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--charcoal);
  margin: 0 0 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--light-gray);
}

/* Tabla de totales */
.fm-cart-sidebar .cart_totals .shop_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.fm-cart-sidebar .cart_totals .shop_table th,
.fm-cart-sidebar .cart_totals .shop_table td {
  padding: 0.6rem 0;
  font-size: 0.86rem;
  font-family: 'Jost', sans-serif;
  color: var(--warm-gray);
  border-bottom: 1px solid var(--light-gray);
  vertical-align: middle;
  text-align: left;
}
.fm-cart-sidebar .cart_totals .shop_table td { text-align: right; color: var(--charcoal); }
.fm-cart-sidebar .cart_totals .shop_table tr:last-child th,
.fm-cart-sidebar .cart_totals .shop_table tr:last-child td { border-bottom: none; }
.fm-cart-sidebar .cart_totals .shop_table .order-total th,
.fm-cart-sidebar .cart_totals .shop_table .order-total td {
  font-size: 1rem;
  font-weight: 600;
  color: var(--charcoal);
  padding-top: 0.9rem;
}
.fm-cart-sidebar .cart_totals .shop_table .order-total td .woocommerce-Price-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--sage-dark);
}
/* Descuentos (fee) y envío gratis */
.fm-cart-sidebar .cart_totals .shop_table .fee td,
.fm-cart-sidebar .cart_totals .shop_table .woocommerce-shipping-totals td { color: var(--sage-dark); }

/* ── BOTÓN CHECKOUT ─────────────────────────────────────────── */
.fm-cart-sidebar .wc-proceed-to-checkout { padding: 0; margin: 0; }
.fm-cart-sidebar .checkout-button,
.fm-cart-sidebar .wc-proceed-to-checkout a.checkout-button {
  display: block;
  width: 100%;
  background: var(--sage);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 0.95rem 1rem;
  font-size: 0.92rem;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
  margin-top: 1rem;
  box-shadow: none;
}
.fm-cart-sidebar .checkout-button:hover,
.fm-cart-sidebar .wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
}

/* ── SELLOS DE CONFIANZA ────────────────────────────────────── */
.fm-cart-trust {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--light-gray);
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.fm-ct-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  color: var(--warm-gray);
  font-family: 'Jost', sans-serif;
  line-height: 1.4;
}
.fm-ct-row svg {
  flex-shrink: 0;
  color: var(--sage);
}

/* ── MENSAJES WC (notices + carrito vacío) ──────────────────── */

/* Contenedor general */
.woocommerce-notices-wrapper {
  margin: 0 0 1.5rem;
}

/* Base compartida — los tres tipos */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.25rem;
  border-radius: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.8rem;
  list-style: none;
}

/* Éxito — sage verde suave */
.woocommerce-notices-wrapper .woocommerce-message {
  background: #eef4ef;
  border-left: 3px solid var(--sage, #6b8f71);
  color: #3b5c40;
}
.woocommerce-notices-wrapper .woocommerce-message::before {
  content: '✓';
  flex-shrink: 0;
  font-weight: 700;
  color: var(--sage, #6b8f71);
}

/* Info — crema cálido */
.woocommerce-notices-wrapper .woocommerce-info {
  background: #fdf6ed;
  border-left: 3px solid #c9a96e;
  color: #7a5c2e;
}
.woocommerce-notices-wrapper .woocommerce-info::before {
  content: 'ℹ';
  flex-shrink: 0;
  font-style: normal;
  color: #c9a96e;
}

/* Error — rosa empolvado cálido */
.woocommerce-notices-wrapper .woocommerce-error {
  display: block;
  background: #fdf0ee;
  border-left: 3px solid #c97070;
  color: #7a3535;
  padding: 0;
  margin-bottom: 0.8rem;
  border-radius: 10px;
  overflow: hidden;
}
.woocommerce-notices-wrapper .woocommerce-error li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(201,112,112,0.12);
}
.woocommerce-notices-wrapper .woocommerce-error li:last-child {
  border-bottom: none;
}
.woocommerce-notices-wrapper .woocommerce-error li::before {
  content: '!';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c97070;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Botón "Ver carrito" dentro de notices de éxito */
.woocommerce-notices-wrapper .woocommerce-message .button,
.woocommerce-notices-wrapper .woocommerce-message a.button {
  flex-shrink: 0;
  background: var(--sage, #6b8f71);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.woocommerce-notices-wrapper .woocommerce-message .button:hover,
.woocommerce-notices-wrapper .woocommerce-message a.button:hover {
  background: #5a7a5f;
}

/* Carrito vacío — wc-empty-cart-message */
.wc-empty-cart-message {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #faf7f2;
  border-radius: 12px;
  font-family: 'Jost', sans-serif;
  font-size: 1rem;
  color: #6b6b5e;
  border: 1px solid #ede8e0;
  margin: 1.5rem 0;
}
.wc-empty-cart-message::before {
  content: '🛒';
  display: block;
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .fm-cart-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .fm-cart-sidebar { position: static; }
}
@media (max-width: 600px) {
  .fm-checkout-steps { padding: 1rem 4%; }
  .fm-cs-line { width: 32px; margin: 0 0.4rem 1.4rem; }
  .fm-cs-step span { font-size: 0.66rem; }
  .fm-cart-page { padding: 1.5rem 4% 4rem; }
  .fm-cart-title { font-size: 1.6rem; }
  .fm-cart-item {
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
    gap: 0.9rem 1rem;
    padding: 0.9rem;
  }
  .fm-ci-img-wrap { width: 72px; height: 72px; }
  .fm-ci-details { grid-column: 2; }
  .fm-ci-qty {
    grid-column: 2;
    justify-self: start;
  }
  .fm-ci-price-wrap {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--light-gray);
    padding-top: 0.7rem;
    margin-top: 0.2rem;
    text-align: left;
  }
  .fm-ci-subtotal { margin-bottom: 0; }
  .fm-cart-actions { flex-direction: column-reverse; align-items: stretch; gap: 0.6rem; }
  .fm-cart-actions .fm-btn-keep-shopping { text-align: center; padding: 0.5rem; }
}
