/* ============================================
   EL JARDÍN DE MARITZA — Premium Catalog CSS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ======== DESIGN TOKENS ======== */
:root {
  --green-deep: #2d5a27;
  --green-main: #3d6b32;
  --green-mid: #4e7c44;
  --green-light: #7aab6d;
  --green-pale: #c8e0c3;
  --terra-dark: #9b5e3b;
  --terra-main: #bf7d5e;
  --terra-light: #e0a882;
  --cream-deep: #f0e8d4;
  --cream-main: #fef9f0;
  --cream-light: #fffcf5;
  --text-dark: #1e2e1e;
  --text-mid: #3a523a;
  --text-soft: #617061;
  --text-muted: #8a9e89;
  --white: #ffffff;
  --shadow-sm: 0 2px 10px rgba(45, 90, 39, 0.08);
  --shadow-md: 0 8px 30px rgba(45, 90, 39, 0.12);
  --shadow-lg: 0 20px 60px rgba(45, 90, 39, 0.18);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-blur: blur(18px) saturate(150%);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-title: 'Playfair Display', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
}

/* ======== RESET & BASE ======== */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
}

html, body {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--cream-main);
  background-image: url('fondo.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background: linear-gradient(
    145deg,
    rgba(254, 249, 240, 0.55) 0%,
    rgba(200, 224, 195, 0.25) 50%,
    rgba(254, 249, 240, 0.55) 100%
  );
  z-index: -1;
  pointer-events: none;
}

/* ======== NAVBAR ======== */
.navbar {
  position: sticky; top: 0; z-index: 500;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: rgba(254, 252, 245, 0.92);
  border-bottom: 1px solid rgba(78, 124, 68, 0.15);
  box-shadow: 0 4px 24px rgba(45, 90, 39, 0.08);
}

.navbar-inner {
  max-width: 100%;
  margin: 0;
  padding: 8px 38px 8px 38px;
  height: auto;
  min-height: 100px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

/* COL 2 — Título central */
.nav-center {
  text-align: center;
  padding: 0 16px;
}

.nav-title {
  font-family: var(--font-title);
  font-size: 2.3rem;
  font-weight: 600;
  font-style: italic;
  color: var(--terra-main);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.nav-title em { font-style: italic; }

.nav-subtitle {
  font-size: 0.88rem;
  color: var(--text-soft);
  opacity: 0.9;
}

/* COL 3 — Derecha */
.nav-right {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Contenedor de los 3 cuadros */
.nav-boxes {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

/* Footer Info Grid */
.footer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

/* Info boxes */
.info-box {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Cuadro de envíos con la misma altura que la columna adyacente */
.info-box-tall {
  align-self: stretch;
  height: 100%;
}

.info-box-title {
  font-size: 0.72rem;
  color: var(--green-main);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 4px;
  margin-bottom: 2px;
  letter-spacing: 0.3px;
  width: 100%;
}

.info-box-sub {
  font-size: 0.68rem;
  color: #666;
  font-weight: 500;
}

.info-box-cards {
  max-height: 16px;
  width: auto;
  opacity: 0.85;
}

/* WhatsApp button */
.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #e9f9ee;
  border: 1.5px solid #25d366;
  color: #128c7e;
  border-radius: 20px;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.whatsapp-btn:hover {
  background: #25d366;
  color: white;
  transform: translateY(-1px);
}

/* ======== BARRA FLOTANTE DE ADMINISTRACIÓN ======== */
.admin-toolbar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(78,124,68,0.2);
  border-radius: 50px;
  padding: 8px 14px;
  box-shadow: 0 8px 30px rgba(45,90,39,0.18);
  transition: var(--transition);
}

.admin-toolbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid rgba(78,124,68,0.15);
  margin-right: 2px;
}

.nav-brand {
  display: flex; align-items: center; gap: 14px;
  flex-shrink: 0;
}

.nav-logo {
  height: 130px; width: auto;
  border-radius: 10px;
  object-fit: contain;
}

.nav-brand-text {
  display: flex; flex-direction: column;
}

.nav-brand-name {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-deep);
  line-height: 1.1;
}

.nav-brand-tagline {
  font-size: 0.7rem;
  color: var(--terra-main);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-spacer { flex: 1; }

.nav-actions {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

/* Search bar */
.nav-search {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(78,124,68,0.2);
  border-radius: 50px;
  padding: 7px 16px;
  gap: 8px;
  transition: var(--transition);
}

.nav-search:focus-within {
  border-color: var(--green-mid);
  background: white;
  box-shadow: 0 0 0 3px rgba(78,124,68,0.1);
}

.nav-search input {
  border: none; background: transparent;
  font-family: var(--font-body); font-size: 0.85rem;
  color: var(--text-dark); width: 160px;
  outline: none;
}

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

.nav-search svg { color: var(--text-muted); flex-shrink: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
  transition: var(--transition);
  white-space: nowrap;
}

.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--green-main);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--terra-main);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--terra-dark);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1.5px solid rgba(78,124,68,0.25);
}

