/* Interacciones y acento menta de la entrega v61. */
:root {
  --mint: #6fd1c5;
  --mint-deep: #238b80;
  --mint-ink: #0d4f49;
  --mint-wash: rgba(111, 209, 197, .12);
}

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

.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  backdrop-filter: blur(16px) saturate(135%);
}

.catalog-heading-meta {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.catalog-connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(111, 209, 197, .34);
  border-radius: 999px;
  background: var(--mint-wash);
  color: #9fe4dc;
  font-size: 11px;
  font-weight: 700;
}

.catalog-connection span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(111, 209, 197, .13);
}

.light-mode .catalog-connection {
  color: var(--mint-ink);
  background: #e8f8f5;
}

.search {
  position: relative;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.search:focus-within {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(111, 209, 197, .12), 0 12px 28px rgba(0, 0, 0, .16);
  transform: translateY(-1px);
}

.clear-search {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(111, 209, 197, .12);
  color: var(--mint);
  font-size: 20px;
  cursor: pointer;
}

.clear-search[hidden] { display: none; }

.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: stretch;
  margin-top: 14px;
}

.sort-control,
.catalog-tool {
  min-height: 42px;
  border: 1px solid #633046;
  border-radius: 12px;
  background: #24131c;
  color: #fff7fa;
  font: 700 12px "DM Sans", sans-serif;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px 0 14px;
}

