/* =========================================================
   Mini carrito lateral — Astra + WooCommerce
   ========================================================= */

:root {
  --ac-ink: #000000;
  --ac-muted: #6e6e6e;
  --ac-line: #e3e3e3;
  --ac-line-soft: #efefef;
  --ac-accent: #983238;
  --ac-accent-dark: #983238;
  --ac-radius: 6px;
  --ac-width: 440px;
}

.ac-cart p,
.ac-cart a,
.ac-cart span,
.ac-cart div,
.ac-cart h2 {
  font-family: 'SF Pro Display' !important;
}

/* ---------- Overlay ---------- */

.ac-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  z-index: 99998;
}

.ac-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

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

/* ---------- Panel ---------- */

.ac-cart {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 600px;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  z-index: 99999;
  color: var(--ac-ink);
  font-size: 16px;
  line-height: 1.45;
}

.ac-cart.is-open {
  transform: translateX(0);
}

.ac-cart *,
.ac-cart *::before,
.ac-cart *::after {
  box-sizing: border-box;
}

/* ---------- Cabecera ---------- */

.ac-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 20px;
  flex: 0 0 auto;
}

.ac-cart__title {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ac-ink);
}

.ac-cart__close {
  background: none;
  border: 0;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  color: var(--ac-ink);
  line-height: 0;
  border-radius: 4px;
  transition: opacity 0.2s ease;
}

.ac-cart__close:hover {
  opacity: 0.6;
}

.ac-cart__close:focus-visible {
  outline: 2px solid var(--ac-ink);
  outline-offset: 2px;
}

/* ---------- Cuerpo ---------- */

.ac-cart__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  transition: opacity 0.2s ease;
}

.ac-cart__body.is-loading {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- Listado ---------- */

.ac-cart__items {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ac-item {
  display: flex;
  gap: 20px;
  padding: 12px 32px 24px;
  margin: 0;
}

/* Imagen */

.ac-item__media {
  flex: 0 0 120px;
  width: 120px;
}

.ac-item__media a,
.ac-item__media img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 3px;
  margin: 0;
}

/* Bloque de texto */

.ac-item__info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.ac-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ac-item__text {
  min-width: 0;
}

.ac-item__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ac-ink);
}

.ac-item__title a {
  color: inherit;
  text-decoration: none;
}

.ac-item__subtitle {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 400;
  color: var(--ac-ink);
  line-height: 1.35;
}

.ac-item__meta {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--ac-muted);
  line-height: 1.5;
}

.ac-item__meta li {
  margin: 0;
}

.ac-item__remove {
  flex: 0 0 auto;
  background: none;
  border: 0;
  padding: 0;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ac-ink);
  text-decoration: underline;
  cursor: pointer;
}

.ac-item__remove:hover {
  opacity: 0.6;
}

/* Fila inferior: cantidad + precio */

.ac-item__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.ac-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius);
  height: 34px;
  overflow: hidden;
}

.ac-qty .ac-qty__input {
  padding: 0.5em !important;
  border: none !important;
}

.ac-qty__btn {
  width: 28px;
  height: 100%;
  background: none;
  border: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--ac-ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.ac-qty__btn:hover {
  background: #ffffff;
}

.ac-qty__input {
  width: 26px;
  height: 100%;
  border: 0;
  background: none;
  text-align: center;
  font-size: 14px;
  color: var(--ac-ink);
  padding: 0;
  -moz-appearance: textfield;
  box-shadow: none;
  border: none;
  font-weight: 500;
}

.ac-qty__input:focus {
  outline: none;
  box-shadow: none;
}

.ac-item__price {
  text-align: right;
  line-height: 1.3;
}

.ac-item__amount {
  display: block;
  font-size: 17px;
  font-weight: 500;
  color: var(--ac-ink);
  white-space: nowrap;
}

.ac-item__tax {
  display: block;
  font-size: 12px;
  color: var(--ac-muted);
}

/* ---------- Pie ---------- */

.ac-cart__footer {
  flex: 0 0 auto;
  padding: 24px 32px 32px;
  border-top: 1px solid var(--ac-line-soft);
  background: #fff;
}

.ac-cart__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ac-cart__total-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--ac-ink);
}

.ac-cart__total-label small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ac-muted);
  margin-left: 4px;
}

.ac-cart__total-amount {
  font-size: 22px;
  font-weight: 600;
  color: var(--ac-ink);
  white-space: nowrap;
}

.ac-cart__note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ac-muted);
}

.ac-cart__checkout {
  display: block;
  margin-top: 20px;
  padding: 8px 20px;
  background: var(--ac-accent);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 18px;
  font-weight: 400;
  border-radius: var(--ac-radius);
  transition: background 0.2s ease;
}

.ac-cart__checkout:hover,
.ac-cart__checkout:focus {
  background: var(--ac-accent-dark);
  color: #fff;
}

/* ---------- Carrito vacío ---------- */

.ac-cart__empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
  color: var(--ac-muted);
}

.ac-cart__empty .ac-cart__checkout {
  margin-top: 24px;
}

/* ---------- Contador opcional en la cabecera ---------- */

.ac-cart-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  background: var(--ac-accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  .ac-cart__header {
    padding: 20px 20px 16px;
  }

  .ac-item {
    padding: 12px 20px 20px;
    gap: 14px;
  }

  .ac-item__media {
    flex-basis: 92px;
    width: 92px;
  }

  .ac-item__media a,
  .ac-item__media img {
    height: 116px;
  }

  .ac-cart__footer {
    padding: 20px 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ac-cart,
  .ac-cart-overlay,
  .ac-cart__body {
    transition: none;
  }
}

/* ---------- Carrito vacío ---------- */
.ac-cart__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-height: 340px;
  padding: 40px 32px;
  text-align: center;
}
.ac-cart__empty-img {
  width: 100%;
  max-width: 210px;
  height: auto;
  display: block;
  opacity: 0.5;
}
.ac-cart__empty-text {
  margin: 0;
  font-size: 16px;
  color: #d3d3d3;
  font-family: 'SF Pro Display' !important;
}

.ast-mini-cart-empty {
  display: none;
}

/* Botón cerrar */
.searchwp-popup {
  position: relative;
}
.searchwp-popup__close {
  position: absolute;
  top: 14px;
  right: 32px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #1a1a18;
  cursor: pointer;
  transition: background 0.18s ease;
}

/* Ver todos los resultados */
.searchwp-viewall {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e7e4de;
  text-align: center;
}
.searchwp-viewall__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a18;
  text-decoration: none;
}
.searchwp-viewall__btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
