/**
 * Estilos del Catálogo, Buscador, Categorías Desplazables y Tarjetas de Productos (FASE 3)
 */

/* Buscador */
.search-bar-container {
  margin-bottom: 0.75rem;
}

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

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 0.8rem 2.75rem 0.8rem 2.85rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border-strong);
  background-color: var(--color-surface);
  font-size: 0.95rem;
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-brand-pink);
  box-shadow: 0 0 0 3px rgba(227, 11, 104, 0.12);
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-alt);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.search-clear-btn:hover {
  background-color: var(--color-border-strong);
  color: var(--color-text);
}

.search-clear-btn[hidden] {
  display: none;
}

.search-feedback {
  margin-top: 0.45rem;
  font-size: 0.83rem;
  color: var(--color-text-muted);
  padding: 0 0.5rem;
}

/* Barra Sticky de 13 Categorías Desplazables */
.categories-sticky-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 100;
  background-color: rgba(248, 245, 239, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  margin: 0 -1rem 1.25rem;
  padding: 0 1rem;
}

.categories-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.65rem 0;
  scroll-behavior: smooth;
}

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

.category-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.category-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.category-chip.is-active {
  background: var(--gradient-brand);
  border-color: transparent;
  color: var(--color-text-inverse);
  box-shadow: 0 4px 10px rgba(227, 11, 104, 0.24);
}

.category-chip-count {
  font-size: 0.72rem;
  opacity: 0.85;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-full);
  background-color: rgba(0, 0, 0, 0.07);
}

.category-chip.is-active .category-chip-count {
  background-color: rgba(255, 255, 255, 0.22);
  color: var(--color-text-inverse);
}

/* Bloques de Categoría */
.category-section {
  margin-bottom: 2.25rem;
  scroll-margin-top: calc(var(--header-height) + var(--cat-nav-height) + 18px);
}

.category-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px dashed var(--color-border-strong);
}

.category-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.category-description {
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

/* Subcategorías internas (ej. dentro de Bebidas) */
.subcategory-divider {
  margin: 1.25rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.subcategory-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

.subcategory-line {
  flex: 1;
  height: 1px;
  border-bottom: 1px dashed var(--color-border-strong);
}

/* Panel informativo de los 13 Sabores de Alitas */
.wing-flavors-showcase {
  margin-bottom: 1.15rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-xs);
}

.wing-flavors-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wing-flavors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wing-flavor-tag {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-secondary-light);
  border: 1px solid var(--color-secondary-bg);
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Grilla y Tarjetas de Productos */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.95rem;
}

.product-card {
  display: flex;
  flex-direction: row;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

/* Media / Fotografía Real o Placeholder Neutro */
.product-card-media {
  width: 118px;
  min-width: 118px;
  background-color: var(--color-surface-alt);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.product-card:hover .product-card-img {
  transform: scale(1.04);
}

/* Placeholder visual neutro y elegante cuando aún no existe fotografía real */
.product-placeholder {
  width: 100%;
  height: 100%;
  min-height: 124px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(145deg, #f5efe4 0%, #ebe1cf 100%);
  color: var(--color-text-muted);
  gap: 0.3rem;
}

.product-placeholder-icon {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  opacity: 0.65;
}

.product-placeholder-brand {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.75;
  line-height: 1.1;
}

.product-placeholder-note {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  opacity: 0.8;
}

/* Contenido de la tarjeta */
.product-card-body {
  flex: 1;
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.product-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.1rem;
}

.product-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}

.product-card-subtitle {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
}

.product-card-desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Resumen rápido de variantes en la tarjeta (ej. Pastas / Arroz / Tamaño) */
.product-card-variants-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.variant-preview-pill {
  font-size: 0.71rem;
  padding: 0.12rem 0.48rem;
  border-radius: var(--radius-xs);
  background-color: var(--color-secondary-light);
  border: 1px solid var(--color-secondary-bg);
  color: #5e3b10;
  font-weight: 600;
}

/* Pie de la tarjeta: Precio + Botón de Acción */
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--color-surface-alt);
}

.product-price-block {
  display: flex;
  flex-direction: column;
}

.product-price-prefix {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
  line-height: 1;
}

.product-price-value {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--color-primary);
}

.product-action-btn {
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: var(--color-text-inverse);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(227, 11, 104, 0.2);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.product-action-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

/* Estado vacío de búsqueda */
.empty-catalog-state {
  text-align: center;
  padding: 3rem 1.25rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border-strong);
  margin: 1.5rem 0;
}

.empty-catalog-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.empty-catalog-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}
