/* ============================================================
   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.08); /* casi transparente: deja ver los colores reales del video */
}

/* ---------- 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;
}

/* título de vista: Vollkorn itálica bold en color primario */
.store-header h1,
.admin-header h1 {
  font-family: 'Vollkorn', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.25rem;
  color: #ed3978;
}

.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.8rem;
  text-decoration: none;
  color: #ed3978;
}

.icon-link:hover {
  text-decoration: underline;
}

/* ---------- portada ---------- */
.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 0;
  opacity: 1;
  transition: opacity 0.5s ease;
}

/* banda "Welcome to": #ed3978,100% de ancho,100px de alto */
.welcome-banner {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ed3978;
  color: #fff;
  font-family: 'Vollkorn', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1;
}

/* tarjeta de bienvenida: blanco al60% traslúcido */
.welcome-card {
  width: 100%;
  max-width: 560px;
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: left;
  color: var(--pico-color);
}

.home .home-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: clamp(1.5rem, 4vh, 3rem) 1.25rem 0;
}

.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 */
  padding: 1.25rem;
}

.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);
}

/* ---------- menú desplegable (esquina superior derecha) ---------- */
[x-cloak] {
  display: none !important;
}

.menu {
  position: fixed;
  top: 1.75rem; /* centro del ícono alineado con el texto "Welcome to" (banda de100px) */
  right: 0.9rem;
  z-index: 40;
  display: block; /* Pico fuerza flex en nav */
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  margin: 0;
  padding: 0.35rem;
  border: 0;
  border-radius: 50%;
  background: transparent; /* solo la flor, sin círculo */
  box-shadow: none;
  transition: transform 0.15s ease;
}

.menu-toggle:hover {
  background: transparent;
  transform: scale(1.08);
}

.menu-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* selector con más especificidad que `nav ul` de Pico (display:flex en fila) */
.menu .menu-list {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  min-width: 190px;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
}

.menu .menu-list a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--pico-color);
}

.menu .menu-list a:hover {
  background: rgba(237, 57, 120, 0.1);
  color: #ed3978;
}

/* ---------- tabs del admin ---------- */
.admin-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.admin-tab {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--pico-muted-color);
}

.admin-tab:hover {
  color: #ed3978;
  border-color: #ed3978;
}

.admin-tab.is-active {
  background: #ed3978;
  border-color: #ed3978;
  color: #fff;
}

/* ---------- admin ---------- */
.admin {
  /* Pico más compacto, scoped solo al panel */
  --pico-spacing: 0.6rem;
  --pico-block-spacing: 0.7rem;
  --pico-grid-spacing: 0.6rem;
  --pico-form-element-spacing-vertical: 0.35rem;
  --pico-form-element-spacing-horizontal: 0.6rem;
}

.admin-body {
  max-width: 900px;
  margin: 0 auto;
  padding: calc(3rem + 0.85rem) 1rem 3rem;
  font-size: 0.9rem;
}

.admin-forms {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.admin-form {
  margin: 0;
}

.admin-form fieldset {
  height: 100%;
  margin: 0;
  padding: 0.75rem 0.9rem 0.95rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.admin-form legend {
  font-family: 'Vollkorn', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.05rem;
  color: #ed3978;
}

.admin label {
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  color: var(--pico-muted-color);
}

.admin input,
.admin textarea,
.admin select {
  font-size: 0.85rem;
  border-radius: 8px;
}

.admin textarea {
  resize: vertical;
}

.admin button {
  padding: 0.4rem 0.95rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.table-title {
  margin: 1.25rem 0 0.6rem;
  font-size: 0.95rem;
}

.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: 12px;
  background: rgba(255, 255, 255, 0.94);
}

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

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

.admin tbody td {
  padding: 0.45rem 0.6rem;
  vertical-align: middle;
}

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

/* placeholder cuando el integrante no tiene foto */
.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(237, 57, 120, 0.08);
  font-family: 'Vollkorn', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1rem;
  color: #ed3978;
}

.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--pico-muted-border-color);
  font-family: 'Vollkorn', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
  color: #ed3978;
}

.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.3rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  border-radius: 6px;
}

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

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

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

.flash {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  background: transparent;
}

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

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

/* ---------- dialog edición ---------- */
dialog {
  width: 100%;
  max-width: 360px;
  padding: 1.1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 14px;
}

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

dialog h3 {
  margin-bottom: 0.75rem;
  font-size: 0.98rem;
}

dialog label {
  font-size: 0.78rem;
}

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;
  }

  .admin-forms {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
