/* store.css — Tienda pública Sublima */

/* ── Topbar acciones ── */
.store-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.cart-btn {
  position: relative;
  background: rgba(22, 59, 138, 0.10);
  border: none;
  cursor: pointer;
  color: var(--accent);
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-btn:hover  { background: rgba(22, 59, 138, 0.18); }
.cart-btn:active { background: rgba(22, 59, 138, 0.32); }

.cart-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #DC2626;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cart-count.hidden { display: none; }

/* ── Hero tienda ── */
.store-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 32px 0 24px;
}

.store-hero__left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.store-hero h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  color: var(--text);
  margin: 0;
  line-height: 1.15;
}

.hero-accent { color: var(--accent); }

.store-hero__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}

.store-hero__link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  background: rgba(22, 59, 138, 0.08);
  border: 1px solid rgba(22, 59, 138, 0.15);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, border-color 0.15s;
}
.store-hero__link:hover {
  background: rgba(22, 59, 138, 0.14);
  border-color: rgba(22, 59, 138, 0.25);
}

/* Hero visual */
.store-hero__right { position: relative; }

.hero-visual {
  position: relative;
  height: 320px;
}

.hero-blob {
  position: absolute;
  right: -16px;
  top: 8px;
  width: 82%;
  height: 88%;
  background: linear-gradient(135deg, #DBEAFE 0%, #EEF2FF 100%);
  border-radius: 62% 38% 55% 45% / 48% 52% 58% 42%;
  z-index: 0;
  animation: blobBreath 8s ease-in-out infinite;
}

@keyframes blobBreath {
  0%, 100% { border-radius: 62% 38% 55% 45% / 48% 52% 58% 42%; transform: scale(1); }
  33%       { border-radius: 48% 52% 42% 58% / 55% 45% 62% 38%; transform: scale(1.02); }
  66%       { border-radius: 55% 45% 60% 40% / 42% 58% 48% 52%; transform: scale(0.98); }
}

.hero-dots {
  position: absolute;
  bottom: 8%;
  left: 0;
  width: 72px;
  height: 72px;
  background-image: radial-gradient(circle, rgba(22,59,138,0.25) 1.5px, transparent 1.5px);
  background-size: 11px 11px;
  z-index: 0;
  animation: dotsDrift 12s ease-in-out infinite;
}

@keyframes dotsDrift {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(4px, -6px); }
}

.hero-cards { position: absolute; inset: 0; z-index: 1; }

.hero-card {
  position: absolute;
  border-radius: 14px;
  background: #e8eef8;
  box-shadow: 0 8px 24px rgba(22,59,138,0.13);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

/* Float animations desfasadas por tarjeta */
.hero-card--a {
  width: 50%; height: 55%; top: 6%; right: 0;
  animation: heroFloat 6s ease-in-out infinite;
}
.hero-card--b {
  width: 42%; height: 48%; top: 2%; right: 53%;
  animation: heroFloat 5s ease-in-out infinite 1.2s;
}
.hero-card--c {
  width: 58%; height: 42%; bottom: 0; right: 16%;
  animation: heroFloat 7s ease-in-out infinite 0.6s;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-9px); }
}

.hero-card:hover {
  animation-play-state: paused;
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 24px 52px rgba(22,59,138,0.28);
  z-index: 10;
}

/* Capas de imagen para slide carrusel */
.hero-card__img {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: translateX(110%);
  transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.hero-card__img.is-contain  { background-size: contain; }
.hero-card__img.pos-center  { transform: translateX(0); }
.hero-card__img.pos-left    { transform: translateX(-110%); }

/* ── Features bar ── */
.store-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.store-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}

