/* =========================
   VARIABLES DE MARCA
   Reemplaza por los colores reales de tractopartesdicom.com
   ========================= */
:root {
  /* Colores de marca sacados del arte de DICOM */
  --color-primary: #FECD26;      /* amarillo principal DICOM */
  --color-primary-dark: #D7A424; /* amarillo más oscuro (hover, bordes) */
  --color-accent: #FECD26;       /* si quieres, usa el mismo amarillo como acento */

  --color-bg: #080A09;           /* fondo general casi negro */
  --color-bg-elevated: #080A09;  /* secciones sobre el fondo */
  --color-surface: #111111;      /* tarjetas / contenedores */
  --color-surface-soft: #080A09;

  --color-border-subtle: #2D2D2D;
  --color-border-strong: #3F3F3F;

  --color-text: #F2F2F1;         /* texto principal (blanco cálido) */
  --color-muted: #9D9E9D;        /* texto secundario / descripciones */
}


/* =========================
   RESET / BASE
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font-family: inherit;
}

/* =========================
   LAYOUT
   ========================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* =========================
   HEADER
   ========================= */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(55, 65, 81, 0.7);
}

.header-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 1.2rem;
  padding-block: 0.8rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.logo-title {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* Buscador */
.search-bar {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.search-bar input[type="search"] {
  flex: 1;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(15, 23, 42, 0.8);
  color: var(--color-text);
  font-size: 0.9rem;
}

.search-bar input::placeholder {
  color: #6b7280;
}

.search-bar input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.search-bar button {
  border-radius: 999px;
  border: none;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(248, 113, 113, 0.35);
  transition: transform 0.1s ease, box-shadow 0.15s ease,
    filter 0.15s ease;
}

.search-bar button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(248, 113, 113, 0.45);
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  font-size: 0.85rem;
}

.main-nav a {
  color: var(--color-muted);
  font-weight: 500;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width 0.15s ease;
}

.main-nav a:hover {
  color: #e5e7eb;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.main-nav a.active {
  color: #f9fafb;
}

/* =========================
   HERO CATÁLOGO
   ========================= */
.catalog-hero {
  border-bottom: 1px solid var(--color-border-subtle);
  background: radial-gradient(
      circle at top left,
      rgba(248, 113, 113, 0.18),
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(56, 189, 248, 0.16),
      transparent 55%
    ),
    var(--color-bg-elevated);
  padding-block: 1.6rem 1.2rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.catalog-hero h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.catalog-hero p {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background-color: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  font-weight: 500;
}

.hero-count {
  color: #e5e7eb;
}

/* Controles inline */
.catalog-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.8rem;
}

.catalog-info span {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.catalog-filters-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.catalog-filters-inline label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-muted);
}

.catalog-filters-inline select {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  font-size: 0.8rem;
}

/* =========================
   CATÁLOGO (GRID)
   ========================= */
.catalog-main {
  padding-block: 1.8rem 2.4rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* Tarjeta producto */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border-radius: 1.1rem;
  border: 1px solid rgba(55, 65, 81, 0.85);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.55);
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease, background-color 0.18s ease;
}

.product-card::before {
  /* línea suave superior */
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(248, 113, 113, 0.7),
    rgba(59, 130, 246, 0.5),
    rgba(45, 212, 191, 0.4)
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.85);
  border-color: rgba(248, 113, 113, 0.6);
  background-color: #020617;
}

.product-card:hover::before {
  opacity: 1;
}

/* Tag (nuevo, oferta, etc.) */
.product-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.85rem;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(220, 38, 38, 0.9);
  color: #fef2f2;
}

/* Imagen */
.product-image {
  padding: 0.8rem 0.8rem 0.4rem;
  background: radial-gradient(
      circle at top,
      rgba(148, 163, 184, 0.4),
      transparent 60%
    ),
    radial-gradient(
      circle at bottom,
      rgba(2, 6, 23, 1),
      rgba(15, 23, 42, 1)
    );
}

.product-image img {
  border-radius: 0.9rem;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* Cuerpo */
.product-body {
  padding: 0.9rem 1rem 0.4rem;
}

.product-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.product-sku {
  margin: 0.3rem 0 0.4rem;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.product-desc {
  margin: 0;
  font-size: 0.85rem;
  color: #e5e7eb;
  line-height: 1.4;
}

/* Tags pequeños dentro de la tarjeta */
.product-tags {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.product-tags span {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(75, 85, 99, 0.9);
  color: #d1d5db;
}

/* Footer de producto */
.product-footer {
  padding: 0.7rem 1rem 0.9rem;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-price-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.product-price {
  font-weight: 700;
  font-size: 1rem;
}

.product-note {
  font-size: 0.7rem;
  color: var(--color-muted);
}

.product-stock {
  font-size: 0.75rem;
  color: #22c55e;
}

.product-stock--low {
  color: #fbbf24;
}

/* Botón principal */
.btn-primary {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(248, 113, 113, 0.5);
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(248, 113, 113, 0.7);
}

/* =========================
   FOOTER
   ========================= */
.site-footer {
  border-top: 1px solid var(--color-border-subtle);
  background-color: #020617;
  padding-block: 2rem 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1.3fr 1.1fr;
  gap: 1.7rem;
  padding-bottom: 1rem;
}

.footer-column h4 {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.footer-column p {
  margin: 0.25rem 0;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.footer-column a {
  display: block;
  font-size: 0.82rem;
  color: #e5e7eb;
  margin: 0.15rem 0;
}

.footer-column a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  padding-top: 0.8rem;
  font-size: 0.78rem;
  color: #6b7280;
  text-align: center;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1024px) {
  .header-content {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .search-bar {
    order: 3;
  }

  .main-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-meta {
    align-items: flex-start;
  }

  .footer-content {
    grid-template-columns: 1.6fr 1fr;
  }
}

@media (max-width: 768px) {
  .catalog-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .catalog-filters-inline {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .products-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .header-content {
    gap: 0.8rem;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar button {
    width: 100%;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }
}
