/*
  My Partners Grid styles
  - Designed to inherit typography from the active theme (incl. Flatsome)
  - Uses CSS variables with fallbacks so the theme can override colors
*/

.mpp-wrapper{
  --mpp-primary: var(--primary-color, #0D163F);
  --mpp-accent:  var(--accent-color, #0073aa);
  --mpp-border:  rgba(0,0,0,0.12);
  --mpp-muted:   rgba(0,0,0,0.06);
}

.mpp-filter{ margin-bottom: 15px; display:flex; gap:8px; flex-wrap:wrap; }

/* Flatsome styles .button, so we keep our custom styles minimal */
.mpp-filter-btn{ margin:0; }
.mpp-filter-btn.active{ box-shadow: inset 0 0 0 2px var(--mpp-primary); }

.mpp-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.mpp-item{
  background: #fff;
  border: 1px solid var(--mpp-border);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.mpp-item:hover{
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.mpp-item.active-partner{
  box-shadow: 0 0 0 3px var(--mpp-accent);
}

.mpp-thumb-wrap{
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 10px;
  border-bottom: 1px solid var(--mpp-border);
  flex-grow: 1;
}
.mpp-thumb-wrap img{
  max-width: 90%;
  max-height: 90%;
  display: block;
  object-fit: contain;
}

.mpp-title-wrapper{
  background: var(--mpp-primary);
  padding: 12px 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* --- Partner Details Section --- */
.mpp-partner-details-section{
  background: #fff;
  border: 1px solid var(--mpp-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  animation: mppFadeInDown 0.5s ease-out;
}

@keyframes mppFadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mpp-details-top-nav{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--mpp-border);
  padding-bottom: 15px;
}

.mpp-details-close{
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.mpp-details-close:hover{ opacity: 1; }

.mpp-details-nav-arrows{ display:flex; gap:10px; }

/* Keep the Flatsome .button look, but force circular sizing */
.mpp-prev-partner.button,
.mpp-next-partner.button{
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mpp-details-content-wrapper{
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.mpp-details-logo-col{
  flex: 0 0 250px;
  text-align: center;
  padding: 20px;
  border-right: 1px solid var(--mpp-border);
}
.mpp-details-logo{
  max-width: 100%;
  height: auto;
  max-height: 150px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.mpp-details-text-col{ flex-grow: 1; }

.mpp-details-title{
  font-size: 32px;
  font-weight: 700;
  color: inherit;
  margin-bottom: 15px;
}

.mpp-details-text{
  font-size: 16px;
  line-height: 1.8;
  color: inherit;
}

@media (max-width: 992px) {
  .mpp-details-content-wrapper{ flex-direction: column; align-items: center; text-align: center; }
  .mpp-details-logo-col{ flex: none; width: 100%; border-right: none; border-bottom: 1px solid var(--mpp-border); padding-bottom: 20px; margin-bottom: 20px; }
  .mpp-details-logo{ max-width: 200px; margin-bottom: 15px; }
  .mpp-details-title{ font-size: 28px; }
}

@media (max-width: 768px) {
  .mpp-grid{ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
  .mpp-thumb-wrap{ height: 100px; }
  .mpp-title-wrapper{ font-size: 14px; padding: 10px; }
  .mpp-partner-details-section{ padding: 15px; }
  .mpp-details-top-nav{ margin-bottom: 15px; padding-bottom: 10px; }
  .mpp-details-close{ font-size: 24px; }
  .mpp-prev-partner.button,
  .mpp-next-partner.button{ width: 35px; height: 35px; }
  .mpp-details-title{ font-size: 24px; }
  .mpp-details-text{ font-size: 15px; }
}

@media (max-width: 600px) {
  .mpp-grid{ grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mpp-thumb-wrap{ height: 90px; }
  .mpp-title-wrapper{ font-size: 13px; padding: 8px; }
  .mpp-details-logo{ max-width: 150px; }
  .mpp-details-title{ font-size: 20px; }
  .mpp-details-text{ font-size: 14px; }
}
