/* ===== NAV ACTIVE + LINK ===== */
.nav-links a.active { color: var(--blue); font-weight: 700; }

/* ===== HEADER DE TIENDA ===== */
.tienda-header {
  background: var(--gradient); color: #fff; padding: 7rem 0 3rem; text-align: center;
}
.tienda-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -1px; }
.tienda-header p { color: #94a3b8; margin-top: 0.5rem; }

.tienda-main { padding-top: 3rem; }

/* ===== GRID DE PUBLICACIONES ===== */
.tienda-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem;
}
.tienda-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column;
}
.tienda-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(0,0,0,0.12); }
.tienda-card-img { position: relative; height: 200px; background: #0f172a; }
.tienda-card-img img { width: 100%; height: 100%; object-fit: cover; }
.no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #475569; font-size: 2.5rem; background: #1e293b; }
.no-img.sm { font-size: 1.2rem; border-radius: 8px; }
.img-count, .video-badge {
  position: absolute; bottom: 8px; background: rgba(0,0,0,0.7); color: #fff;
  font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 50px; font-weight: 600;
}
.img-count { left: 8px; }
.video-badge { right: 8px; color: #ff0000; background: rgba(255,255,255,0.95); }
.tienda-card-body { padding: 1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.tienda-card-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.3; }
.condicion {
  display: inline-block; align-self: flex-start; font-size: 0.72rem; font-weight: 700;
  background: #dbeafe; color: var(--blue); padding: 0.15rem 0.6rem; border-radius: 50px; margin-bottom: 0.5rem;
}
.precio { font-size: 1.3rem; font-weight: 900; color: var(--dark); margin-top: auto; }
.pub-id { font-size: 0.72rem; color: #94a3b8; margin-top: 0.4rem; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 5rem 1rem; color: var(--gray); }
.empty-state i { font-size: 3.5rem; color: #cbd5e1; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.3rem; color: var(--dark); margin-bottom: 0.5rem; }

/* ===== DETALLE DE ARTÍCULO ===== */
.articulo-main { padding-top: 6rem; }
.volver { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--blue); font-weight: 600; margin-bottom: 1.5rem; }
.volver:hover { gap: 0.75rem; }
.articulo-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }

.galeria-principal { border-radius: 16px; overflow: hidden; background: #0f172a; height: 420px; }
.galeria-principal img { width: 100%; height: 100%; object-fit: contain; }
.galeria-miniaturas { display: flex; gap: 0.6rem; margin-top: 0.75rem; flex-wrap: wrap; }
.miniatura {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.2s; opacity: 0.7;
}
.miniatura:hover, .miniatura.active { border-color: var(--blue); opacity: 1; }

.video-embed { margin-top: 2rem; }
.video-embed h3 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 1.1rem; }
.video-embed i { color: #ff0000; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 14px; overflow: hidden; }
.video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.articulo-info { position: sticky; top: 90px; }
.pub-id-badge {
  display: inline-block; background: #f1f5f9; color: var(--gray); font-size: 0.8rem;
  font-weight: 700; padding: 0.3rem 0.8rem; border-radius: 50px; margin-bottom: 1rem;
}
.articulo-info h1 { font-size: 1.7rem; font-weight: 800; line-height: 1.25; margin-bottom: 0.75rem; }
.condicion.grande { font-size: 0.85rem; padding: 0.3rem 0.9rem; }
.precio-grande { font-size: 2.2rem; font-weight: 900; color: var(--dark); margin: 1rem 0; }
.descripcion { margin: 1.5rem 0; }
.descripcion h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.descripcion p { color: var(--gray); line-height: 1.7; }

.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  background: #25d366; color: #fff; padding: 1rem; border-radius: 12px;
  font-weight: 700; font-size: 1.05rem; transition: background 0.2s, transform 0.15s;
}
.btn-whatsapp:hover { background: #1da851; transform: translateY(-2px); }
.btn-whatsapp i { font-size: 1.3rem; }
.whatsapp-nota { font-size: 0.8rem; color: #94a3b8; margin-top: 0.75rem; text-align: center; }

/* ===== PANEL ADMIN ===== */
.admin-body { background: #f1f5f9; min-height: 100vh; }
.admin-nav {
  background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0 1.5rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100;
}
.admin-nav .logo { font-size: 1.3rem; }
.admin-nav-actions { display: flex; gap: 0.75rem; align-items: center; }
.btn-logout {
  color: var(--gray); font-weight: 600; padding: 0.55rem 1rem; border-radius: 8px;
  border: 1.5px solid #e2e8f0; font-size: 0.9rem; transition: border-color 0.2s, color 0.2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }
.admin-main { padding: 2.5rem 1.5rem; }
.admin-main h1 { font-size: 1.8rem; margin-bottom: 1.5rem; }

.admin-section { margin-bottom: 2.5rem; }
.admin-section h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.admin-section h2 i { color: var(--blue); }
.count { background: #dbeafe; color: var(--blue); font-size: 0.8rem; padding: 0.1rem 0.6rem; border-radius: 50px; font-weight: 700; }
.admin-empty { color: var(--gray); font-size: 0.9rem; padding: 1rem; background: #fff; border-radius: 10px; }

.admin-table { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-row {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 0.85rem;
  display: flex; align-items: center; gap: 1rem;
}
.admin-row.inactiva { opacity: 0.6; }
.admin-row-img { width: 60px; height: 60px; flex-shrink: 0; }
.admin-row-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.admin-row-info { flex: 1; min-width: 0; }
.admin-row-info strong { display: block; margin-bottom: 0.2rem; }
.admin-meta { font-size: 0.82rem; color: var(--gray); }
.badge-oculta { background: #fee2e2; color: var(--red); padding: 0.1rem 0.5rem; border-radius: 50px; font-weight: 700; font-size: 0.72rem; }
.admin-row-actions { display: flex; gap: 0.4rem; }
.btn-icon {
  width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid #e2e8f0; background: #fff;
  display: flex; align-items: center; justify-content: center; color: var(--gray); cursor: pointer; transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--blue); color: var(--blue); }
.btn-icon.danger:hover { border-color: var(--red); color: var(--red); }

/* ===== FORMULARIO ADMIN ===== */
.admin-form { background: #fff; border-radius: 16px; padding: 2rem; max-width: 760px; margin-top: 1rem; }
.admin-form .form-group { margin-bottom: 1.25rem; }
.admin-form label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.admin-form input[type=text], .admin-form input[type=password], .admin-form textarea, .admin-form select, .admin-form input[type=file] {
  width: 100%; padding: 0.7rem 0.9rem; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; outline: none; transition: border-color 0.2s;
}
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: var(--blue); }
.admin-form small { color: #94a3b8; font-size: 0.8rem; display: block; margin-top: 0.3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.fotos-existentes { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.foto-check { position: relative; cursor: pointer; width: 90px; height: 90px; }
.foto-check img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 2px solid #e2e8f0; }
.foto-check input { position: absolute; opacity: 0; }
.check-overlay {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.7rem;
}
.foto-check input:not(:checked) ~ img { opacity: 0.35; border-color: var(--red); }
.foto-check input:not(:checked) ~ .check-overlay { background: #cbd5e1; }

.toggle-group .switch { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.toggle-group input { width: auto !important; }

/* ===== LOGIN ===== */
.login-box {
  background: #fff; max-width: 400px; margin: 8vh auto; padding: 2.5rem; border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}
.login-box h2 { font-size: 1.2rem; text-align: center; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.login-box .form-group { margin-bottom: 1.25rem; }
.login-box label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.login-box input { width: 100%; padding: 0.75rem 1rem; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 1rem; outline: none; }
.login-box input:focus { border-color: var(--blue); }
.login-error { background: #fee2e2; color: var(--red); padding: 0.75rem; border-radius: 8px; font-size: 0.88rem; margin-bottom: 1rem; text-align: center; }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .articulo-grid { grid-template-columns: 1fr; gap: 2rem; }
  .articulo-info { position: static; }
  .galeria-principal { height: 320px; }
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .admin-row { flex-wrap: wrap; }
  .nav-links { display: none; }
}
