/* =====================================================
   TIENDA — jayroanghelo
   ===================================================== */

.store-hero {
  padding: clamp(30px, 6vw, 72px) 0 clamp(28px, 5vw, 56px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.store-hero-content {
  max-width: 620px;
}
.store-kicker {
  margin: 0 0 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.store-hero-desc {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.5;
  font-weight: 500;
  margin: 0 auto;
  max-width: 39ch;
}

/* ---- Barra de herramientas (búsqueda + orden) ---- */
.shop-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 clamp(18px, 2.4vw, 26px);
}
.shop-search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.shop-search:focus-within { border-color: color-mix(in oklab, var(--border) 50%, var(--text)); }
.shop-search svg { flex: 0 0 auto; color: var(--muted); }
.shop-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: .95rem; color: var(--text);
}
.shop-sort {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  padding: 11px 16px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}

/* ---- FILTER BAR PREMIUM ---- */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: .8rem clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 85%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
}
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
}
.filter-pill-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.filter-pill-group.align-right {
  margin-left: auto;
}
.fp-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--muted);
  margin-right: .2rem;
}
.fp-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: inherit;
}
.fp-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
}
.fp-btn.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.c-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.1);
}
.fp-select {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  padding: .2rem;
  outline: none;
  font-family: inherit;
}
.fp-select option {
  background: var(--surface);
  color: var(--text);
}

/* ---- CATALOG ---- */
.store-catalog {
  padding: 0 clamp(16px, 3vw, 40px) 64px;
}
.page-wrap.store-catalog {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 72px;
}
.page-wrap.store-catalog > .store-catalog {
  padding-inline: 0;
  padding-top: 0;
}
.productos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* móvil por defecto */
  gap: clamp(12px, 2vw, 22px);
  margin: 0;
  padding: 0;
  min-height: 200px;
}