.btn-ghost:hover {
  background: rgba(78,124,68,0.08);
  color: var(--green-main);
  border-color: var(--green-mid);
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }

.btn-outline-danger {
  background: transparent;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
  font-size: 0.8rem;
  padding: 6px 12px;
}

.btn-outline-danger:hover { background: #fef2f2; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-icon { padding: 9px; border-radius: 50%; }

/* User session indicator */
.session-indicator {
  display: flex; align-items: center; gap: 8px;
  background: rgba(78,124,68,0.08);
  border: 1px solid rgba(78,124,68,0.2);
  border-radius: 50px;
  padding: 6px 14px 6px 8px;
}

.session-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-main);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}

.session-avatar.admin-avatar { background: var(--terra-dark); }

.session-info { display: flex; flex-direction: column; line-height: 1.2; }

.session-username {
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-dark);
}

.session-role {
  font-size: 0.65rem; font-weight: 500;
  color: var(--terra-main); text-transform: uppercase; letter-spacing: 0.5px;
}

.hidden { display: none !important; }

/* ======== HERO BANNER ======== */
.catalog-hero {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 60%, var(--green-light) 100%);
  color: white;
  padding: 50px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.catalog-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('fondo.png') center/cover;
  opacity: 0.12;
}

.catalog-hero-content { position: relative; z-index: 1; }

.catalog-hero h1 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  margin-bottom: 10px;
}

.catalog-hero h1 em {
  font-style: italic;
  color: var(--terra-light);
}

.catalog-hero p {
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  opacity: 0.88;
  max-width: 500px;
  margin: 0 auto 24px;
}

.hero-badges {
  display: flex; gap: 12px; flex-wrap: wrap;
  justify-content: center;
}

.hero-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.8rem; font-weight: 500;
  backdrop-filter: blur(5px);
  display: flex; align-items: center; gap: 6px;
}

/* ======== CATALOG TOOLBAR ======== */
.catalog-toolbar {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-dark);
  flex: 1;
  min-width: 150px;
}

.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Filter chips */
.filter-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  max-width: 1300px;
  margin: 0 auto;
  padding: 12px 24px 0;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: 50px;
  border: 1.5px solid rgba(78,124,68,0.25);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-mid);
  transition: var(--transition);
}

.filter-chip:hover { background: rgba(78,124,68,0.1); border-color: var(--green-mid); }
.filter-chip.active {
  background: var(--green-main);
  border-color: var(--green-main);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ======== CATALOG GRID ======== */
#catalog-grid {
  max-width: 1300px;
  margin: 20px auto 40px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: start;
}

/* Section title */
.section-title-block {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 0 4px;
  justify-content: center;
}

.section-title-block h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--green-deep);
  white-space: nowrap;
}

.section-title-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, rgba(78,124,68,0.4), transparent);
  flex-shrink: 0;
}

.section-title-line.left {
  background: linear-gradient(to left, rgba(78,124,68,0.4), transparent);
}

