/* /custom/member-pricing/assets/member-pricing.css */

/* =========================================
   Page wrapper
   ========================================= */
.mp-page.mp-page--white{
  background:#fff;
  min-height: calc(100vh - 180px);
  padding-top: 80px; /* clears the fixed black header */
}

.mp-page a{ color: inherit; text-decoration:none; }
.mp-page a:hover{ text-decoration:none; }

.mp-container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px 46px;
}

/* =========================================
   Flybar (mobile-first: tap toggles)
   ========================================= */
.mp-flybar{
  display:flex;
  gap: 12px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

.mp-fly{ width: 100%; position: relative; }

.mp-fly-trigger--btn{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.mp-fly-trigger--btn::after{ content: "▾"; opacity: 0.7; }
.mp-fly.is-open .mp-fly-trigger--btn::after{ content: "▴"; }

.mp-flyout{
  display:none;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  background:#fff;
}
.mp-fly.is-open .mp-flyout{ display:block; }

.mp-flyout a{
  display:inline-block;
  padding: 6px 10px;
  margin: 0 8px 8px 0;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}
/* ===== Mobile flyouts: ensure full-width + on top + clickable ===== */
.mp-flybar { position: relative; z-index: 10; }

.mp-fly { position: relative; }

@media (max-width: 859px){
  /* Make flyouts span the full container width (not just the button column) */
  .mp-flyout{
    position: relative;      /* keep it in flow under its button */
    width: 100%;
    z-index: 9999;           /* sit above siblings */
  }

  /* Critical: prevent the other controls from stealing taps when a flyout is open */
  .mp-fly.is-open{ z-index: 10000; }

  /* Defensive: if something overlaps, force clicks to register on the flyout */
  .mp-flyout,
  .mp-flyout *{
    pointer-events: auto;
  }
}

/* =========================================
   Titles / lead
   ========================================= */
.mp-title{ margin: 8px 0 6px; }
.mp-lead{ margin: 0 0 12px; max-width: 980px; }
.mp-subhead{
  text-align:center;
  margin: 14px 0 12px;
  font-weight: 600;
  opacity: 0.9;
}

/* =========================================
   Hero (index.php)
   ========================================= */
.mp-hero{
  display:flex;
  justify-content:center;
  margin: 10px 0 12px;
}
.mp-hero img{
  width: 100%;
  max-width: 1080px;
  height:auto;
  display:block;
}

/* =========================================
   Marketing panels (index.php)
   ========================================= */
.mp-panel{ margin-top: 12px; text-align:center; }
.mp-panel-title{ margin: 10px 0 10px; }

/* Popular Brands */
.mp-brand-row{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap: 12px 16px;
  padding: 6px 0 8px;
  margin-left: -6px;
  margin-right: -6px;
}
.mp-brand-item{
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 2px 0;
}
.mp-brand-item img{
  height: 28px;
  width:auto;
  display:block;
}

/* Popular Categories (mobile: 2 across, no crop) */
.mp-cat-row{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap: 14px;
  padding: 8px 0 4px;
}
.mp-cat-card{
  width: calc(50% - 7px);
  max-width: 220px;
  text-align:center;
}
.mp-cat-img{
  width: 100%;
  height: auto !important;
  background:#fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  overflow: hidden;
  padding: 6px;
}
.mp-cat-img img{
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  display:block;
  max-height: none !important;
}
.mp-cat-img-fallback{
  width:100%;
  padding: 28px 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity: 0.7;
  font-size: 13px;
}
.mp-cat-label{ margin-top: 8px; }

/* =========================================
   Search (shared)
   ========================================= */
.mp-search{
  width: 100%;
  display:flex;
  gap: 8px;
  align-items:center;
  margin-top: 8px;
}
.mp-search__input{
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 10px;
  font: inherit;
}
.mp-search__btn{
  width: 44px;
  height: 44px;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

/* =========================================
   PANELS.PHP cards (mobile)
   ========================================= */
.mp-panels{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  justify-content: center;
  align-items: start;
}

.mp-card{
  display:block;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  background: #fff;
  overflow:hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.mp-card__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 10px 8px;
}
.mp-card__brand img{
  height: 18px;
  width: auto;
  display:block;
}
.mp-card__style{
  font-weight: 600;
  opacity: 0.75;
  font-size: 14px;
}

.mp-card__imgwrap{
  position: relative;
  border-top: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: #f7f7f7;
}
.mp-card__img{
  width: 100%;
  height: auto;
  display:block;
}
.mp-card__imgfallback{
  padding: 60px 10px;
  text-align:center;
  opacity: 0.7;
}

.mp-sale-badge{
  position:absolute;
  top: 10px;
  left: 10px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #d11;
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.0;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.mp-card__meta{
  padding: 8px 10px 8px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.15;
}
.mp-card__meta-red{ color: #c00; }
.mp-card__meta-line1{ white-space: nowrap; }
.mp-card__meta-line2{ margin-top: 2px; white-space: nowrap; }

.mp-card__name{
  padding: 0 10px 4px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  min-height: 32px;
}
.mp-card__weight{
  padding: 0 10px 10px;
  font-size: 12px;
  opacity: 0.75;
}

/* =========================================
   DETAILS PAGE (style.php)
   ========================================= */
.mp-detail{
  display:block;
  margin-top: 10px;
}

.mp-detail__left{ margin: 0 0 18px; }
.mp-detail__right{ }

/* Critical: allow right column to shrink within CSS grid (prevents overflow) */
.mp-detail__right{ min-width: 0; }

.mp-detail__imagewrap{
  width: 100%;
  max-width: 360px;
}
.mp-detail__image{
  width: 100%;
  height:auto;
  display:block;
}
.mp-detail__imagefallback{
  padding: 80px 10px;
  text-align:center;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  opacity: 0.7;
}

.mp-detail__colorname{
  margin-top: 10px;
  font-weight: 700;
  font-size: 22px;
  text-align: center;
}

.mp-detail__cta{
  margin-top: 12px;
  text-align:center;
}
.mp-detail__cta-title{
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 18px;
}
.mp-detail__cta-msg{
  margin: 8px 0 10px;
  font-size: 14px;
}
.mp-detail__cta-msg--ok{ color: #0a7a2a; }
.mp-detail__cta-msg--err{ color: #b00020; }

.mp-style-title{
  margin: 6px 0 2px;
  font-size: 28px;
  line-height: 1.15;
}
.mp-style-sub{
  margin: 0 0 12px;
  font-size: 22px;
  opacity: 0.9;
}

/* blocks */
.mp-block{ margin: 16px 0; }
.mp-block__title{
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 8px;
}
.mp-block--plain{ margin-top: 18px; }
.mp-details-text{
  font-size: 16px;
  line-height: 1.45;
}

/* Swatches: 50x50 + small spacing */
.mp-swatches{
  display:flex;
  flex-wrap:wrap;
  gap: 4px;
}
.mp-swatch{
  width: 50px;
  height: 50px;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 2px;
  padding: 2px;
  font-size: 10px;
  line-height: 1.0;
  text-align:center;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
}

/* Pricing/Sizing grids: fixed column widths so they line up */
.mp-grid{
  --cols: 6;
  display:grid;
  grid-template-columns: repeat(var(--cols), 50px);
  gap: 3px;
  align-items: stretch;
  justify-content: start;
  max-width: 100%;
  overflow-x: auto; /* safety: prevents page overflow */
}

.mp-grid-spec{
  --cols: 6;
  display:grid;
  grid-template-columns: 26px repeat(var(--cols), 50px);
  gap: 3px;
  align-items: stretch;
  justify-content: start;
  max-width: 100%;
  overflow-x: auto; /* safety: prevents page overflow */
}

.mp-cell{
  border: 1px solid rgba(0,0,0,0.45);
  background: #fff;
  text-align:center;
  padding: 4px 2px;
  font-size: 14px;
  line-height: 1.05;
  box-sizing:border-box;
  min-height: 26px;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space: nowrap;
}

.mp-cell--hdr{
  font-weight: 700;
}
.mp-cell--sale{
  color: #c00;
  font-weight: 700;
}
.mp-cell--lbl{
  font-weight: 800;
  opacity: 0.7;
}

.mp-note{
  margin-top: 6px;
  font-size: 14px;
  opacity: 0.85;
}

/* two-col wrapper for pricing + sizing (stack by default) */
.mp-two-col{
  display:block;
}

/* =========================================
   DESKTOP enhancements
   ========================================= */
@media (min-width: 860px){

  .mp-container{ padding: 10px 18px 60px; }

  /* Flybar: hover menus */
  .mp-flybar{
    gap: 70px;
    flex-wrap: nowrap;
    margin-bottom: 8px;
    position: relative;
    z-index: 2000;
  }

  .mp-fly{ width:auto; display:inline-block; padding-bottom: 12px; }

  .mp-fly-trigger--btn{
    width:auto;
    padding: 2px 0;
    border: 0;
    background: transparent;
  }
  .mp-fly-trigger--btn::after{ display:none; }

  .mp-flyout{
    display:none;
    position:absolute;
    left: 0;
    top: calc(100% - 8px);
    min-width: 270px;
    max-height: 420px;
    overflow:auto;
    margin-top: 0;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 99999;
  }

  .mp-fly:hover .mp-flyout,
  .mp-flyout:hover{ display:block; }

  .mp-flyout a{
    display:block;
    padding: 7px 10px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 14px;
  }
  .mp-flyout a:hover{ background: rgba(0,0,0,0.05); }

  /* Brands flyout: 2 columns */
  .mp-flybar .mp-fly:nth-child(2) .mp-flyout{
    min-width: 420px;
    max-height: none;
    overflow: visible;
    column-count: 2;
    column-gap: 16px;
  }
  .mp-flybar .mp-fly:nth-child(2) .mp-flyout a{
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Search inline right */
  .mp-search{
    width: 260px;
    margin-top: 0;
    margin-left: auto;
  }

  /* Index: desktop category tiles can crop */
  .mp-brand-item img{ height: 22px; }
  .mp-cat-card{ width: 140px; max-width:none; }
  .mp-cat-img{ padding: 0; height: 190px; }
  .mp-cat-img img{ height: 100% !important; object-fit: cover !important; }

  /* PANELS.PHP: desktop = 6 across + centered partial rows */
  .mp-panels{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap: 16px;
  }
  .mp-card{
    box-sizing:border-box;
    flex: 0 0 160px;
    max-width: 160px;
  }
  .mp-card__brand img{ height: 20px; }

  /* DETAILS: two columns (but keep Quote + Sizing stacked to avoid overflow on 1366px laptops) */
  .mp-detail{
    display:grid;
    grid-template-columns: 320px 1fr; /* narrower left column helps mid screens */
    gap: 22px;
    align-items:start;
  }
  .mp-detail__left{ margin: 0; }
  .mp-detail__right{ min-width: 0; }
  .mp-detail__imagewrap{ max-width: 320px; }
  .mp-detail__colorname{ text-align:center; }

  /* IMPORTANT: do NOT force 2-col grids on normal desktops */
  .mp-two-col{
    display:block;
  }
}

/* =========================================================
   MOBILE: Categories + Brands side-by-side
   - keeps Search full width below
   - keeps flyouts full width (not half)
   ========================================================= */
@media (max-width: 859px){

  /* Put Cats + Brands on one row */
  .mp-flybar .mp-fly{
    width: calc(50% - 6px);
  }

  /* Search always takes its own row */
  .mp-search{
    width: 100%;
    flex: 0 0 100%;
  }

  /* Make flyouts span the full flybar width, not half */
  .mp-flybar{ position: relative; }
  .mp-fly{ position: relative; }

  /* First flyout expands to the right */
  .mp-flybar .mp-fly:nth-child(1) .mp-flyout{
    width: calc(200% + 12px);
    box-sizing: border-box;
  }

  /* Second flyout expands to the left */
  .mp-flybar .mp-fly:nth-child(2) .mp-flyout{
    width: calc(200% + 12px);
    margin-left: calc(-100% - 12px);
    box-sizing: border-box;
  }

  /* Ensure links behave nicely in the wider flyout */
  .mp-flyout a{ white-space: nowrap; }
}
