/* ── MATITA VIVERO — Estilos compartidos ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --surface:     #fcf9f3;
  --surface-low: #f6f3ed;
  --surface-con: #f0eee8;
  --surface-high:#ebe8e2;
  --on-surface:  #1c1c18;
  --on-variant:  #414844;
  --outline:     #717973;
  --outline-var: #c1c8c2;
  --primary:     #012d1d;
  --primary-con: #1b4332;
  --on-primary:  #ffffff;
  --secondary:   #a0401f;
  --sec-con:     #fe8760;
  --leaf:        #40916c;
  --leaf-light:  #74c69d;
}

html, body { height: 100%; }

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--surface);
  color: var(--on-surface);
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
aside {
  width: 256px;
  border-right: 1px solid rgba(113,121,115,0.2);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  flex-shrink: 0;
  transition: width 0.25s ease, padding 0.25s ease;
  overflow: hidden;
}

aside.collapsed {
  width: 64px;
  padding: 1.5rem 0.75rem;
}

aside.collapsed .brand p,
aside.collapsed .nav-btn span,
aside.collapsed .brand h1,
aside.collapsed .user-info,
aside.collapsed #login-label {
  display: none;
}

aside.collapsed .nav-btn {
  justify-content: center;
  padding: 0.75rem;
}

aside.collapsed .nav-divider { display: none; }

.sidebar-toggle {
  position: absolute;
  top: 1.2rem;
  right: -12px;
  width: 24px; height: 24px;
  background: var(--surface);
  border: 1px solid rgba(113,121,115,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--outline);
  transition: color 0.2s;
}

.sidebar-toggle:hover { color: var(--primary); }

.brand { margin-bottom: 3rem; }

.brand h1 {
  font-family: 'Newsreader', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.brand p {
  font-size: 0.68rem;
  color: var(--outline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.nav-main { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }

.nav-btn {
  width: 100%;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: none; background: transparent;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.875rem; font-weight: 500;
  color: rgba(1,45,29,0.7);
  cursor: pointer;
  transition: all 0.25s;
  text-align: left;
  text-decoration: none;
}

.nav-btn:hover { background: var(--surface-con); }

.nav-btn.active {
  background: rgba(160,64,31,0.1);
  color: var(--secondary);
  font-weight: 600;
}

.nav-btn.active svg { color: var(--secondary); }
.nav-btn svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--primary); }

.nav-divider { height: 1px; background: rgba(113,121,115,0.1); margin: 1rem 0; }
.nav-bottom { display: flex; flex-direction: column; gap: 0.3rem; }

.user-info {
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface-con);
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

/* ── MAIN ── */
main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem;
  overflow-x: hidden;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--secondary);
  color: white; border: none;
  border-radius: 9999px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(160,64,31,0.25);
  transition: transform 0.15s, background 0.15s;
}

.btn-primary:hover { background: #8a3318; transform: scale(1.02); }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 9999px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}

.btn-outline:hover { background: var(--primary); color: white; }

/* ── PLANT CARDS ── */
.plants-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.plant-card {
  background: white;
  border-radius: 1.5rem;
  padding: 0.75rem;
  border: 1px solid rgba(113,121,115,0.1);
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.4s, transform 0.3s;
}

.plant-card:hover {
  box-shadow: 0 20px 60px rgba(1,45,29,0.1);
  transform: translateY(-3px);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 1.2rem;
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--surface-con);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}

.card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s;
}

.plant-card:hover .card-img-wrap img { transform: scale(1.1); }

.card-light-badge {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  padding: 0.3rem 0.75rem; border-radius: 9999px;
  display: flex; align-items: center; gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-light-badge span {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--primary);
}

.card-body { flex: 1; padding: 0 0.5rem; }

.card-name {
  font-family: 'Newsreader', serif;
  font-size: 1rem; font-weight: 500;
  color: var(--primary); margin-bottom: 0.4rem;
  line-height: 1.2;
}

.card-desc {
  font-size: 0.8rem; color: rgba(1,45,29,0.6);
  line-height: 1.55; margin-bottom: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-footer {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.4rem; margin-top: 0.8rem; padding: 0.3rem;
}

.card-tag {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.25rem 0.7rem; border-radius: 9999px;
  background: var(--surface-con); color: var(--outline);
}

.card-arrow {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: 50%; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--secondary); border: none; cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.plant-card:hover .card-arrow { background: var(--secondary); color: white; }

/* ── FILTERS & SEARCH ── */
.filters-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }

.chip {
  padding: 0.35rem 0.9rem; border-radius: 9999px;
  border: 1px solid var(--outline-var);
  background: white; font-size: 0.75rem;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-variant); cursor: pointer; transition: all 0.15s;
}

.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.activo { background: var(--primary); color: white; border-color: var(--primary); }

.search-row { position: relative; margin-bottom: 1rem; }

.search-row svg {
  position: absolute; left: 1rem; top: 50%;
  transform: translateY(-50%); width: 15px; height: 15px; color: var(--outline);
}

.search-input {
  width: 100%; padding: 0.7rem 1rem 0.7rem 2.5rem;
  border: 1px solid var(--outline-var); border-radius: 9999px;
  font-family: 'Be Vietnam Pro', sans-serif; font-size: 0.9rem;
  background: white; outline: none; color: var(--on-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(1,45,29,0.08);
}

.conteo { font-size: 0.83rem; color: var(--outline); margin-bottom: 1.5rem; }
.conteo strong { color: var(--primary); }

/* ── SECTION HEADER ── */
.sec-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  border-bottom: 1px solid rgba(113,121,115,0.1);
  padding-bottom: 0.6rem; margin-bottom: 1rem;
}