.sort-control span { color: #d6acbc; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }
.sort-control select { border: 0; outline: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sort-control option { background: #24131c; color: #fff7fa; }

.catalog-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.catalog-tool:hover { transform: translateY(-2px); border-color: #a84a70; }
.catalog-tool span { font-size: 17px; line-height: 1; }
.catalog-tool b { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 999px; background: #4b2435; font-size: 10px; }
.catalog-tool[aria-pressed="true"] { border-color: #e83f7a; background: #40182a; color: #ffb1cb; }
.catalog-tool-mint { border-color: rgba(111, 209, 197, .5); color: #a6e8e0; }
.catalog-tool-mint:hover { border-color: var(--mint); background: rgba(111, 209, 197, .1); }

.light-mode .sort-control,
.light-mode .catalog-tool {
  border-color: #ead7df;
  background: #fff;
  color: #3b2830;
  box-shadow: 0 5px 14px rgba(75, 23, 44, .05);
}

.light-mode .sort-control span { color: #866a75; }
.light-mode .sort-control option { background: #fff; color: #3b2830; }
.light-mode .catalog-tool b { background: #f8e7ee; }
.light-mode .catalog-tool[aria-pressed="true"] { border-color: #e83f7a; background: #fff1f6; color: #ad1f56; }
.light-mode .catalog-tool-mint { border-color: #a8ded8; color: var(--mint-ink); }
.light-mode .catalog-tool-mint:hover { background: #eaf9f7; }

.card {
  position: relative;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity .34s ease, transform .34s ease, box-shadow .22s ease, border-color .22s ease;
}

.card.is-visible { opacity: 1; transform: translateY(0); }
.card:hover { border-color: rgba(111, 209, 197, .45); }

.favorite-button {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(47, 24, 34, .11);
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: #8e6877;
  box-shadow: 0 6px 16px rgba(56, 20, 35, .12);
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform .18s ease, color .18s ease, background .18s ease;
}

.favorite-button:hover { transform: scale(1.08); }
.favorite-button[aria-pressed="true"] { background: #e83f7a; color: #fff; }

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.quick-cart-button,
.card-actions .buy-button {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 7px;
  border-radius: 9px;
  font: 700 10px "DM Sans", sans-serif;
  text-align: center;
}

.quick-cart-button {
  border: 1px solid rgba(111, 209, 197, .55);
  background: rgba(111, 209, 197, .1);
  color: #a5e8e0;
  cursor: pointer;
}

.quick-cart-button:hover { border-color: var(--mint); background: rgba(111, 209, 197, .19); }
.light-mode .quick-cart-button { background: #eaf9f7; color: var(--mint-ink); }

.products-grid.is-compact { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.products-grid.is-compact .product-image { height: 175px; }
.products-grid.is-compact .card-content { padding: 12px; }
.products-grid.is-compact .product-name { min-height: 36px; font-size: 12px; }

.card.is-surprise {
  animation: surprisePulse 1.15s ease;
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(111, 209, 197, .13), 0 18px 38px rgba(0, 0, 0, .28);
}

.catalog-toast {
  position: fixed;
  z-index: 300;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100% - 32px));
  padding: 14px 17px;
  border: 1px solid rgba(111, 209, 197, .55);
  border-radius: 14px;
  background: #17302e;
  color: #eafffc;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .34);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
}

.catalog-toast.is-visible { opacity: 1; transform: translateY(0); }
.light-mode .catalog-toast { background: #f1fffd; color: var(--mint-ink); box-shadow: 0 16px 38px rgba(44, 100, 93, .2); }

.product-favorite {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid #633046;
  border-radius: 999px;
  background: #301723;
  color: #ffd5e3;
  font: 700 11px "DM Sans", sans-serif;
  cursor: pointer;
}

.product-favorite[aria-pressed="true"] { border-color: var(--mint); color: #a5e8e0; }
.light-mode .product-favorite { border-color: #ead7df; background: #fff; color: #8d3658; }
.light-mode .product-favorite[aria-pressed="true"] { border-color: #9ddbd4; color: var(--mint-ink); background: #eaf9f7; }

.related-products { max-width: 1380px; margin: 34px auto 0; }
.related-products-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.related-products-heading h2 { margin: 0; font: 700 clamp(26px, 3vw, 36px) "Playfair Display", serif; }
.related-products-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.related-products-track { display: grid; grid-auto-columns: minmax(200px, 1fr); grid-auto-flow: column; gap: 13px; overflow-x: auto; padding: 3px 3px 16px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--mint) transparent; }
.related-product { display: grid; min-width: 0; grid-template-columns: 74px 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px solid #623248; border-radius: 15px; background: #24141d; color: #fff7fa; text-decoration: none; scroll-snap-align: start; transition: transform .18s ease, border-color .18s ease; }
.related-product:hover { transform: translateY(-2px); border-color: var(--mint); }
.related-product img,.related-product-photo { display: grid; width: 74px; height: 74px; place-items: center; border-radius: 11px; background: #fff; object-fit: contain; color: #a96781; font-size: 9px; text-align: center; }
.related-product strong { display: -webkit-box; overflow: hidden; font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.related-product div > span { display: block; margin-top: 7px; color: var(--mint); font-size: 13px; font-weight: 700; }
.light-mode .related-product { border-color: #f0e4e7; background: #fff; color: #20171b; }

.cart-item { transition: border-color .18s ease, transform .18s ease; }
.cart-item:hover { border-color: rgba(111, 209, 197, .4); transform: translateX(2px); }

@keyframes surprisePulse {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-5px) scale(1.015); }
}

@media (max-width: 1050px) {
  .products-grid.is-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .products-grid.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-controls { flex-wrap: nowrap; margin-right: -24px; padding-right: 24px; overflow-x: auto; scrollbar-width: none; }
  .catalog-controls::-webkit-scrollbar { display: none; }
  .sort-control,.catalog-tool { flex: 0 0 auto; }
  .related-products { margin-top: 26px; }
}

@media (max-width: 620px) {
  .catalog-heading-meta { justify-items: start; }
  .catalog-controls { margin-right: -16px; padding-right: 16px; }
  .density-toggle { display: none; }
  .products-grid.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products-grid.is-compact .product-image { height: 158px; }
  .favorite-button { top: 7px; right: 7px; width: 32px; height: 32px; font-size: 18px; }
  .card-actions { grid-template-columns: 1fr; }
  .quick-cart-button,.card-actions .buy-button { width: 100%; min-height: 36px; }
  .catalog-toast { right: 16px; bottom: 76px; }
  .related-products-heading { display: block; }
  .related-products-heading p { margin-top: 6px; }
  .related-products-track { grid-auto-columns: minmax(235px, 82vw); }
}

@media (max-width: 390px) {
  .categories,
  .catalog-controls { margin-right: -12px; padding-right: 12px; }
  .products-grid.is-compact { grid-template-columns: 1fr; }
  .products-grid.is-compact .product-image { height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { opacity: 1; transform: none; }
  .card,.catalog-tool,.catalog-toast,.favorite-button,.cart-item,.related-product { transition: none; }
  .card.is-surprise { animation: none; }
}
