/* =====================================================
   escompatible.es — CSS principal
   ===================================================== */

:root {
  --ec-primary:  #0d6efd;
  --ec-warning:  #ffc107;
  --ec-amazon:   #ff9900;
  --ec-radius:   .75rem;
  --ec-shadow:   0 2px 14px rgba(0,0,0,.09);
}

/* ── Base ─────────────────────────────────────────── */
body { font-family: 'Segoe UI', system-ui, sans-serif; color: #212529; }
.site-header { position: sticky; top: 0; z-index: 1030; }

/* ── Hero ─────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #eef4ff 0%, #e6f0ff 100%);
  border-radius: var(--ec-radius);
  padding: 3rem 1.5rem;
}
@media (max-width: 576px) { .hero-section { padding: 2rem 1rem; } }

/* ── Tarjeta genérica hover ───────────────────────── */
.card-hover {
  transition: transform .15s ease, box-shadow .15s ease;
  border-radius: var(--ec-radius);
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--ec-shadow);
}

/* ── Tarjeta de producto Amazon ───────────────────── */
.product-card {
  border-radius: var(--ec-radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* Imagen */
.product-img-link { display: block; text-decoration: none; }

.product-img-wrap {
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  padding: 12px;
  overflow: hidden;
}
@media (max-width: 576px) { .product-img-wrap { height: 150px; } }

.product-img {
  max-height: 160px;
  max-width: 100%;
  object-fit: contain;
  transition: transform .2s ease;
}
.product-card:hover .product-img { transform: scale(1.04); }

.no-img-placeholder {
  height: 180px;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* Texto */
.product-name {
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.3;
  color: #212529;
  margin-bottom: .4rem;
  /* Limitar a 3 líneas */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #b12704;
  margin-bottom: 0;
}
.product-price-na {
  font-size: .8rem;
  color: #6c757d;
  margin-bottom: 0;
}

/* Botón Amazon */
.amazon-btn {
  background: #ff9900;
  border: none;
  color: #111 !important;
  font-weight: 700;
  font-size: .85rem;
  padding: .55rem 1rem;
  border-radius: .5rem;
  transition: background .15s ease;
}
.amazon-btn:hover, .amazon-btn:focus {
  background: #e68900;
  color: #111 !important;
}

/* ── Sección de tipo de accesorio ─────────────────── */
.section-type-header {
  font-size: 1rem;
  font-weight: 700;
  border-left: 4px solid var(--ec-primary);
  padding-left: .75rem;
  margin-bottom: 1rem;
}

/* ── Grid de productos — responsive ───────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
@media (min-width: 576px) { .products-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
@media (min-width: 992px) { .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

/* ── Ficha de producto lateral ────────────────────── */
.product-sidebar {
  position: sticky;
  top: 80px;
}
.product-main-img {
  max-height: 260px;
  object-fit: contain;
  width: 100%;
}

/* ── SEO info box ─────────────────────────────────── */
.info-box {
  background: #f8f9fa;
  border-radius: var(--ec-radius);
  padding: 1rem 1.2rem;
}
.info-box li { padding: .15rem 0; }

/* ── Breadcrumb ───────────────────────────────────── */
.breadcrumb { font-size: .82rem; }

/* ── Autocomplete ─────────────────────────────────── */
#autocomplete-list {
  border-radius: 0 0 var(--ec-radius) var(--ec-radius);
  max-height: 320px;
  overflow-y: auto;
  box-shadow: var(--ec-shadow);
}
#autocomplete-list .list-group-item { cursor: pointer; padding: .6rem 1rem; font-size: .9rem; }
#autocomplete-list .list-group-item:hover { background: #f0f6ff; }

/* ── Category icon ────────────────────────────────── */
.category-icon { font-size: 2.5rem; }

/* ── Admin sidebar ────────────────────────────────── */
.sidebar { min-height: 100vh; background: #1e2a3a; }
.sidebar .nav-link { color: #adb5bd; border-radius: .4rem; font-size: .88rem; }
.sidebar .nav-link:hover, .sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar .sidebar-brand { font-size: 1.1rem; font-weight: 700; color: #fff; padding: 1.2rem 1rem; display: block; }

/* ── Utilities ────────────────────────────────────── */
.z-3 { z-index: 3; }
.font-monospace { font-family: 'Courier New', monospace; }

/* ── FAQ accordion custom ─────────────────────────── */
.accordion-button:not(.collapsed) { color: var(--ec-primary); background: #f0f6ff; }

/* ── Badge tipo accesorio ─────────────────────────── */
.badge-type { font-size: .72rem; font-weight: 600; }

/* ── Stars placeholder (futuro) ───────────────────── */
.stars { color: #ff9900; font-size: .9rem; }
