/* ============================================================
   Aduchi · mobile first · super clean
   ============================================================ */

html {
  background-color: #e9edf0;
}

body {
  background: transparent;
  min-height: 100dvh;
}

/* ---------- color primario: #ed3978 (botones, links, acentos) ---------- */
:root[lang][data-theme="light"]:not([data-theme="dark"]) {
  --pico-primary: #ed3978;
  --pico-primary-background: #ed3978;
  --pico-primary-border: #ed3978;
  --pico-primary-hover: #d42b68;
  --pico-primary-hover-background: #d42b68;
  --pico-primary-hover-border: #d42b68;
  --pico-primary-focus: rgba(237, 57, 120, 0.35);
  --pico-primary-underline: rgba(237, 57, 120, 0.3);
  --pico-primary-hover-underline: rgba(212, 43, 104, 0.5);
  --pico-primary-inverse: #fff;
}

/* ---------- fondo vivo ---------- */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-video .veil {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.66);
}

/* ---------- pantalla de carga ---------- */
.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: transparent; /* deja ver el video vivo de fondo */
  opacity: 1;
  transition: opacity 0.4s ease;
}

.loader-screen.is-out {
  opacity: 0;
  pointer-events: none;
}

/* la portada permanece oculta mientras el loader está activo */
body.is-loading .home {
  opacity: 0;
}

.loader-screen img {
  width: min(50vw, 200px);
  height: auto;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: #ed3978;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- header fixed ---------- */
.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  min-height: 3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.page-header h1 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--pico-color);
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
}

.icon-btn:hover {
  background: #ed3978;
  color: #fff;
  border-color: transparent;
}

.icon-link {
  margin: 0 0 0 auto;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--pico-muted-color);
}

/* ---------- portada ---------- */
.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: clamp(1.75rem, 5vh, 3.5rem) 1.25rem 1.25rem;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.home .home-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.home .welcome {
  margin: 0;
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--pico-color);
}

.home .hero {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home .full-logo {
  width: min(88vw, 560px);
  height: auto;
}

.home .home-bottom {
  width: 100%;
  margin-top: auto; /* empuja el botón al pie de la pantalla */
}

.home .cta {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

/* ---------- listado de productos ---------- */
.store {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(3rem + 1rem) 1rem 2.5rem;
}

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

.product {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.product img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.product .price {
  margin: 0;
  padding: 0.6rem 0.7rem 0;
  font-size: 1rem;
  font-weight: 700;
}

.product .desc {
  margin: 0;
  padding: 0.25rem 0.7rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--pico-muted-color);
}

.empty {
  margin: 2rem 0 0;
  padding: 1.25rem;
  text-align: center;
  border: 1px dashed var(--pico-muted-border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--pico-muted-color);
}

/* ---------- login ---------- */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.login-card {
  width: 100%;
  max-width: 360px;
  margin: 0;
  padding: 1.75rem 1.35rem 1.35rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.login-card .login-logo {
  width: 84px;
  height: auto;
  margin-bottom: 0.5rem;
}

.login-card h1 {
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
}

.login-card label {
  text-align: left;
  font-size: 0.85rem;
}

.login-card .back-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

/* ---------- admin ---------- */
.admin-body {
  max-width: 900px;
  margin: 0 auto;
  padding: calc(3rem + 1rem) 1rem 3rem;
}

.admin-form {
  margin-bottom: 1.75rem;
}

.admin-form fieldset {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.admin-form legend {
  font-size: 0.95rem;
  font-weight: 600;
}

.table-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
}

.table-title small {
  color: var(--pico-muted-color);
  font-weight: 400;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.admin table {
  margin: 0;
  font-size: 0.85rem;
}

.admin thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pico-muted-color);
}

.thumb {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--pico-muted-border-color);
}

.nowrap {
  white-space: nowrap;
}

.actions {
  white-space: nowrap;
  text-align: right;
}

.actions form {
  display: inline-block;
  margin: 0;
}

.actions button {
  margin: 0 0 0 0.35rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
}

.edit-btn {
  background: #ed3978;
  color: #fff;
  border: 0;
}

.edit-btn:hover {
  background: #d42b68;
}

/* ---------- flashes ---------- */
.flash-area {
  margin-bottom: 1rem;
}

.flash {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  background: transparent;
}

.flash-ok {
  background: #e4f6ea;
  color: #12633a;
}

.flash-error {
  background: #fdeaea;
  color: #8a1f1f;
}

/* ---------- dialog edición ---------- */
dialog {
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 16px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

dialog h3 {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

dialog label {
  font-size: 0.85rem;
}

.dialog-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.dialog-actions button {
  flex: 1;
  margin: 0;
}

/* ---------- desktop ---------- */
@media (min-width: 700px) {
  .store {
    padding-top: calc(3rem + 1.5rem);
  }

  .product .desc {
    font-size: 0.82rem;
  }
}