.sec-header h2 {
  font-family: 'Newsreader', serif;
  font-size: 1.8rem; color: var(--primary); letter-spacing: -0.02em;
}

.btn-ver-todas {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(1,45,29,0.7); background: none; border: none;
  cursor: pointer; font-family: 'Be Vietnam Pro', sans-serif;
  transition: color 0.15s;
}

.btn-ver-todas:hover { color: var(--secondary); }
.btn-ver-todas svg { width: 16px; height: 16px; transition: transform 0.15s; }
.btn-ver-todas:hover svg { transform: translateX(3px); }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(28,28,24,0.55); backdrop-filter: blur(4px);
  z-index: 200; align-items: center; justify-content: center; padding: 1rem;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: white; border: 1px solid var(--outline-var);
  border-radius: 2rem; max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
}

.modal-img {
  width: 100%; aspect-ratio: 16/9;
  border-radius: 1.8rem 1.8rem 0 0; overflow: hidden;
  background: var(--surface-con);
  display: flex; align-items: center; justify-content: center; font-size: 5rem;
}

.modal-img img { width: 100%; height: 100%; object-fit: cover; }

.modal-body { padding: 1.5rem 1.8rem 2rem; }

.modal-tipo {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--leaf); margin-bottom: 0.4rem;
}

.modal-name {
  font-family: 'Newsreader', serif;
  font-size: 2rem; font-weight: 500; line-height: 1.15;
  color: var(--primary); margin-bottom: 0.2rem;
}

.modal-sci {
  font-family: 'Newsreader', serif; font-style: italic;
  color: var(--outline); font-size: 1rem; margin-bottom: 1.2rem;
}

.modal-pills { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }

.modal-pill {
  background: var(--surface-low); border: 1px solid var(--outline-var);
  border-radius: 0.75rem; padding: 0.5rem 1rem;
}

.modal-pill .et { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--outline); }
.modal-pill .val { font-size: 0.92rem; font-weight: 600; color: var(--on-surface); margin-top: 0.1rem; }

.modal-notes {
  background: var(--surface-low); border: 1px solid var(--outline-var);
  border-radius: 0.75rem; padding: 1rem;
  font-size: 0.88rem; color: var(--on-variant); line-height: 1.65;
}

.btn-close {
  margin-top: 1.2rem; background: var(--surface-con);
  border: 1px solid var(--outline-var); padding: 0.6rem 1.5rem;
  border-radius: 9999px; cursor: pointer;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 600; font-size: 0.86rem; color: var(--on-variant);
  transition: all 0.2s;
}

.btn-close:hover { background: var(--surface-high); }

/* ── EMPTY / LOADING ── */
.empty-state {
  grid-column: 1/-1; text-align: center;
  padding: 5rem 2rem; color: var(--outline);
}

.empty-state .bi { font-size: 3rem; margin-bottom: 1rem; }

.empty-state p {
  font-family: 'Newsreader', serif;
  font-size: 1.2rem; line-height: 1.6;
}

.loading { grid-column: 1/-1; text-align: center; padding: 5rem; color: var(--outline); }

.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--outline-var); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}

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

/* ── FOOTER ── */
.page-footer {
  margin-top: 6rem; padding-top: 3rem; padding-bottom: 3rem;
  border-top: 1px solid rgba(113,121,115,0.1);
  display: flex; justify-content: space-between; align-items: center;
}

.footer-badge {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; font-weight: 500;
}

.footer-copy {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--outline);
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .plants-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  aside { display: none; }
  main { max-width: 100vw; padding: 1.5rem; }
  .plants-grid { grid-template-columns: 1fr; }
}

/* ── MOBILE NAV ── */
.mobile-header {
  display: none;
  position: sticky; top: 0; z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid rgba(113,121,115,0.2);
  padding: 0.9rem 1.2rem;
  align-items: center;
  justify-content: space-between;
}

.mobile-brand {
  font-family: 'Newsreader', serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--primary);
}

.hamburger {
  background: none; border: none; cursor: pointer;
  padding: 0.3rem; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}

.mobile-menu {
  display: none;
  position: fixed; inset: 0; z-index: 200;
}

.mobile-menu.open { display: block; }

.mobile-menu-backdrop {
  position: absolute; inset: 0;
  background: rgba(28,28,24,0.4);
  backdrop-filter: blur(2px);
}

.mobile-menu-panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--surface);
  padding: 1.5rem;
  display: flex; flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

.mobile-menu-close {
  align-self: flex-end;
  background: none; border: none; cursor: pointer;
  color: var(--outline); padding: 0.3rem; margin-bottom: 1.5rem;
}

.mobile-menu-panel .brand { margin-bottom: 2rem; }

.mobile-menu-panel .nav-btn {
  padding: 0.8rem 1rem;
  font-size: 1rem;
}

@media (max-width: 900px) {
  aside { display: none; }
  .sidebar-toggle { display: none; }
  .mobile-header { display: flex; }
  main { padding: 1.5rem 1.2rem; }
}
