/* Carrito público multi-mercado · FASE 5.3 */

.storefront-shell { min-width: 0; }

.storefront-cart-button {
  position: relative;
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  gap: 0.42rem;
  padding: 0.45rem 0.55rem 0.45rem 0.7rem;
  color: #ffffff;
  border-radius: 999px;
  background: var(--brand-red);
  font-size: 0.8rem;
  font-weight: 850;
  transition: background-color 160ms ease, transform 160ms ease;
}

.storefront-cart-button:hover,
.storefront-cart-button:focus-visible { background: var(--brand-red-deep); transform: translateY(-1px); }
.storefront-cart-button:disabled { cursor: wait; opacity: 0.58; transform: none; }
.storefront-cart-count { display: grid; min-width: 1.55rem; height: 1.55rem; place-items: center; padding-inline: 0.3rem; color: var(--brand-red-deep); border-radius: 999px; background: #ffffff; font-size: 0.72rem; }

.storefront-product-cart-actions { display: grid; gap: 0.45rem; padding: 0 0.95rem 0.95rem; }
.storefront-product-cart-status { min-height: 1rem; color: var(--brand-green-deep); font-size: 0.7rem; font-weight: 800; }
.storefront-detail-cart-action { display: grid; gap: 0.5rem; margin-top: 1.1rem; }
.storefront-add-button { display: inline-flex; min-height: 2.65rem; align-items: center; justify-content: center; padding: 0.58rem 0.85rem; color: #ffffff; border-radius: 0.72rem; background: var(--brand-red); font-size: 0.83rem; font-weight: 850; transition: background-color 160ms ease, transform 160ms ease; }
.storefront-add-button:hover, .storefront-add-button:focus-visible { background: var(--brand-red-deep); transform: translateY(-1px); }
.storefront-add-button:active { transform: scale(0.98); }
.storefront-add-button:disabled { color: var(--storefront-muted); cursor: not-allowed; background: #eee9e1; transform: none; }

.storefront-cart-dialog {
  width: 100%;
  max-width: none;
  height: min(88dvh, 46rem);
  max-height: none;
  margin: auto 0 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1.25rem 1.25rem 0 0;
  background: transparent;
}

.storefront-cart-dialog[hidden],
.storefront-cart-confirm[hidden],
.storefront-cart-list[hidden],
.storefront-cart-empty[hidden],
.storefront-cart-summary[hidden],
.storefront-toast[hidden] { display: none; }
.storefront-cart-dialog::backdrop, .storefront-cart-confirm::backdrop { background: rgb(36 37 34 / 58%); backdrop-filter: blur(4px); }
.storefront-cart-drawer { display: flex; height: 100%; flex-direction: column; background: var(--storefront-surface); box-shadow: 0 0 3rem rgb(36 37 34 / 18%); }
.storefront-cart-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 0.9rem; border-bottom: 1px solid var(--storefront-line); }
.storefront-cart-header .storefront-eyebrow { margin-bottom: 0.25rem; }
.storefront-cart-header h2 { margin: 0; color: var(--storefront-ink); font-size: 1.45rem; }
.storefront-cart-close { display: grid; width: 2.7rem; height: 2.7rem; flex: 0 0 auto; place-items: center; color: var(--storefront-ink); border: 1px solid var(--storefront-line); border-radius: 50%; background: var(--storefront-surface-soft); font-size: 1.45rem; line-height: 1; }
.storefront-cart-close:hover, .storefront-cart-close:focus-visible { color: #ffffff; border-color: var(--brand-red); background: var(--brand-red); }
.storefront-cart-list { display: grid; flex: 1 1 auto; min-height: 0; gap: 0.85rem; overflow-y: auto; padding: 1rem; overscroll-behavior: contain; }
.storefront-cart-line { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0.8rem; padding: 0.8rem; border: 1px solid var(--storefront-line); border-radius: 0.95rem; background: var(--storefront-surface); }
.storefront-cart-line-media { display: grid; width: 4.5rem; height: 4.5rem; place-items: center; overflow: hidden; border-radius: 0.72rem; background: linear-gradient(140deg, #fff6e9, #f2f7ed); }
.storefront-cart-line-media img { width: 100%; height: 100%; object-fit: cover; }
.storefront-cart-placeholder { font-size: 1.7rem; }
.storefront-cart-line-content { min-width: 0; }
.storefront-cart-line-name { margin: 0; overflow-wrap: anywhere; color: var(--storefront-ink); font-size: 0.92rem; line-height: 1.2; }
.storefront-cart-line-price { margin: 0.3rem 0 0; color: var(--storefront-muted); font-size: 0.76rem; }
.storefront-cart-line-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.65rem; margin-top: 0.7rem; }
.storefront-cart-quantity { display: inline-grid; grid-template-columns: 2.5rem minmax(2rem, auto) 2.5rem; align-items: center; overflow: hidden; border: 1px solid var(--storefront-line); border-radius: 999px; }
.storefront-cart-quantity-button { display: grid; min-height: 2.5rem; place-items: center; color: var(--storefront-ink); background: var(--storefront-surface-soft); font-size: 1.1rem; font-weight: 900; }
.storefront-cart-quantity-button:hover, .storefront-cart-quantity-button:focus-visible { color: #ffffff; background: var(--brand-red); }
.storefront-cart-quantity-button:disabled { color: #aaa69f; cursor: not-allowed; background: #f1eee9; }
.storefront-cart-quantity-value { padding-inline: 0.35rem; color: var(--storefront-ink); font-size: 0.86rem; font-weight: 850; text-align: center; }
.storefront-cart-remove { min-height: 2.5rem; padding: 0.45rem 0.6rem; color: var(--brand-red-deep); border-radius: 0.55rem; background: transparent; font-size: 0.75rem; font-weight: 800; text-decoration: underline; text-underline-offset: 0.15em; }
.storefront-cart-remove:hover, .storefront-cart-remove:focus-visible { background: var(--storefront-tint); }
.storefront-cart-line-subtotal { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding-top: 0.7rem; border-top: 1px solid var(--storefront-line); color: var(--storefront-muted); font-size: 0.78rem; }
.storefront-cart-line-subtotal strong { color: var(--storefront-ink); font-size: 0.88rem; }

.storefront-cart-empty { display: grid; flex: 1; place-items: center; align-content: center; padding: 2rem 1.25rem; text-align: center; }
.storefront-cart-empty > span { font-size: 2.8rem; }
.storefront-cart-empty h3 { margin: 0.8rem 0 0; color: var(--storefront-ink); font-size: 1.25rem; }
.storefront-cart-empty p { max-width: 26rem; margin: 0.5rem 0 0; color: var(--storefront-muted); }
.storefront-cart-empty button { min-height: 2.7rem; margin-top: 1rem; padding: 0.6rem 0.9rem; color: #ffffff; border-radius: 0.7rem; background: var(--brand-red); font-weight: 850; }
.storefront-cart-summary { margin-top: auto; padding: 1rem; border-top: 1px solid var(--storefront-line); background: #fffaf3; }
.storefront-cart-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--storefront-ink); font-size: 1rem; }
.storefront-cart-summary strong { color: var(--brand-red-deep); font-size: 1.35rem; }
.storefront-cart-summary p { margin: 0.5rem 0 0; color: var(--storefront-muted); font-size: 0.72rem; }
.storefront-cart-whatsapp { display: inline-flex; width: 100%; min-height: 2.85rem; align-items: center; justify-content: center; margin-top: 0.9rem; padding: 0.62rem 0.85rem; color: #ffffff; border-radius: 0.72rem; background: var(--brand-green-deep); font-weight: 850; transition: background-color 160ms ease, transform 160ms ease; }
.storefront-cart-whatsapp:hover, .storefront-cart-whatsapp:focus-visible { background: #1f5119; transform: translateY(-1px); }
.storefront-cart-whatsapp:active { transform: scale(0.985); }
.storefront-cart-whatsapp:disabled { color: #8b9288; cursor: not-allowed; background: #e6eae4; transform: none; }
.storefront-cart-whatsapp-status { margin-top: 0.65rem !important; color: var(--brand-orange-deep) !important; font-size: 0.75rem !important; font-weight: 750; }
.storefront-cart-clear { min-height: 2.5rem; margin-top: 0.8rem; padding: 0.5rem 0.7rem; color: var(--brand-red-deep); border: 1px solid rgb(169 37 24 / 24%); border-radius: 0.65rem; background: #ffffff; font-size: 0.77rem; font-weight: 800; }
.storefront-cart-clear:hover, .storefront-cart-clear:focus-visible { color: #ffffff; background: var(--brand-red); }

.storefront-cart-confirm { width: min(calc(100% - 2rem), 26rem); padding: 0; border: 0; border-radius: 1rem; background: transparent; }
.storefront-cart-confirm > div { padding: 1.25rem; border: 1px solid var(--storefront-line); border-radius: 1rem; background: #ffffff; box-shadow: 0 1.5rem 4rem rgb(36 37 34 / 22%); }
.storefront-cart-confirm h2 { margin: 0; color: var(--storefront-ink); font-size: 1.35rem; }
.storefront-cart-confirm p:not(.storefront-eyebrow) { margin: 0.65rem 0 0; color: var(--storefront-muted); }
.storefront-cart-confirm-actions { display: flex; justify-content: flex-end; gap: 0.65rem; margin-top: 1.2rem; }
.storefront-cart-confirm-actions button { min-height: 2.65rem; padding: 0.55rem 0.8rem; border: 1px solid var(--storefront-line); border-radius: 0.65rem; background: #ffffff; font-weight: 800; }
.storefront-cart-confirm-actions button:hover, .storefront-cart-confirm-actions button:focus-visible { border-color: var(--brand-red); }
.storefront-cart-confirm-actions .is-danger { color: #ffffff; border-color: var(--brand-red); background: var(--brand-red); }
.storefront-cart-confirm-actions .is-danger:hover, .storefront-cart-confirm-actions .is-danger:focus-visible { background: var(--brand-red-deep); }

.storefront-toast { position: fixed; z-index: 60; right: 1rem; bottom: 1rem; width: min(calc(100% - 2rem), 24rem); padding: 0.85rem 1rem; color: #ffffff; border-radius: 0.8rem; background: #343833; box-shadow: 0 0.9rem 2.2rem rgb(36 37 34 / 22%); font-size: 0.84rem; font-weight: 750; animation: storefront-toast-in 180ms ease-out both; }
.storefront-toast[data-tone="success"] { background: var(--brand-green-deep); }
.storefront-toast[data-tone="warning"] { background: var(--brand-orange-deep); }

@keyframes storefront-toast-in { from { opacity: 0; transform: translateY(0.6rem); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 48rem) {
  .storefront-cart-dialog { width: min(28rem, 92vw); height: 100dvh; margin: 0 0 0 auto; border-radius: 1.25rem 0 0 1.25rem; }
  .storefront-cart-header, .storefront-cart-list, .storefront-cart-summary { padding-inline: 1.25rem; }
}

@media (max-width: 23rem) {
  .storefront-cart-button-label { display: none; }
  .storefront-cart-line { grid-template-columns: 3.8rem minmax(0, 1fr); padding: 0.7rem; }
  .storefront-cart-line-media { width: 3.8rem; height: 3.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .storefront-cart-button, .storefront-add-button, .storefront-cart-whatsapp, .storefront-toast { transition: none; animation: none; }
}

/* FASE 5.5.1 · El carrito comparte el lenguaje visual del catálogo. */
.storefront-cart-button {
  min-height: 2.75rem;
  padding-inline: 0.85rem 0.55rem;
  box-shadow: 0 0.4rem 0.85rem rgb(169 37 24 / 16%);
}
.storefront-add-button {
  min-height: 2.85rem;
  border-radius: 0.8rem;
  box-shadow: 0 0.35rem 0.75rem rgb(169 37 24 / 12%);
}
.storefront-add-button:disabled { box-shadow: none; }
.storefront-cart-dialog::backdrop,
.storefront-cart-confirm::backdrop { animation: cart-backdrop-in 180ms ease-out both; }
.storefront-cart-dialog[open] .storefront-cart-drawer { animation: cart-rise-in 320ms var(--storefront-ease) both; }
.storefront-cart-drawer { background: #fffefa; }
.storefront-cart-header { padding-block: 1.2rem; background: linear-gradient(110deg, #fff8ed, #f4f8ed); }
.storefront-cart-header h2 { font-size: 1.65rem; letter-spacing: -0.04em; }
.storefront-cart-line { border-color: #e9dfd2; background: #ffffff; box-shadow: 0 0.35rem 0.9rem rgb(68 43 27 / 4%); }
.storefront-cart-line-media { background: linear-gradient(140deg, #ffe8c6, #e8f3df); }
.storefront-cart-line-name { font-size: 0.97rem; }
.storefront-cart-quantity { border-color: #dcd4c8; background: #fffaf3; }
.storefront-cart-quantity-button { min-height: 2.7rem; }
.storefront-cart-remove { min-height: 2.7rem; }
.storefront-cart-summary {
  padding-block: 1.1rem max(1.1rem, env(safe-area-inset-bottom));
  border-top-color: #eadfcc;
  background: #fff7e9;
  box-shadow: 0 -0.6rem 1.4rem rgb(68 43 27 / 5%);
}
.storefront-cart-summary strong { font-size: 1.55rem; }
.storefront-cart-summary p { font-size: 0.79rem; line-height: 1.45; }
.storefront-cart-whatsapp { min-height: 3.15rem; border-radius: 0.85rem; box-shadow: 0 0.45rem 0.9rem rgb(40 101 31 / 15%); }
.storefront-cart-whatsapp:disabled { box-shadow: none; }
.storefront-cart-confirm[open] > div { animation: cart-rise-in 280ms var(--storefront-ease) both; }
.storefront-toast { border-left: 0.3rem solid var(--brand-yellow); animation-duration: 220ms; }
.storefront-toast[data-tone="success"] { border-left-color: var(--brand-yellow); }
.storefront-toast[data-tone="warning"] { border-left-color: #ffffff; background: #a64710; }

@keyframes cart-rise-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cart-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cart-slide-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (min-width: 48rem) {
  .storefront-cart-dialog[open] .storefront-cart-drawer { animation-name: cart-slide-in; }
}
@media (max-width: 30rem) {
  .storefront-toast { bottom: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .storefront-cart-dialog::backdrop,
  .storefront-cart-confirm::backdrop,
  .storefront-cart-dialog[open] .storefront-cart-drawer,
  .storefront-cart-confirm[open] > div { animation: none; }
}
