.doi-tac-grid-section {
  width: 100%;
  margin: 0 auto;
  background: #fff;
  padding: 50px 0;
}
.brands-container {
  padding: 0.5px; /* Thinner outer border */
  border-radius: 12px; /* Consistent border radius */
  background: linear-gradient(90deg, #6282b0 0%, #ca2c85 100%);
  max-width: 1200px;
  margin: 30px auto;
  overflow: hidden; /* Ensures content doesn't overflow rounded corners */
}

.brands-grid {
  background: linear-gradient(90deg, #6282b0 0%, #ca2c85 100%);
  border-radius: 11px; /* Slightly smaller than container to maintain consistent edge */
  overflow: hidden;
  padding: 0.5px; /* Thinner inner padding */
}

.row {
  margin: 0;
  background: linear-gradient(90deg, #6282b0 0%, #ca2c85 100%);
}

.brand-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  padding: 20px;
  background-color: white;
  margin: 0.5px; /* Thinner gap between cells */
}

/* Clear all previous border-radius settings */
.brand-cell {
  border-radius: 0;
}

/* Large screens (lg) */
@media (min-width: 1111px) {
  /* Top row corners */
  .row:first-child > div:first-child .brand-cell {
    border-top-left-radius: 10px;
  }

  .row:first-child > div:nth-child(6) .brand-cell {
    border-top-right-radius: 10px;
  }

  /* Bottom row corners */
  /*.row:last-child > div:nth-child(10) .brand-cell {*/
  /*  border-bottom-left-radius: 10px;*/
  /*}*/

  .row:last-child > div:last-child .brand-cell {
    border-bottom-right-radius: 10px;
  }
}
/*  */
.col-6,
.col-12,
.col-md-4,
.col-md-8,
.col-lg-2,
.col-lg-4 {
  padding: 0;
}

/* Responsive for <= 1111px */
@media (max-width: 1111px) {
  .brands-container {
    max-width: 95vw;
    margin: 20px auto;
    padding: 0.5px;
  }
  .brands-grid {
    padding: 0.5px;
  }
  .brand-cell {
    height: 140px;
    padding: 12px;
  }
  /* Row 1 và Row 3: 3 cột 1 hàng */
  .brands-grid .row > div:nth-child(-n + 6),
  .brands-grid .row > div:nth-child(n + 10):nth-child(-n + 100) {
    flex: 0 0 33.333% !important;
    max-width: 33.333% !important;
  }
}

/* Responsive for <= 992px (Bootstrap md) */
@media (max-width: 991.98px) {
  .brand-cell {
    height: 120px;
    padding: 10px;
  }
  .brands-container {
    max-width: 99vw;
    margin: 10px auto;
  }
  .brands-grid {
    border-radius: 8px;
  }
}

/* Responsive for <= 768px (Bootstrap sm) */
@media (max-width: 767.98px) {
  .brand-cell {
    height: 90px;
    padding: 6px;
  }
  .brands-container {
    padding: 0.5px;
    border-radius: 8px;
  }
  .brands-grid {
    border-radius: 7px;
  }
  .doi-tac-grid-section {
    padding-top: 0;
  }
  .row {
    flex-wrap: wrap;
  }
  .brands-grid .row > div:nth-child(7),
  .brands-grid .row > div:nth-child(8),
  .brands-grid .row > div:nth-child(9) {
    flex: 0 0 33.333% !important;
    max-width: 33.333% !important;
  }
  /* Top row corners */
  .row:first-child > div:first-child .brand-cell {
    border-top-left-radius: 5px;
  }
  .row:first-child > div:nth-child(3) .brand-cell {
    border-top-right-radius: 5px;
  }
  /* Bottom row corners */
  /*.row:last-child > div:nth-child(13) .brand-cell {*/
  /*  border-bottom-left-radius: 5px;*/
  /*}*/
  .row:last-child > div:last-child .brand-cell {
    border-bottom-right-radius: 5px;
  }
}

/* Responsive for <= 576px (xs) */
@media (max-width: 575.98px) {
  .brand-cell {
    height: 70px;
    padding: 4px;
  }
  .brands-container {
    padding: 0.5px;
    border-radius: 6px;
  }
  .brands-grid {
    border-radius: 5px;
  }
  .doi-tac-grid-section {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Make sure images always fit and are centered */
.brand-cell img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  cursor: pointer;
}

/* Overlay */
.brand-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Popup box */
.brand-popup {
  background: #fafafab8;
  backdrop-filter: blur(12px);
  padding: 24px;
  min-width: 320px;
  border-radius: 12px;
  overflow: hidden;
}

.brand-popup-wrap {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: row;
  gap: 40px;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 1300px) {
  .brand-popup-wrap {
    flex-direction: column;
    gap: 20px;
    min-height: unset;
    height: 100%;
    max-width: 95vw;
    padding: 16px 8px;
  }
  .brand-popup-logo {
    padding: 20px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }
  .brand-popup-content {
    padding: 20px;
  }
  .brand-popup-content h2 {
    font-size: 24px;
  }
  .brand-popup-owner {
    font-size: 18px;
  }
  .brand-popup-addresses {
    font-size: 15px;
    gap: 8px;
    margin-top: 10px;
  }
}

@media (max-width: 768px) {
  .brand-popup {
    border-radius: 8px;
    min-width: unset;
    width: 90%;
  }
  .brand-popup-wrap {
    border-radius: 8px;
    padding: 8px 8px;
    gap: 10px;
  }
  .brand-popup-logo {
    max-width: 120px;
    margin-bottom: 8px;
  }
  .brand-popup-content h2 {
    font-size: 16px;
  }
  .brand-popup-owner {
    font-size: 13px;
  }
  .brand-popup-addresses {
    font-size: 12px;
    gap: 6px;
    margin-top: 6px;
  }
  .brand-popup-close {
    top: 2px;
    right: 2px;
    font-size: 1.5rem;
  }
}

/* Logo */
.brand-popup-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 306px;
  width: 100%;
}
.brand-popup-logo img {
  width: 100%;
  height: 100%;
  max-width: 242px;
  object-fit: contain;
}

/* Content */
.brand-popup-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand-popup-content h2 {
  color: #0a4670;
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 8px;
  margin-top: 0;
  line-height: 1.5;
  font-family: "1FTV VIP Classico URW Bold";
}
.brand-popup-owner {
  color: #0a4670;
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.5;
  font-family: "1FTV VIP Classico URW Bold";
}
.brand-popup-owner a {
  color: #0a9fed;
  text-decoration: none;
  font-family: "1FTV VIP Classico URW Bold";
}
.brand-popup-addresses {
  color: #0a4670;
  font-size: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.5;
  margin-top: 15px;
}
.brand-popup-addresses div {
    font-family: "1FTV VIP Classico URW";
}
.brand-popup-addresses span {
  font-weight: 500;
  text-transform: uppercase;
  margin-right: 4px;
   font-family: "1FTV VIP Classico URW Bold";
}

/* Close button */
.brand-popup-close {
  position: absolute;
  top: -5px;
  right: 10px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s;
}
.brand-popup-close:hover {
  color: #005e9a;
}

@media (min-width: 1300px) {
  .brand-popup {
    width: 1076px;
    max-width: 1076px;
    height: 354px;
    min-width: unset;
  }
}

/* Responsive font-size for popup */
.brand-popup-content h2 {
  font-size: 32px;
}
.brand-popup-owner {
  font-size: 24px;
}
.brand-popup-addresses {
  font-size: 18px;
}

@media (max-width: 1300px) {
  .brand-popup-content h2 {
    font-size: 24px;
  }
  .brand-popup-owner {
    font-size: 18px;
  }
  .brand-popup-addresses {
    font-size: 15px;
  }
}

@media (max-width: 900px) {
  .brand-popup-content h2 {
    font-size: 18px;
  }
  .brand-popup-owner {
    font-size: 15px;
  }
  .brand-popup-addresses {
    font-size: 13px;
  }
}
.brand-title {
  font-size: 32px;
  line-height: 1.5;
  color: #005e9a;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  padding-bottom: 25px;
  font-family: "1FTV VIP Classico URW Bold";
}

@media (max-width: 900px) {
  .brand-title {
    font-size: 22px;
    padding-bottom: 16px;
  }
}

@media (max-width: 700px) {
  .brand-title {
    font-size: 18px;
   padding: 24px 0 18px 0;
  }
}
