/**
 * CartNexa Premium Store Widgets - Trusted Brands Styles
 * Clean logo row (no boxes), matches the reference home page.
 *
 * @package CartNexa_Premium_Store_Widgets
 * @author  hire_rayhan
 */

.cnxpsw-trusted-brands {
  position: relative;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.cnxpsw-trusted-brands *,
.cnxpsw-trusted-brands *::before,
.cnxpsw-trusted-brands *::after {
  box-sizing: border-box;
}

/* Header */
.cnxpsw-trusted-brands__header {
  margin-bottom: 24px;
}

.cnxpsw-trusted-brands__title {
  margin: 0;
  color: var(--cnxpsw-text-dark, #0B1F33);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

/* Grid: one even row of logos on desktop */
.cnxpsw-trusted-brands__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 32px;
  align-items: center;
  width: 100%;
}

/* Item: no box, no border, no shadow */
.cnxpsw-trusted-brands__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 56px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
}

a.cnxpsw-trusted-brands__item {
  cursor: pointer;
}

a.cnxpsw-trusted-brands__item:focus-visible {
  outline: 2px solid var(--cnxpsw-primary, #1677D2);
  outline-offset: 2px;
}

/* Logo image */
.cnxpsw-trusted-brands__img {
  display: block;
  max-width: 100%;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

a.cnxpsw-trusted-brands__item:hover .cnxpsw-trusted-brands__img,
a.cnxpsw-trusted-brands__item:hover .cnxpsw-trusted-brands__text {
  transform: scale(1.05);
}

/* Text fallback (when no logo image is uploaded) */
.cnxpsw-trusted-brands__text {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  font-family: inherit;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--cnxpsw-text-dark, #0B1F33);
  user-select: none;
  transition: transform 0.25s ease, color 0.2s ease;
}

/* Brand look-alikes for the text fallback */
.cnxpsw-brand--varta {
  color: #0B4DA2;
  font-weight: 900;
  letter-spacing: 0.01em;
  gap: 0.22em;
}
.cnxpsw-brand--varta::before {
  content: "";
  flex: 0 0 auto;
  width: 0.8em;
  height: 0.8em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' rx='2' fill='%231B3F94'/%3E%3Cpath d='M4 5h16l-8 14z' fill='%23FFD100'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cnxpsw-brand--gp {
  color: #1FA84F;
  font-size: 1.35em;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.cnxpsw-brand--sony {
  color: #111827;
  font-family: "Times New Roman", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.cnxpsw-brand--panasonic {
  color: #0041C0;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
}

.cnxpsw-brand--duracell {
  color: #111827;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.cnxpsw-brand--energizer {
  color: #111827;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: none;
}

/* Optional grayscale effect */
.cnxpsw-trusted-brands--grayscale .cnxpsw-trusted-brands__img {
  filter: grayscale(100%);
  opacity: 0.7;
}

.cnxpsw-trusted-brands--grayscale .cnxpsw-trusted-brands__text {
  color: #64748B;
}

.cnxpsw-trusted-brands--grayscale .cnxpsw-trusted-brands__item:hover .cnxpsw-trusted-brands__img {
  filter: grayscale(0%);
  opacity: 1;
}

.cnxpsw-trusted-brands--grayscale .cnxpsw-trusted-brands__item:hover .cnxpsw-trusted-brands__text {
  color: var(--cnxpsw-primary, #1677D2);
}

/* Tablet */
@media (max-width: 1024px) {
  .cnxpsw-trusted-brands__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  .cnxpsw-trusted-brands__text { font-size: 26px; }
}

/* Mobile: 3 x 2 grid, text scales with the screen so nothing is cut */
@media (max-width: 767px) {
  .cnxpsw-trusted-brands__header { margin-bottom: 16px; }
  .cnxpsw-trusted-brands__title { font-size: 18px; }

  .cnxpsw-trusted-brands__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .cnxpsw-trusted-brands__item {
    min-height: 44px;
    padding: 6px 4px;
  }

  .cnxpsw-trusted-brands__img { max-height: 30px; }
  .cnxpsw-trusted-brands__text { font-size: min(20px, 5.2vw); }
}

@media (prefers-reduced-motion: reduce) {
  .cnxpsw-trusted-brands__item,
  .cnxpsw-trusted-brands__img,
  .cnxpsw-trusted-brands__text {
    transition: none !important;
    transform: none !important;
  }
}
