/*/home/usdigitalventure/public_html/wp-content/themes/generatepress_child_theme_v1/pages/brands-page.css*/

/* -------------------------------------------------------------
 * Brands page styles
 * File: pages/brands-page.css
 * Scope: .rg-brands-page wrapper (Brands Page template only)
 * ---------------------------------------------------------- */

.rg-brands-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ---------- Header + search ---------- */

.rg-brands-header {
  /*background: #050608;*/
  background:var(--base);
  color: var(--contrast);
  border-radius: 18px;
  padding: 20px 20px 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  margin-bottom: 16px;
}

.rg-brands-title {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 700;
}

/* Search bar */

.rg-brands-search-wrap {
  display: flex;
  align-items: center;
  background: #2b2d30;
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.rg-search-icon {
  margin-right: 8px;
  font-size: 16px;
  opacity: 0.9;
}

.rg-brands-search-input {
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  font-size: 15px;
  width: 100%;
}

.rg-brands-search-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* Index row */

.rg-brands-index {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 13px;
}

.rg-index-label {
  margin-right: 6px;
  color: rgba(255, 255, 255, 0.7);
}

.rg-index-letter {
  padding: 2px 5px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  color: var(--accent);
}

.rg-index-letter:hover {
  /*background: var(--accent);*/
  background: rgba(255, 255, 255, 0.08);
}

.rg-index-letter.is-empty {
  cursor: default;
  color: rgba(255, 255, 255, 0.35);
}

/* ---------- Body + groups ---------- */

.rg-brands-body {
  background: var(--base);
  border-radius: 22px;
  padding: 18px 14px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.rg-brand-group {
  margin-bottom: 24px;
}

/* New: header wrapper for letter + toggle (keeps layout clean) */
.rg-brand-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.rg-brand-group-title {
  margin: 0;
  color: var(--contrast);
  font-size: 17px;
  font-weight: 600;
}

/* Toggle button (similar style to category toggle, but on dark bg) */
.rg-brand-toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: var(--contrast);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.rg-brand-toggle:hover {
  /*background: rgba(255, 255, 255, 0.08);*/
  background: var(--accent);
}

/* Container that is toggled open/closed */
.rg-brand-children[hidden] {
  display: none !important;
}

/* ---------- Cards: shared ---------- */

.rg-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  align-items: stretch;       /* makes each grid cell same height in a row */
}

.rg-brand-card {
  text-decoration: none;
  color: inherit;
  display: flex;            /* let inner card stretch to full grid cell */
}

.rg-brand-card-inner {
  background: #f7f6f2;
  border-radius: 16px;
  padding: 10px 10px;
  display: flex;
  align-items: center;      /* center logo + text vertically */
  gap: 10px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  flex: 1;                  /* fill whole cell */
  height: 100%;             /* equal height with siblings */
  min-height: 70px;         /* tweak this if you want taller/shorter cards */
}

.rg-brand-card:hover .rg-brand-card-inner {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
}

.rg-brand-card-hidden {
  display: none !important;
}

/* Logo */

.rg-brand-logo-wrap {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rg-brand-logo {
  max-width: 40px;
  max-height: 40px;
  width: 100%;
  height: auto;
  object-fit: contain;   /* keeps logo centered and not stretched */
  display: block;
}

.rg-brand-logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Text area */

.rg-brand-text {
  flex: 1;
}

.rg-brand-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.rg-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: #111111;
}

.rg-brand-count {
  font-size: 13px;
  color: #555555;
}

.rg-brand-offer {
  margin-top: 2px;
  font-size: 13px;
  color: #cc0000;
}

.rg-brand-offer-empty {
  color: transparent;
}

/* Empty message */

.rg-brands-empty {
  color: #ffffff;
}

/* ---------- Mobile: 2-column grid ---------- */

@media (max-width: 768px) {
  .rg-brands-page {
    padding: 12px 10px 24px;
  }

  .rg-brands-header {
    padding: 10px 12px 8px;
    border-radius: 16px;
    margin-bottom: 10px;
  }

  .rg-brands-title {
    font-size: 22px;
    margin: 0 0 10px;
  }

  .rg-brands-search-wrap {
    padding: 6px 10px;
    margin-bottom: 6px;
  }

  .rg-brands-index {
    font-size: 12px;
    margin-top: 2px;
    gap: 3px;
  }

  .rg-brand-group {
    margin-bottom: 16px;
  }

  .rg-brand-group-title {
    font-size: 15px;
  }

  /* 2 equal-width columns on mobile */
  .rg-brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    align-items: stretch;
    justify-items: stretch;
  }

  .rg-brand-card-inner {
    border-radius: 12px;
    padding: 7px 9px;
    align-items: center;
    min-height: 60px;
    gap: 8px;
  }

  .rg-brand-logo-wrap {
    flex: 0 0 30px;
  }

  .rg-brand-logo {
    max-width: 30px;
    max-height: 30px;
  }

  .rg-brand-line {
    align-items: flex-start;
  }

  /* Allow up to 2 lines for brand name */
  .rg-brand-name {
    font-size: 14px;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;        /* max 2 lines */
    -webkit-box-orient: vertical;
  }

  .rg-brand-count {
    font-size: 12px;
    flex-shrink: 0;
    margin-left: 4px;
  }

  .rg-brand-offer {
    font-size: 12px;
    margin-top: 2px;
  }
}

/* ---------- Larger screens: wide grid ---------- */

@media (min-width: 769px) {
  .rg-brands-page {
    padding-top: 15px;
  }

  .rg-brand-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  @media (min-width: 1100px) {
    .rg-brand-grid {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }
  }
}

/* for brands search filtering */

/* Hide individual cards / groups when filtered out */
.rg-brand-card-hidden {
  display: none;
}

.rg-brand-group-hidden {
  display: none;
}

/* While search is active, hide the index bar + letter headings */
.rg-brands-page.is-search-active .rg-brands-index {
  display: none;
}

/* Hide the header (letter + toggle) while searching for a cleaner list */
.rg-brands-page.is-search-active .rg-brand-group-header {
  display: none;
}

/* Optional: slightly tighter spacing when searching */
.rg-brands-page.is-search-active .rg-brand-group {
  margin-top: 8px;
}