/* ==============================
   FRP Brand Cards – Responsive (FULL)
   - Fix grid overflow / no-wrap issue (1024–1200)
   - Natural 4 → 3 → 2 → 1 columns using auto-fit
   - Titles stay single-line when there’s room,
     but can wrap in the squeeze zone
   ============================== */

:root {
  --accent: #0066ff;
}

/* ✅ Grid: auto-fit + minmax allows natural wrapping */
.frp-brand-cards-container {
  display: grid;
  /* Key: minmax(260px, 1fr) controls when it drops columns */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.5rem, 2.5vw, 2rem);

  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2rem);
  box-sizing: border-box;

  /* keeps cards centered nicely when columns change */
  justify-items: center;
}

/* ✅ CRITICAL: allow grid items to shrink (prevents overflow) */
.frp-brand-card,
.frp-brand-card__inner {
  min-width: 0;
}

.frp-brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: none;
  width: 100%;
}

.frp-brand-card:hover {
  transform: none;
}

.frp-brand-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.4rem);
  width: 100%;
}

/* Title */
.frp-brand-card__title {
  font-family: 'Oxanium', sans-serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 4.8vw + 0.4rem, 3rem) !important;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  color: #000000 !important;

  /* Default: keep on one line when possible */
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;

  /* Prevent layout blowouts just in case */
  max-width: 100%;
}

/* Button */
.frp-brand-card__btn {
  font-family: 'Oxanium', sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem) !important;
  color: var(--e-global-color-astglobalcolor1, #0066ff);
  border: 2px solid var(--e-global-color-astglobalcolor1, #0066ff);
  border-radius: 6px;
  background: transparent;

  padding: clamp(0.8rem, 2.2vw, 1.1rem) clamp(1.6rem, 4vw, 2.2rem);
  min-width: clamp(140px, 22vw, 200px);

  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;

  /* ✅ ensures long labels never force overflow */
  max-width: 100%;
}

.frp-brand-card__btn:hover,
.frp-brand-card__btn:focus {
  background: color-mix(in srgb, var(--e-global-color-astglobalcolor1, #0066ff) 12%, transparent);
  transform: none;
  text-decoration: none !important;
}

/* Image */
.frp-brand-card__img-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-width: 520px;
  margin: clamp(0.8rem, 2vw, 1.2rem) auto 0;
  overflow: hidden;

  /* ✅ allow shrink inside grid columns */
  min-width: 0;
}

.frp-brand-card__img {
  width: 100%;
  height: 100%;
}

.frp-brand-card__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Force 5-up on wide desktop */
@media (min-width: 1400px) {
  .elementor .frp-brand-cards-container {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

/* ==============================
   SQUEEZE ZONE FIX (1024–1200ish)
   - Let titles wrap instead of forcing overflow
   - Slightly reduce title size so 3-up looks clean
   ============================== */
@media (min-width: 1024px) and (max-width: 1200px) {
  .frp-brand-card__title {
    white-space: normal;          /* ✅ allow wrap */
    text-wrap: balance;           /* nice wraps where supported */
    font-size: clamp(1.9rem, 2.2vw + 0.6rem, 2.6rem) !important;
  }
}

/* Tablet tightening */
@media (max-width: 1024px) {
  .frp-brand-cards-container {
    gap: clamp(1.2rem, 3vw, 1.8rem);
  }

  .frp-brand-card__inner {
    gap: clamp(0.9rem, 2.2vw, 1.2rem);
  }
}

/* Mobile – single column + bigger title/button */
@media (max-width: 767px) {
  .frp-brand-cards-container {
    grid-template-columns: 1fr;
    gap: clamp(1.6rem, 5vw, 2.4rem);
    padding: clamp(1.5rem, 4vw, 2.2rem) clamp(1rem, 3vw, 1.8rem);
  }

  .frp-brand-card__inner {
    gap: clamp(0.9rem, 3vw, 1.3rem);
  }

  .frp-brand-card__title {
    font-size: clamp(2.4rem, 7vw, 3.1rem) !important;
    white-space: normal;   /* mobile should wrap naturally */
  }

  .frp-brand-card__btn {
    font-size: clamp(1.2rem, 4.2vw, 1.5rem) !important;
    padding: clamp(0.95rem, 3.2vw, 1.25rem) clamp(2.0rem, 6vw, 2.6rem);
    min-width: min(320px, 90vw);
  }

  .frp-brand-card__img-wrapper {
    max-width: 520px;
  }
}

/* Extra small phones */
@media (max-width: 480px) {
  .frp-brand-card__img-wrapper {
    max-width: 95%;
  }
}