/* Mastec Digital — tienda.html (Tienda) specific styles */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Botón carrito en el header ---------- */
.header .container {
  gap: 22px;
}

.header .navmenu {
  margin-left: auto;
}

.cart-btn {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  border: none;
  background: rgba(251, 0, 68, 0.08);
  color: var(--red);
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.cart-btn:hover {
  background: var(--red);
  color: #fff;
}

.cart-btn.bump {
  animation: cartBump 0.45s var(--ease);
}

@keyframes cartBump {
  40% { transform: scale(1.18); }
}

.cart-btn__count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}

.cart-btn__count[hidden] {
  display: none;
}

@media (max-width: 991px) {
  .cart-btn {
    margin-left: auto;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .navmenu ul {
    gap: 22px;
  }
}

/* ---------- Tienda: layout (filtros + productos) ---------- */
.shop {
  padding: calc(var(--header-h) + 36px) 0 72px;
  background: var(--paper-2);
}

/* La tienda usa casi todo el ancho de la pantalla (más productos por fila). */
.shop .container {
  max-width: 1880px;
}

.shop-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* Columna de filtros */
.shop-filters {
  position: sticky;
  top: calc(var(--header-h) + var(--promo-h, 0px) + 16px);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(15, 15, 25, 0.04);
}

.shop-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.shop-filters__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.shop-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.shop-clear:hover {
  color: var(--red);
}

.shop-filters__group {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.shop-filters__group h3 {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.filter-cat i {
  width: 18px;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}

.filter-cat span:first-of-type {
  flex: 1;
}

.filter-cat__n {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.filter-cat:hover {
  background: rgba(251, 0, 68, 0.05);
  color: var(--red);
}

.filter-cat:hover i {
  color: var(--red);
}

.filter-cat.active {
  background: rgba(251, 0, 68, 0.08);
  color: var(--red);
  font-weight: 700;
}

.filter-cat.active i {
  color: var(--red);
}

.filter-cat.active .filter-cat__n {
  background: var(--red);
  color: #fff;
}

.shop-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--paper);
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.shop-select:focus {
  border-color: var(--red);
}

.shop-perks {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.shop-perks i {
  color: var(--red);
  margin-right: 6px;
}

/* Barra superior: buscador + cantidad */
.shop-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.store-search {
  position: relative;
  flex: 0 1 420px;
}

.store-search i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.store-search input {
  width: 100%;
  padding: 13px 18px 13px 46px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.store-search input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(251, 0, 68, 0.1);
}

.shop-count {
  margin: 0 0 0 auto;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.shop-count strong {
  color: var(--text);
}

.shop-filters-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

.shop-filters-btn[aria-expanded="true"] {
  border-color: var(--red);
  color: var(--red);
}

/* ---------- Grilla de productos ---------- */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.store-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
}

.prod-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  animation: prodIn 0.4s var(--ease) both;
}

@keyframes prodIn {
  from { opacity: 0; transform: translateY(12px); }
}

.prod-card:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 0, 68, 0.22);
  box-shadow: var(--shadow);
}

.prod-card__media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.prod-media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prod-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.prod-card:hover .prod-media img {
  transform: scale(1.04);
}

/* Capturas del sistema sobre fondo de marca */
.prod-media--shot,
.prod-media--phone,
.prod-media--icon {
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(135deg, #ff2a58 0%, var(--red-dark) 100%);
}

.prod-media--shot img {
  width: 86%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: left top;
  border-radius: 10px;
  border: 4px solid #1a1a24;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.prod-media--phone img {
  width: auto;
  height: 86%;
  object-fit: contain;
  border-radius: 22px;
  border: 5px solid #1a1a24;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.prod-media--icon i {
  font-size: clamp(4.5rem, 8vw, 6rem);
  color: #fff;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.3));
}

.prod-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.prod-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 14px 14px;
  text-align: center;
}

.prod-model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.prod-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.prod-name button {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-align: center;
}

.prod-name button:hover {
  color: var(--red);
}

.prod-brand {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--red);
}

.prod-variant {
  width: 100%;
}

.prod-variant select,
.pm-variant select {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--paper-2);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.pm-variant select {
  padding: 11px 14px;
  font-size: 0.9rem;
}

