/* Estilos modernos Mobile-First diseñados con estética HONOR (Midnight, Cyan, Gold) */
:root {
  --primary: #0A84FF;
  --primary-gradient: linear-gradient(135deg, #0066FF 0%, #00B4D8 100%);
  --honor-gold: #D4AF37;
  --bg-dark: #0A0D14;
  --card-bg: #141A29;
  --card-border: #1E283D;
  --card-hover: #192238;
  --text-main: #FFFFFF;
  --text-muted: #8E9BAE;
  --accent-cyan: #00E5FF;
  --accent-green: #10B981;
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --header-height: 60px;
  --bottom-nav-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-height) + 20px);
  overflow-x: hidden;
}

/* Header Fijo con Blur */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text {
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 1.25rem;
  background: linear-gradient(90deg, #FFFFFF, #00B4D8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-badge {
  font-size: 0.65rem;
  background: rgba(0, 180, 216, 0.15);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Buscador Rápido */
.search-container {
  padding: 12px 16px 8px 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 40px 12px 42px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
}

/* Carrusel de Categorías */
.categories-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.categories-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--primary-gradient);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

/* Grilla de Dispositivos (Mobile First) */
.device-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0 16px 20px 16px;
}

@media (min-width: 640px) {
  .device-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .device-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Card de Dispositivo */
.device-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.device-card:active {
  transform: scale(0.99);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.badge-featured {
  background: rgba(212, 175, 55, 0.15);
  color: var(--honor-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.compare-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 8px;
}

.compare-checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.device-image-wrap {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
}

.device-img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4));
  transition: transform 0.3s ease;
}

.device-card:hover .device-img {
  transform: translateY(-4px);
}

.device-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
}

.device-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 4px 0 10px 0;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Colores disponibles */
.color-swatches {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.color-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Precios */
.price-container {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.price-promo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.price-regular {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Puntos clave / Highlights para el asesor */
.highlights-list {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
  color: #D1D5DB;
}

.highlight-item:last-child {
  margin-bottom: 0;
}

.highlight-icon {
  color: var(--accent-cyan);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Botones de acción */
.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.btn-details {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: #FFFFFF;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-details:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Barra Flotante de Comparación (Bottom Bar) */
.comparison-bar {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 12px);
  left: 16px;
  right: 16px;
  max-width: 500px;
  margin: 0 auto;
  background: rgba(20, 26, 41, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 10px 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 30px rgba(0, 102, 255, 0.35);
  z-index: 90;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.comparison-bar.show {
  display: flex;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.compare-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-count-badge {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-compare-now {
  background: var(--primary-gradient);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Barra de Navegación Inferior Móvil (Bottom Navigation) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(10, 13, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 80;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 16px;
  transition: color 0.2s ease;
}

.nav-item.active {
  color: var(--accent-cyan);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* Modales y Hojas Inferiores (Bottom Sheets para Móvil) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-end;
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
}

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

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-height: 90vh;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1px solid var(--card-border);
  overflow-y: auto;
  padding: 20px 16px 30px 16px;
  animation: slideBottomSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .modal-content {
    max-width: 750px;
    border-radius: 20px;
    max-height: 85vh;
  }
}

@keyframes slideBottomSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Tabla Comparativa Adaptada para Teléfono */
.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px;
  border-bottom: 1px solid var(--card-border);
  text-align: left;
  vertical-align: top;
  font-size: 0.85rem;
}

.comparison-table th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  color: var(--text-main);
  position: sticky;
  top: 0;
}

.comparison-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.spec-category-row {
  background: rgba(0, 180, 216, 0.12) !important;
  color: var(--accent-cyan);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

/* Formularios del Dashboard */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #0D121F;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}

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

.btn-primary {
  background: var(--primary-gradient);
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s;
}

.btn-primary:active {
  opacity: 0.9;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* Estilos de Lista en Dashboard */
.admin-device-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-device-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-device-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #090D16;
  object-fit: contain;
  padding: 4px;
}

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