.section-title-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Botón + agregar en sección */
.section-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(78,124,68,0.1);
  border: 1.5px dashed rgba(78,124,68,0.4);
  color: var(--green-main);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  margin-left: 8px;
}

.section-add-btn:hover {
  background: var(--green-main);
  border-color: var(--green-main);
  color: white;
  border-style: solid;
  transform: scale(1.05);
}

/* Product cards */
.product-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  display: flex; flex-direction: column;
  height: 390px;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(78,124,68,0.35);
}

.product-image-wrap {
  position: relative;
  width: 100%; height: 210px;
  overflow: hidden;
  background: var(--cream-deep);
}

.product-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.06);
}

.product-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--green-main);
  color: white;
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 50px;
}

.product-badge.new { background: var(--terra-dark); }

.product-info {
  padding: 18px 20px 20px;
  display: flex; flex-direction: column;
  flex: 1;
}

.product-category {
  font-size: 0.7rem; font-weight: 600;
  color: var(--terra-main); text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 6px;
}

.product-name {
  font-family: var(--font-title);
  font-size: 1.05rem; font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3; margin-bottom: 8px;
}

.product-desc {
  font-size: 0.82rem; color: var(--text-soft);
  line-height: 1.55; flex: 1; margin-bottom: 16px;
}

.product-footer {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-top: auto;
}

.product-price {
  font-size: 1.2rem; font-weight: 700;
  color: var(--green-deep);
}

.product-price small {
  font-size: 0.7rem; font-weight: 400;
  color: var(--text-muted); display: block;
  margin-bottom: 2px;
}

/* ======== MODALS ======== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 40, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--cream-light);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 80px rgba(20, 40, 20, 0.3);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.visible .modal-box {
  transform: translateY(0) scale(1);
}

.modal-box.wide { max-width: 740px; }

.modal-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(78,124,68,0.12);
  display: flex; align-items: flex-start; gap: 16px;
}

.modal-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(78,124,68,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--green-main); flex-shrink: 0;
  font-size: 1.4rem;
}

.modal-title { flex: 1; }
.modal-title h2 {
  font-family: var(--font-title);
  font-size: 1.35rem; font-weight: 600;
  color: var(--text-dark); margin-bottom: 3px;
}

.modal-title p { font-size: 0.83rem; color: var(--text-soft); }

.modal-close {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.06);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-soft); font-size: 1.1rem;
  transition: var(--transition); flex-shrink: 0;
}

.modal-close:hover { background: rgba(220,38,38,0.1); color: #dc2626; }

.modal-body { padding: 24px 32px; }
.modal-footer {
  padding: 16px 32px 28px;
  display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid rgba(78,124,68,0.1);
}

/* ======== FORMS ======== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-mid); margin-bottom: 7px;
  letter-spacing: 0.2px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(78,124,68,0.2);
  border-radius: var(--radius-sm);
  background: white;
  font-family: var(--font-body); font-size: 0.9rem;
  color: var(--text-dark);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(78,124,68,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.input-with-icon {
  position: relative;
}

.input-with-icon .form-control { padding-left: 40px; }

.input-with-icon .input-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  left: 13px; color: var(--text-muted); pointer-events: none;
}

/* File upload */
.file-upload-area {
  border: 2px dashed rgba(78,124,68,0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(78,124,68,0.03);
}

.file-upload-area:hover { border-color: var(--green-mid); background: rgba(78,124,68,0.07); }

.file-upload-area input[type=file] {
  display: none;
}

/* ======== LOGIN MODAL SPECIFIC ======== */
.login-brand {
  text-align: center; margin-bottom: 28px;
}

.login-brand-icon {
  font-size: 3rem; display: block; margin-bottom: 10px;
}

.login-brand h2 {
  font-family: var(--font-title);
  font-size: 1.6rem; font-weight: 700;
  color: var(--green-deep); margin-bottom: 4px;
}

.login-brand p { font-size: 0.85rem; color: var(--text-soft); }

.user-picker {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 20px;
}

.user-pick-btn {
  background: rgba(78,124,68,0.05);
  border: 1.5px solid rgba(78,124,68,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-family: var(--font-body);
}

.user-pick-btn:hover {
  background: rgba(78,124,68,0.1);
  border-color: var(--green-mid);
}

.user-pick-btn.selected {
  background: var(--green-main);
  border-color: var(--green-main);
  color: white;
}

.user-pick-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-mid); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  margin: 0 auto 6px;
}