/* ---- CARD ---- */
.card {
  position: relative;
  min-width: 0;
}
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover .card-link {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .10);
  border-color: color-mix(in oklab, var(--border) 55%, var(--text));
}
.card-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.card-img {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: color-mix(in oklab, var(--surface) 55%, #e8e8ec);
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2, .9, .2, 1);
  -webkit-user-drag: none;
}
.card:hover .card-img img {
  transform: scale(1.05);
}
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: .3rem .55rem;
  border-radius: 999px;
  pointer-events: none;
}
.card-badge.badge-new { background: var(--text); color: var(--bg); }
.card-badge.badge-limited { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.card-body {
  position: static;
  inset: auto;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px 14px;
  min-height: 0;
}
.card-title {
  color: var(--text);
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta { display: none; }
.card-price {
  color: var(--text);
  font-size: .92rem;
  font-weight: 600;
  margin-top: 2px;
}
.card-price.price-tbd {
  color: var(--muted);
  font-weight: 500;
  font-style: normal;
  font-size: .88rem;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state svg {
  opacity: .3;
  margin-bottom: 1rem;
}
.empty-state p {
  font-size: 1.05rem;
}

/* =====================================================
   CART DRAWER
   ===================================================== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.4);
  backdrop-filter: blur(8px);
  z-index: 1300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.cart-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(420px, 100vw);
  z-index: 1400;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(30px) saturate(200%);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 48px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .2s cubic-bezier(.2,.9,.2,1);
}
.cart-drawer.open {
  transform: translateX(0);
}
.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.cart-count-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}
.cart-close-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
  transition: background .15s;
}
.cart-close-btn:hover {
  background: rgba(0,0,0,.05);
}
.cart-list {
  flex: 1;
  overflow-y: auto;
  padding: .6rem 0;
}
.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: .7rem;
  padding: .85rem 1.2rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  align-items: start;
}
.cart-item:last-child {
  border-bottom: none;
}
.cart-item img {
  width: 76px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(0,0,0,.03);
}
.cart-item-info h4 {
  margin: 0 0 .2rem;
  font-size: .92rem;
  font-weight: 700;
}
.cart-item-info .item-size {
  font-size: .78rem;
  color: var(--muted);
}
.cart-item-info .item-price {
  font-size: .9rem;
  font-weight: 700;
  margin-top: .35rem;
  color: var(--brand-2);
}
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .5rem;
}
.cart-item-qty button {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.02);
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.cart-item-qty button:hover {
  background: rgba(0,0,0,.08);
}
.cart-item-qty span {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
}
.cart-item-del {
  background: transparent;
  border: none;
  color: color-mix(in oklab, var(--muted) 70%, transparent);
  cursor: pointer;
  padding: .3rem;
  border-radius: 8px;
  transition: color .15s, background .15s;
  display: grid;
  place-items: center;
}
.cart-item-del:hover {
  color: #ff4d4d;
  background: rgba(255,77,77,.1);
}
.cart-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.cart-empty svg {
  opacity: .25;
  margin-bottom: 1rem;
}
.cart-drawer-footer {
  padding: 1.1rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .95rem;
  font-weight: 600;
}
.cart-total {
  font-size: 1.2rem;
  font-weight: 900;
}
.cart-price-note {
  margin: 0;
  font-size: .76rem;
  color: var(--muted);
  font-style: italic;
}
.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .9rem 1.2rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  background-size: 200% 200%;
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  text-decoration: none;
  transition: all .2s ease;
  font-family: inherit;
  box-shadow: var(--shadow-1);
}
.btn-checkout:hover {
  transform: scale(0.98);
  box-shadow: none;
}
.cart-insta-note {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
}

/* ========================================================
   FLOATING SEARCH BAR (APPLE GLASS)
   ======================================================== */
.floating-search-wrapper {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none; /* Let clicks pass through container */
  z-index: 90;
  padding: 0 16px;
  box-sizing: border-box;
}

.floating-search {
  pointer-events: auto; /* Enable clicks on the bar */
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px; /* Pill shape */
  padding: 8px 16px 8px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  gap: 12px;
  width: 100%;
  max-width: 480px;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
}

.floating-search:focus-within {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.search-icon {
  flex: 0 0 auto;
}

.search-input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  width: 100%;
  min-width: 0; /* Prevents flex blowout */
}

.search-input::placeholder {
  color: var(--muted);
}

.search-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex: 0 0 auto;
}

.search-select {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  padding-right: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}

/* =====================================================
   CART BADGE
   ===================================================== */
.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  background: var(--text);
  color: var(--bg);
  font-size: .7rem;
  font-weight: 900;
  border-radius: 999px;
  padding: 2px 6px;
  line-height: 1;
  min-width: 18px;
  text-align: center;
}
.cart-badge-mobile {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #c62828;
  color: #fff;
  font-size: .65rem;
  font-weight: 900;
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1;
  min-width: 16px;
  text-align: center;
}
#cart-btn { position: relative; }

/* =====================================================
   TOAST
   ===================================================== */
.toast {
  position: fixed;
  bottom: clamp(20px, 4vw, 30px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,.05);
  color: var(--text);
  padding: .65rem 1.1rem;
  border-radius: 14px;
  font-size: .88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 9999;
  box-shadow: var(--shadow-2);
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
/* Móvil (2 columnas) */
@media (max-width: 640px) {
  .store-hero {
    padding: 18px 0 16px;
  }
  .store-hero h1 { font-size: clamp(2.2rem, 12vw, 3rem); }
  .store-hero-desc { font-size: .95rem; margin-bottom: 1rem; }
  .trust-badge { font-size: .72rem; padding: .34rem .6rem; }
  .page-wrap.store-catalog { padding-bottom: 96px; }
  .productos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .productos-grid.is-single-product {
    grid-template-columns: minmax(0, 300px);
    justify-content: center;
  }
  .card-title { font-size: .9rem; }
  .card-price { font-size: .9rem; }
  .shop-sort { flex: 1; }
  .toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    white-space: normal;
    text-align: center;
  }
}

/* Tablet y escritorio: columnas automáticas de ancho fijo, centradas.
   Así las tarjetas mantienen su tamaño y quedan centradas tanto con 2
   productos como con muchos (no se amontonan ni se estiran). */
@media (min-width: 641px) {
  .productos-grid {
    grid-template-columns: minmax(260px, 360px);
    justify-content: center;
  }
  .page-wrap.store-catalog { padding-bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .card-img img,
  .card-link,
  .toast {
    transition: none;
  }
}

/* Prevent right-click on images */
.card-img img { pointer-events: none; }