.store-feature div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.store-feature strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.store-feature span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Toolbar (filtros + búsqueda) ── */
.store-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.store-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.store-search input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  width: 220px;
  transition: border-color 0.15s;
}
.store-search input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Grid de productos ── */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.store-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.store-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(22, 59, 138, 0.10);
  border-color: rgba(22, 59, 138, 0.25);
}
.store-card__thumb {
  aspect-ratio: 4/3;
  background: linear-gradient(140deg, var(--accent-light), #DBEAFE);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.store-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.store-card__thumb svg { opacity: 0.35; }

.store-card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.store-card__cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.store-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}
.store-card__desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.store-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.store-card__price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-display);
}
.store-card__price.free { color: var(--muted); font-size: 0.85rem; font-weight: 600; }

.add-to-cart-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, transform 0.1s;
}
.add-to-cart-btn:hover { background: var(--accent-deep); }
.add-to-cart-btn:active { transform: scale(0.96); }
.add-to-cart-btn:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

/* Paginación */
.store-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 48px;
}
.page-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.page-btn:hover, .page-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Carrito drawer ── */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.cart-drawer[aria-hidden="false"] { pointer-events: all; }
.cart-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,0.45);
  opacity: 0;
  transition: opacity 0.25s;
}
.cart-drawer[aria-hidden="false"] .cart-drawer__backdrop { opacity: 1; }

.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: white;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 32px rgba(22,59,138,0.12);
}
.cart-drawer[aria-hidden="false"] .cart-drawer__panel { transform: translateX(0); }

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.cart-drawer__header h2 { font-size: 1.1rem; margin: 0; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cart-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cart-item__thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__info { flex: 1; }
.cart-item__name { font-weight: 700; font-size: 0.9rem; margin: 0 0 4px; }
.cart-item__price { font-size: 0.85rem; color: var(--muted); }
.cart-item__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.qty-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.1s;
}
.qty-btn:hover { background: var(--accent-light); }
.qty-display { font-weight: 700; font-size: 0.9rem; min-width: 20px; text-align: center; }
.remove-btn {
  background: #FEE2E2;
  border: none;
  color: #DC2626;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.1s;
}
.remove-btn:hover { background: #FECACA; }

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 0.95rem;
}

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  background: rgba(22, 59, 138, 0.07);
  border: 1px solid rgba(22, 59, 138, 0.13);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.cart-total strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.w-full { width: 100%; }

/* ── Modales ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal[aria-hidden="false"] { pointer-events: all; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,0.5);
  opacity: 0;
  transition: opacity 0.2s;
}
.modal[aria-hidden="false"] .modal__backdrop { opacity: 1; }
.modal__panel {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(8px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.22s;
  box-shadow: 0 24px 64px rgba(22,59,138,0.18);
}
.modal[aria-hidden="false"] .modal__panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}
.modal__close:hover { background: var(--surface); }

.modal__panel h2 { margin: 0 0 8px; font-size: 1.3rem; }

/* Auth forms */
.auth-step { display: flex; flex-direction: column; gap: 16px; }
.auth-step.hidden { display: none; }

.auth-step label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.auth-step input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
}
.auth-step input:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

.form-error {
  background: #FEE2E2;
  color: #DC2626;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
}
.form-error.hidden { display: none; }

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
}

.logged-info {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

/* Checkout */
.checkout-summary {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkout-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
}
.checkout-item strong { color: var(--text); }
.checkout-total {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.checkout-total span { color: var(--accent); font-family: var(--font-display); }

.checkout-notes-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.checkout-notes-label textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: vertical;
  color: var(--text);
}
.checkout-notes-label textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Fondo página tienda ── */
body {
  background: linear-gradient(160deg, #EEF2FF 0%, #F9FAFB 55%);
  min-height: 100vh;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .store-hero { grid-template-columns: 1fr; gap: 24px; }
  .store-hero__right { display: none; }
  .store-features { gap: 20px; }
}

@media (max-width: 640px) {
  .store-topbar-actions { gap: 8px; }
  .store-search input { width: 140px; }
  .store-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .store-toolbar { flex-direction: column; align-items: stretch; }
  .store-search input { width: 100%; }
  .store-features { display: none; }
}