.user-pick-btn.selected .user-pick-avatar { background: rgba(255,255,255,0.25); }
.user-pick-btn.admin-pick .user-pick-avatar { background: var(--terra-dark); }
.user-pick-btn.admin-pick.selected { background: var(--terra-dark); border-color: var(--terra-dark); }

.user-pick-name { font-size: 0.85rem; font-weight: 600; }
.user-pick-role { font-size: 0.68rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.5px; }

/* ======== ADMIN LIST ITEMS ======== */
.admin-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(78,124,68,0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: var(--transition);
}

.admin-item:hover { border-color: rgba(78,124,68,0.25); background: rgba(255,255,255,0.9); }

.admin-item-drag {
  color: var(--text-muted); cursor: grab;
  display: flex; align-items: center;
}

.admin-item-thumb {
  width: 48px; height: 48px; border-radius: 10px;
  object-fit: cover; background: var(--cream-deep);
  flex-shrink: 0;
}

.admin-item-info { flex: 1; min-width: 0; }

.admin-item-name {
  font-weight: 600; font-size: 0.9rem;
  color: var(--text-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.admin-item-meta {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
}

.admin-item-price {
  font-weight: 700; color: var(--green-deep);
  font-size: 0.9rem; white-space: nowrap; margin-right: 10px;
}

.admin-item-actions { display: flex; gap: 6px; }

.section-tag {
  background: rgba(191,125,94,0.15);
  color: var(--terra-dark);
  border: 1px solid rgba(191,125,94,0.3);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ======== USER MANAGEMENT ======== */
.user-table { width: 100%; border-collapse: collapse; }

.user-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1.5px solid rgba(78,124,68,0.12);
}

.user-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(78,124,68,0.08);
  vertical-align: middle;
}

.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: rgba(78,124,68,0.03); }

.user-role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 50px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}

.role-admin { background: rgba(155,94,59,0.12); color: var(--terra-dark); }
.role-editor { background: rgba(78,124,68,0.12); color: var(--green-deep); }

.user-avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: white;
  background: var(--green-mid);
  flex-shrink: 0;
}
.user-avatar-sm.adm { background: var(--terra-dark); }

.add-user-form {
  background: rgba(78,124,68,0.04);
  border: 1.5px dashed rgba(78,124,68,0.25);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}

.add-user-form h4 {
  font-size: 0.9rem; font-weight: 700;
  color: var(--green-deep); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

footer {
  background: var(--green-deep);
  color: rgba(255,255,255,0.8);
  padding: 48px 24px 32px; /* Espacio restaurado para PC */
  margin-top: 60px;
}

.footer-mobile-only {
  display: none !important; /* Forzado oculto en computadoras */
}


.footer-inner {
  max-width: 1300px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand-name {
  font-family: var(--font-title);
  font-size: 1.3rem; font-weight: 700;
  color: white; margin-bottom: 8px;
}

.footer-brand p { font-size: 0.85rem; line-height: 1.6; opacity: 0.75; }

.footer-title {
  font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--terra-light); margin-bottom: 14px;
}

.footer-links { list-style: none; }
.footer-links li {
  font-size: 0.85rem; opacity: 0.75;
  margin-bottom: 8px; cursor: pointer;
  transition: var(--transition);
}
.footer-links li:hover { opacity: 1; color: white; }

/* Contacto 2x2 */
.footer-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-bottom: 8px;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  opacity: 0.82;
  line-height: 1.4;
}

.footer-contact-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* Redes sociales */
.footer-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.social-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.9;
}

.social-btn:hover { transform: scale(1.15); opacity: 1; }