.prod-foot {
  margin-top: auto;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.prod-price {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 4px;
  line-height: 1.15;
}

.prod-price[hidden] {
  display: none;
}

.prod-price small {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.prod-price strong {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--red);
}

.prod-price span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.prod-old {
  width: 100%;
  font-size: 0.76rem;
  color: var(--text-muted);
}


.prod-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.prod-price:not([hidden]) + .prod-actions {
  margin-top: 10px;
}

/* Descuento sobre la foto (arriba a la derecha) */
.prod-discount {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.prod-discount i {
  font-size: 0.75rem;
}

.pm-media {
  position: relative;
}

.pm-media .prod-discount {
  top: 18px;
  right: auto;
  left: 18px;
  font-size: 1rem;
  padding: 7px 14px;
}

.prod-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--paper-3);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.prod-btn:hover {
  background: #e3e6ec;
}

.prod-btn--add:hover {
  background: var(--red);
  color: #fff;
}

/* Detalle: etiqueta de categoría */
.prod-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.shop-filters .shop-filters__close {
  display: none;
}

@media (max-width: 991px) {
  .shop {
    padding-top: calc(var(--header-h) + 18px);
  }

  .shop-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Filtros: panel que sale desde la izquierda */
  .shop-filters {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9600;
    width: min(320px, 86vw);
    overflow-y: auto;
    border: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    box-shadow: 20px 0 50px rgba(15, 15, 25, 0.2);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.35s var(--ease), visibility 0.35s;
  }

  .shop-filters.open {
    transform: none;
    visibility: visible;
  }

  .shop-filters__head {
    gap: 10px;
  }

  .shop-filters__head h2 {
    flex: 1;
  }

  .shop-filters .shop-filters__close {
    display: inline-flex;
    width: 36px;
    height: 36px;
  }

  /* Pestaña "Filtros" pegada al borde izquierdo */
  .shop-filters-btn {
    position: fixed;
    left: 0;
    top: 46%;
    z-index: 8002;
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 9px;
    border: none;
    border-radius: 0 12px 12px 0;
    background: linear-gradient(180deg, #ff2a58, var(--red-dark));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px var(--red-glow);
  }

  .shop-filters-btn span {
    writing-mode: vertical-rl;
  }

  .shop-filters-btn[aria-expanded="true"] {
    color: #fff;
  }

  .shop-top {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }

  .store-search {
    flex: 1 1 100%;
  }

  .shop-count {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  /* Tarjetas a todo el ancho de la pantalla, como Mastec Shop */
  .shop .container {
    padding: 0 10px;
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .prod-card {
    border-radius: 16px;
  }

  .prod-card__body {
    padding: 8px 8px 10px;
    gap: 4px;
  }

  /* Código en una sola línea (los largos se cortan con "…") */
  .prod-model {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .prod-model i {
    display: none;
  }

  /* Tarjeta compacta: solo código, nombre, precio y botones */
  .prod-brand,
  .prod-card .prod-variant {
    display: none;
  }

  .prod-model {
    font-size: 0.68rem;
    padding: 1px 8px;
  }

  /* Nombre en máximo 2 líneas: el recorte va sobre el botón (que es el que tiene el texto). */
  .prod-name {
    font-size: 0.85rem;
    width: 100%;
  }

  .prod-name button {
    display: -webkit-box;
    width: 100%;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .prod-foot {
    padding-top: 8px;
  }

  .prod-price {
    justify-content: flex-start;
  }

  .prod-price strong {
    font-size: 1.12rem;
  }

  .prod-price span {
    font-size: 0.68rem;
  }

  .prod-old {
    font-size: 0.7rem;
    text-align: left;
  }

  .prod-discount {
    top: 8px;
    right: 8px;
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  .prod-actions {
    gap: 6px;
  }

  .prod-btn {
    padding: 9px 4px;
    font-size: 1rem;
  }

  .prod-btn span {
    display: none;
  }

  .prod-tag {
    top: 8px;
    left: 8px;
    font-size: 0.6rem;
    padding: 3px 8px;
  }

  .prod-media--icon i {
    font-size: 3.5rem;
  }
}

/* ---------- Cómo comprar ---------- */
.store-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

.store-steps li {
  position: relative;
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  border: 1px solid var(--border);
}

.store-steps li > i {
  display: inline-flex;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #ff2a58, var(--red-dark));
  box-shadow: var(--shadow-red);
  margin-bottom: 18px;
}

.store-steps h3 {
  font-size: 1.2rem;
}

.store-steps p {
  margin: 0;
  color: var(--text-muted);
}

.store-step-num {
  position: absolute;
  top: 18px;
  right: 24px;
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(251, 0, 68, 0.1);
}

@media (max-width: 800px) {
  .store-steps {
    grid-template-columns: 1fr;
  }
}

/* ---------- Overlay y bloqueo de scroll ---------- */
body.store-locked {
  overflow: hidden;
}

.store-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(10, 10, 18, 0.55);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.store-overlay.open {
  opacity: 1;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: none;
  background: var(--paper-3);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.icon-btn:hover {
  background: var(--red);
  color: #fff;
}

/* ---------- Panel del carrito ---------- */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9600;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: -20px 0 50px rgba(15, 15, 25, 0.2);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.35s var(--ease), visibility 0.35s;
  outline: none;
}

.cart-drawer.open {
  transform: none;
  visibility: visible;
}

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.cart-drawer__head h2 {
  font-size: 1.3rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-drawer__head h2 i {
  color: var(--red);
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 22px;
}

.cart-empty {
  text-align: center;
  padding: 60px 10px;
  color: var(--text-muted);
}

.cart-empty[hidden] {
  display: none;
}

.cart-empty > i {
  font-size: 3rem;
  color: rgba(251, 0, 68, 0.3);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-thumb {
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  background: var(--paper-3);
}

.cart-thumb--shot {
  object-position: left top;
}

.cart-thumb--phone {
  object-fit: contain;
  background: linear-gradient(135deg, #ff2a58, var(--red-dark));
  padding: 4px;
}

.cart-thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.6rem;
  background: linear-gradient(135deg, #ff2a58, var(--red-dark));
}

.cart-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.cart-item__info strong {
  font-size: 0.9rem;
}

.cart-item__info small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.cart-item__price {
  margin-top: 4px;
  font-weight: 800;
  font-family: var(--font-heading);
}

.cart-item__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-remove {
  border: none;
  background: none;
  padding: 2px 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cart-remove:hover {
  color: var(--red);
}

/* Selector de cantidad */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.qty button {
  width: 38px;
  height: 40px;
  border: none;
  background: none;
  color: var(--text);
}

.qty button:hover {
  color: var(--red);
}

.qty input,
.qty span {
  width: 38px;
  text-align: center;
  border: none;
  font: inherit;
  font-weight: 700;
  background: none;
  -moz-appearance: textfield;
}

.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty--sm button {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

.qty--sm span {
  width: 24px;
  font-size: 0.88rem;
}

/* Pie: totales + datos + enviar */
.cart-drawer__foot {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--border);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 62vh;
  overflow-y: auto;
}

.cart-drawer__foot[hidden] {
  display: none;
}

.cart-totals div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cart-totals strong {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
}

.cart-note {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.cart-note i {
  color: var(--red);
}

.cart-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cart-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cart-fields__full {
  grid-column: 1 / -1;
}

.cart-fields input,
.cart-fields select,
.cart-fields textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--paper);
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  resize: vertical;
}

.cart-fields input:focus,
.cart-fields select:focus,
.cart-fields textarea:focus {
  border-color: var(--red);
}

.cart-error {
  margin: 0;
  color: var(--red);
  font-size: 0.84rem;
  font-weight: 600;
}

.cart-send {
  width: 100%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 24px rgba(18, 140, 68, 0.3);
}

.cart-send i {
  font-size: 1.2rem;
}

.cart-send:hover {
  background: #1fbd5a;
  transform: translateY(-2px);
}

.cart-clear {
  align-self: center;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cart-clear:hover {
  color: var(--red);
}

/* ---------- Detalle de producto ---------- */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 10, 18, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
  outline: none;
}

.product-modal.open {
  opacity: 1;
  visibility: visible;
}

.product-modal__box {
  position: relative;
  display: flex;
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s var(--ease);
}

.product-modal.open .product-modal__box {
  transform: none;
}

.product-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.product-modal__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  max-height: calc(100vh - 48px);
}

/* La foto se ajusta al alto de la ventana (no la estira): va en posición
   absoluta para que el alto lo marque el texto y nunca se corte. */
.pm-media {
  min-height: 460px;
  background: #f4f4f7;
}

.pm-media .prod-media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

.pm-media .prod-media--flyer img {
  object-fit: contain;
}

.pm-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 36px 32px 32px;
}

.pm-info h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: 0;
  padding-right: 36px;
}

.pm-summary {
  margin: 0;
  color: var(--text-muted);
}

.pm-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pm-specs li {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pm-specs i {
  color: var(--red);
  font-size: 1.1rem;
}

.pm-specs strong {
  display: block;
  color: var(--text);
  font-size: 0.86rem;
}

.pm-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.pm-buy .prod-price {
  justify-content: flex-start;
}

.pm-buy .prod-price strong {
  font-size: 1.8rem;
}

.pm-add {
  width: 100%;
}

.pm-link {
  align-self: center;
  color: var(--red);
  font-weight: 700;
  font-size: 0.88rem;
}

@media (max-width: 800px) {
  .product-modal {
    padding: 0;
    align-items: flex-end;
  }

  .product-modal__box {
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .product-modal__content {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: 92vh;
  }

  .pm-media {
    min-height: 0;
    height: min(42vh, 100vw);
  }

  .pm-info {
    padding: 24px 20px 28px;
  }
}

@media (max-width: 420px) {
  .pm-specs {
    grid-template-columns: 1fr;
  }
}

/* ---------- Aviso "agregado" ---------- */
.store-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9800;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 12px 12px 12px 16px;
  border-radius: 16px;
  background: #1a1a24;
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  pointer-events: none;
}

.store-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.store-toast > i {
  color: #25d366;
  font-size: 1.3rem;
}

.store-toast span {
  font-size: 0.8rem;
  color: var(--text-invert-muted);
  line-height: 1.35;
  min-width: 0;
}

.store-toast strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
}

.store-toast button {
  flex: none;
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .store-toast {
    bottom: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prod-card,
  .cart-btn.bump {
    animation: none;
  }
}
