/* ofertas.css
   Inspirado en el estilo y variables de categories.css (misma paleta y ritmo).
*/

/* =========================
   VARIABLES (mismo sistema que categorias.css)
   ========================= */
:root {
  --cat-bg: #000;
  --cat-text: #d5d5d5;
  --panel-border: #ddd;
  --left-bg: #f8f8f8;
  --left-hover: #e5e5e5;
  --sub-hover: #111;
  --title-border: #a01a26;

  --radius: 10px;
  --transition: 0.25s ease;
  --font: Arial, sans-serif;
}

/* =========================
   CONTENEDOR PRINCIPAL
   ========================= */
.ofertas-dropdown {
  width: 260px; /* ancho del trigger */
  position: relative;
  font-family: var(--font);
}

/* TRIGGER (el botón que abre el panel) */
.ofertas-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--title-border); /* #a01a26 */
  padding: 12px 15px;
  border: 2px solid var(--title-border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--cat-text);
  width: 250px;
  height: 40px;
  font-size: 14px;
}

.ofertas-trigger .trigger-text {
  flex-grow: 1;
  text-align: center;
  font-weight: 600;
}

/* PANEL (oculto por defecto; se muestra añadiendo `.active`) */
.ofertas-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 900px;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  margin-top: 5px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  z-index: 50;

  /* animación / oculto */
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--transition), transform var(--transition);
}

/* muestra con clase active (compatibilidad con el JS que togglea .active) */
.ofertas-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* =========================
   HEADER: "Todos los productos" (izq) + "Ver más..." (der)
   ========================= */
.ofertas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--title-border); /* Línea de 3px #a01a26 */
}

.titulo-ofertas {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

/* Cantidad total de productos */
.titulo-ofertas .cantidad-total {
  font-weight: 300;       /* light */
  margin-left: 6px;
  color: #333;            /* mismo color del título */
  font-size: 16px;        /* un poquito más pequeño */
}

/* Ver más - esquina superior derecha */
.ofertas-header .ver-mas {
  font-size: 14px;
  text-decoration: underline !important;
  font-weight: 600;
  color: #555 !important;
  transition: color var(--transition);
}

.ofertas-header .ver-mas:hover {
  text-decoration: none;
  color: #005177;
}

/* =========================
   LISTA DE PRODUCTOS (vitrina)
   ========================= */
.ofertas-list {
  display: flex;
  gap: 15px;
  flex-wrap: nowrap;
  overflow-x: auto; /* permite scrol horizontal si hay más productos */
  padding: 10px 0 0 0; /* deja espacio por la línea del header */
  margin: 0;
  list-style: none;
}

/* estilo del item */
.oferta-item {
  width: 160px;
  flex: 0 0 auto;
  list-style: none;
  text-align: center;
}

.oferta-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 8px;
}

.oferta-thumb {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* NOMBRE Y PRECIO */
.oferta-nombre {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  line-height: 1.2;
}

.oferta-precio {
  display: block;
  margin-top: 4px;
  color: #d60000;
  font-weight: 700;
  font-size: 14px;
}

/* SIN OFERTAS */
.sin-ofertas {
  padding: 12px;
  color: #666;
}

/* =========================
   ACCESIBILIDAD / RESPONSIVE
   ========================= */
@media (max-width: 900px) {
  .ofertas-panel {
    width: calc(100vw - 20px);
    left: 10px;
  }
}

@media (max-width: 520px) {
  .ofertas-list {
    gap: 10px;
  }

  .oferta-item {
    width: 140px;
  }
}

/* estilado para scrollbar horizontal (opcional, moderno) */
.ofertas-list::-webkit-scrollbar {
  height: 8px;
}
.ofertas-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 6px;
}
