/* RDC All Brands Block - Frontend Styles */

.rdc-all-brands {
  padding: 60px 20px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.all-brands-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--rdc-orange, #FF6347);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 50px;
  position: relative;
}

.all-brands-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--rdc-blue, #007cba);
  border-radius: 2px;
}

/* Filtro Alfabético */
.alphabet-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-button {
  padding: 16px 25px;
  background: #ffffff;
  color: #333;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.filter-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

.filter-button:hover::before {
  left: 100%;
}

.filter-button:hover {
  background: var(--rdc-blue, #007cba);
  color: white;
  border-color: var(--rdc-blue, #007cba);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 124, 186, 0.3);
}

.filter-button.active {
  background: var(--rdc-orange, #FF6347);
  color: white;
  border-color: var(--rdc-orange, #FF6347);
  box-shadow: 0 4px 15px rgba(255, 99, 71, 0.4);
}

.filter-button.active:hover {
  background: var(--rdc-orange, #FF6347);
  transform: translateY(-1px);
}

/* Contador de marcas */
.brands-count {
  text-align: center;
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
  font-weight: 500;
}

.brands-count .count-number {
  color: var(--rdc-orange, #FF6347);
  font-weight: 700;
  font-size: 18px;
}

/* Grid de marcas */
.brands-grid {
  display: grid;
  gap: 25px;
  margin-bottom: 40px;
}

.brands-grid.style-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.brands-grid.style-list {
  grid-template-columns: 1fr;
  gap: 15px;
}

.brands-grid.columns-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.brands-grid.columns-3 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.brands-grid.columns-4 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.brands-grid.columns-5 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.brands-grid.columns-6 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Elementos de marca */
.brand-item {
  background: #ffffff;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
}

.brand-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 124, 186, 0.1) 0%, rgba(255, 99, 71, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.brand-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
  border-color: var(--rdc-blue, #007cba);
}

.brand-item:hover::before {
  opacity: 1;
}

.brand-link {
  display: block;
  padding: 30px 20px;
  text-decoration: none;
  color: inherit;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.brand-logo {
  max-width: 100%;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: grayscale(20%);
}

.brand-logo.size-small { max-height: 60px; }
.brand-logo.size-medium { max-height: 80px; }
.brand-logo.size-large { max-height: 100px; }

.brand-item:hover .brand-logo {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.brand-name-text {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.brand-item:hover .brand-name-text {
  color: var(--rdc-blue, #007cba);
  transform: scale(1.05);
}

/* Vista en lista */
.brands-grid.style-list .brand-item {
  border-radius: 10px;
}

.brands-grid.style-list .brand-link {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  padding: 20px 25px;
  gap: 20px;
}

.brands-grid.style-list .brand-logo {
  max-height: 50px;
  max-width: 100px;
  flex-shrink: 0;
}

.brands-grid.style-list .brand-name-text {
  text-align: left;
  font-size: 18px;
}

/* Estados de carga y vacío */
.brands-loading {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.brands-loading .loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--rdc-blue, #007cba);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.brands-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.brands-empty-icon {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 20px;
}

/* Animaciones de entrada */
.brand-item {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.brand-item:nth-child(1) { animation-delay: 0.1s; }
.brand-item:nth-child(2) { animation-delay: 0.2s; }
.brand-item:nth-child(3) { animation-delay: 0.3s; }
.brand-item:nth-child(4) { animation-delay: 0.4s; }
.brand-item:nth-child(5) { animation-delay: 0.5s; }
.brand-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .rdc-all-brands {
    padding: 40px 15px;
  }

  .all-brands-title {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .alphabet-filter {
    padding: 15px;
    gap: 6px;
    margin-bottom: 30px;
  }

  .filter-button {
    padding: 8px 12px;
    font-size: 12px;
  }

  .brands-grid {
    gap: 20px;
  }

  .brands-grid.columns-2,
  .brands-grid.columns-3,
  .brands-grid.columns-4,
  .brands-grid.columns-5,
  .brands-grid.columns-6 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .brand-link {
    padding: 20px 15px;
  }

  .brands-grid.style-list .brand-link {
    padding: 15px 20px;
  }
}

@media (max-width: 480px) {
  .all-brands-title {
    font-size: 1.6rem;
    letter-spacing: 1px;
  }

  .alphabet-filter {
    gap: 4px;
  }

  .filter-button {
    padding: 6px 10px;
    font-size: 11px;
  }

  .brands-grid.columns-2,
  .brands-grid.columns-3,
  .brands-grid.columns-4,
  .brands-grid.columns-5,
  .brands-grid.columns-6 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .brands-grid.style-list .brand-link {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .brands-grid.style-list .brand-name-text {
    text-align: center;
    font-size: 16px;
  }
}

/* Variables CSS para personalización fácil */
:root {
  --brand-card-bg: #ffffff;
  --brand-border-radius: 15px;
  --brand-hover-scale: 1.02;
  --brand-hover-lift: -8px;
}