.social-btn.facebook  { background: #1877f2; }
.social-btn.instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.social-btn.tiktok    { background: #010101; }
.social-btn.youtube   { background: #ff0000; }
.social-btn.twitter   { background: #000000; }
.footer-links li:hover { opacity: 1; color: white; }

.footer-bottom {
  max-width: 1300px; margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
}

.footer-bottom p { font-size: 0.8rem; opacity: 0.6; }

.footer-admin-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem; font-family: var(--font-body);
  cursor: pointer; transition: var(--transition);
  text-decoration: underline;
}

.footer-admin-btn:hover { color: white; }

/* ======== EMPTY / LOADING STATES ======== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: 16px; display: block; }
.empty-state h3 { font-family: var(--font-title); font-size: 1.4rem; color: var(--text-soft); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; }

/* Notification toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--green-deep); color: white;
  padding: 12px 24px; border-radius: 50px;
  font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0; transition: all 0.3s ease;
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc2626; }

/* ======== ACCIONES MÓVIL (Header) ======== */
.nav-mobile-actions {
  display: none !important;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}

.nav-mobile-top-row {
  display: flex !important;
  gap: 12px;
}

.action-icon-min {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.action-icon-min:active { transform: scale(0.9); }
.action-icon-min.fb { background: #1877f2; }
.action-icon-min.call { background: #4e7c44; }
.action-icon-min.messenger { background: #0084ff; }

.footer-info-grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px 0; /* Un pequeño respiro arriba */
  margin-top: 0;
}

.info-box-footer {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  padding: 4px 8px !important;
  flex: 1;
  max-width: 160px;
  min-height: 45px;
}

.info-box-footer .info-box-title {
  font-size: 0.65rem !important;
  margin-bottom: 2px !important;
}

.info-box-footer .info-box-sub {
  font-size: 0.6rem !important;
}

.footer-inner-minimal {
  padding: 2px 10px 0; /* Letras al ras inferior */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.footer-inner-minimal .footer-brand-name {
  font-size: 0.8rem !important;
  opacity: 0.8;
  margin-bottom: 0;
  line-height: 1;
}

.footer-admin-btn-discreet {
  display: none !important;
}

.whatsapp-btn-min {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: white;
  padding: 8px 16px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.card-info-min {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: white;
  opacity: 0.9;
}

.card-info-min img {
  height: 18px;
  filter: brightness(1.1);
}

/* ======== RESPONSIVE ======== */
@media (max-width: 1100px) {
  #catalog-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
  .navbar-inner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 20px;
  }
  .nav-center, .nav-right { display: none !important; }
  .nav-mobile-actions { display: flex; }
  .nav-logo { height: 52px; }

  /* Footer Dual Control */
  .footer-desktop { display: none !important; }
  .footer-mobile-only { display: block !important; }

  
  footer {
    padding: 0;
    margin-top: 15px;
  }
}

@media (max-width: 480px) {
  .navbar-inner { 
    padding: 10px 15px; 
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Permite que el logo y botones quepan */
  }
  .nav-logo { 
    height: 85px !important;
    width: auto;
    object-fit: contain; 
    flex-shrink: 0;
  }
  .nav-mobile-actions { 
    display: flex !important;
    margin-left: 0;
  }
  
  .footer-mobile-row { 
    flex-direction: row; 
    gap: 15px; 
    padding: 10px; 
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
  }
  .whatsapp-btn-min { font-size: 0.8rem; padding: 7px 14px; }
  .card-info-min { font-size: 0.75rem; }
  .card-info-min img { height: 15px; }

  #catalog-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px; /* Espacio reducido para que quepan 2 */
    padding: 0 10px;
    width: 100%;
    margin-top: 15px;
    box-sizing: border-box; /* Previene desbordamientos */
  }

  /* Ajustar proporciones de la tarjeta para 2 columnas en celular */
  .product-card {
    height: auto;
    min-height: 240px;
  }
  .product-image-wrap { height: 110px; }
  .product-info { padding: 10px; }
  .product-category { font-size: 0.5rem; margin-bottom: 4px; letter-spacing: 0.5px; }
  .product-name { font-size: 0.75rem; margin-bottom: 4px; }
  .product-desc { 
    font-size: 0.65rem; 
    margin-bottom: 10px; 
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limita a 2 líneas para ahorrar espacio */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .product-footer { gap: 6px; }
  .product-price { font-size: 0.85rem; }
  .product-price small { font-size: 0.55rem; }
  .product-footer .btn { padding: 4px 8px; font-size: 0.65rem; }
  .user-picker { grid-template-columns: 1fr 1fr; }
}

/* ======== PRINT / PDF EXPORT ======== */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Fondo al 100% del documento usando pseudo-elemento fijo */
  body {
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    z-index: -1 !important;
    background: url('fondo.png') center / cover no-repeat !important;
    background-color: #fef9f0 !important;
  }

  /* ---- ENCABEZADO ---- */
  .navbar {
    position: static !important;
    display: block !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(78,124,68,0.2) !important;
  }

  .nav-logo {
    height: 100px !important;
    width: auto !important;
  }

  .navbar-inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 9px 6px 19px !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .nav-brand {
    flex-shrink: 0 !important;
  }

  .nav-center {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0 12px !important;
    overflow: visible !important;
  }

  .nav-title {
    font-size: 1.25rem !important;
    margin-bottom: 3px !important;
    white-space: normal !important;
    word-break: normal !important;
  }

  .nav-subtitle {
    font-size: 0.7rem !important;
    white-space: normal !important;
    display: block !important;
    opacity: 0.85 !important;
  }

  .nav-right {
    flex-shrink: 0 !important;
  }

  .nav-boxes {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }

  .info-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 4px 10px !important;
    min-width: 0 !important;
  }

  .info-box-title {
    font-size: 0.55rem !important;
    padding-bottom: 2px !important;
    margin-bottom: 2px !important;
    gap: 3px !important;
  }

  .info-box-sub {
    font-size: 0.5rem !important;
  }

  .info-box-cards {
    max-height: 12px !important;
  }

  /* Envíos ya no necesita ser tall, se apila igual que tarjetas */
  .info-box-tall {
    align-self: auto !important;
    height: auto !important;
  }

  /* ---- OCULTAR ELEMENTOS INTERACTIVOS ---- */
  .modal-overlay,
  .toast,
  .admin-toolbar,
  .catalog-toolbar,
  .filter-chips,
  .whatsapp-btn,
  footer,
  .product-footer .btn { display: none !important; }

  /* ---- TÍTULO CENTRADO EN EL ENCABEZADO ---- */
  .nav-center {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    align-self: center !important;
  }

  .nav-title {
    font-size: 1.3rem !important;
    margin-bottom: 3px !important;
  }

  .nav-subtitle {
    font-size: 0.75rem !important;
  }

  /* ---- GRILLA DEL CATÁLOGO ---- */
  #catalog-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
    margin: 16px 9px 16px 19px !important;
    padding: 0 !important;
    width: calc(100% - 28px) !important;
    max-width: calc(100% - 28px) !important;
    box-sizing: border-box !important;
  }

  /* ---- TARJETAS ---- */
  .product-card {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    overflow: hidden !important;
    background: rgba(248, 245, 235, 0.9) !important;
    border: 1px solid rgba(255,255,255,0.7) !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08) !important;
    backdrop-filter: none !important;
    display: flex !important;
    flex-direction: column !important;
    height: 340px !important;
  }

  /* Imagen contenida dentro de la tarjeta */
  .product-image-wrap {
    width: 100% !important;
    height: 130px !important;
    max-height: 130px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
  }

  .product-image-wrap img {
    width: 100% !important;
    height: 130px !important;
    max-height: 130px !important;
    object-fit: cover !important;
    display: block !important;
  }

  .product-info {
    padding: 12px 14px !important;
  }

  .product-card:hover { transform: none !important; }

  .section-title-block {
    grid-column: 1 / -1 !important;
    page-break-before: auto !important;
    break-inside: avoid !important;
  }

  @page {
    size: A4;
    margin: 0;
  }
}