/* 2.18.0: shop UI (inc/shop-products.php, inc/shop-links.php). Self-contained: the H54 plugin page has no theme CSS,
   so every colour has a fallback and the file is inlined there. WCAG AA: navy/yellow 10:1, white/blue 6.3:1. */
.mp-shop,
.mp-shop-products,
.mp-shop-top,
.mp-mbar {
  --mp-navy: var(--navy-deep, #031b3f);
  --mp-blue: var(--blue-strong, #005eb8);
  --mp-yellow: var(--yellow, #f7c948);
  --mp-line: var(--line, #d7e2ec);
  --mp-ink: var(--ink, #102033);
  font-family: inherit;
}

/* Shop buttons of the guide box (2.16.0) and of the cards: one look, the shop yellow */
.mp-shop {
  max-width: 1180px;
  margin: 1rem auto;
  padding: 0 clamp(0.85rem, 3vw, 1.25rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.mp-shop-btn,
.mp-top-cta,
.mp-sp-quote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border: 2px solid transparent;
  border-radius: 7px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.mp-shop-btn {
  background: var(--mp-yellow);
  border-color: var(--mp-yellow);
  color: var(--mp-navy);
}

.mp-shop-btn:hover,
.mp-shop-btn:focus-visible {
  background: #fff;
  border-color: var(--mp-navy);
  color: var(--mp-navy);
}

.mp-sp-quote {
  background: #fff;
  border-color: var(--mp-blue);
  color: var(--mp-blue);
}

.mp-sp-quote:hover,
.mp-sp-quote:focus-visible {
  background: var(--mp-blue);
  color: #fff;
}

/* Under the H1 */
.mp-shop-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.9rem 0 1.1rem;
}

.mp-top-cta {
  background: var(--mp-navy);
  border-color: var(--mp-navy);
  color: #fff;
}

.mp-top-cta:hover,
.mp-top-cta:focus-visible {
  background: var(--mp-blue);
  border-color: var(--mp-blue);
  color: #fff;
}

.mp-top-cta-alt {
  background: var(--mp-yellow);
  border-color: var(--mp-yellow);
  color: var(--mp-navy);
}

.mp-top-cta-alt:hover,
.mp-top-cta-alt:focus-visible {
  background: #fff;
  border-color: var(--mp-navy);
  color: var(--mp-navy);
}

/* Cards */
.mp-shop-products {
  max-width: 1180px;
  margin: 2.4rem auto;
  padding: 0 clamp(0.85rem, 3vw, 1.25rem);
  color: var(--mp-ink);
  line-height: 1.9;
  scroll-margin-top: 90px;
}

.mp-shop-products h2 {
  margin: 0 0 0.6rem;
}

.mp-sp-group {
  margin: 1.8rem 0 0.8rem;
  padding-inline-start: 0.7rem;
  border-inline-start: 4px solid var(--mp-yellow);
  font-size: 1.2rem;
  scroll-margin-top: 90px;
}

.mp-sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
  gap: 1.1rem;
  align-items: stretch;
}

.mp-sp-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--mp-line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  scroll-margin-top: 90px;
  box-shadow: 0 4px 14px rgba(6, 42, 95, 0.06);
}

.mp-sp-card img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: contain;
  padding: 0.6rem;
  box-sizing: border-box;
  background: #fff;
  border-bottom: 1px solid var(--mp-line);
}

.mp-sp-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.9rem 1rem 1rem;
}

.mp-sp-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.mp-sp-body h3 a {
  color: inherit;
  text-decoration: none;
}

.mp-sp-body h3 a:hover,
.mp-sp-body h3 a:focus-visible {
  text-decoration: underline;
}

.mp-sp-body p {
  margin: 0 0 0.5rem;
}

.mp-sp-meta {
  font-size: 0.95rem;
  color: #3a4756;
}

.mp-sp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.8rem;
}

.mp-sp-more {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
}

.mp-sp-more a,
.mp-sp-meta a {
  color: var(--mp-blue);
  font-weight: 700;
}

.mp-sp-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.4rem 0 0.2rem;
}

.mp-sp-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--mp-line);
  border-radius: 999px;
  background: #f5f8fb;
  color: var(--mp-navy);
  font-weight: 700;
  text-decoration: none;
}

.mp-sp-jump a:hover,
.mp-sp-jump a:focus-visible {
  border-color: var(--mp-blue);
  color: var(--mp-blue);
}

/* Header button: always visible, next to «استعلام قیمت» */
.nav-actions .mp-nav-shop {
  background: var(--yellow, #f7c948);
  border-color: var(--yellow, #f7c948);
  color: var(--navy-deep, #031b3f);
  box-shadow: 0 8px 18px rgba(247, 201, 72, 0.32);
}

.nav-actions .mp-nav-shop:hover,
.nav-actions .mp-nav-shop:focus-visible {
  background: #fff;
  border-color: var(--navy-deep, #031b3f);
}

/* Bottom bar on phones: never covers content (the spacer is as tall as the bar) */
.mp-mbar,
.mp-mbar-spacer {
  display: none;
}

@media (max-width: 760px) {
  .mp-mbar-spacer {
    display: block;
    height: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .mp-mbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--mp-line);
    box-shadow: 0 -6px 18px rgba(6, 42, 95, 0.12);
  }

  .mp-mbar a {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
  }

  .mp-mbar-quote {
    background: var(--mp-blue);
    color: #fff;
  }

  .mp-mbar-shop {
    background: var(--mp-yellow);
    color: var(--mp-navy);
  }

  .mp-sp-card img {
    height: 200px;
  }

  .mp-top-cta {
    flex: 1 1 100%;
  }
}

.mp-sp-grid.mp-sp-grid-mini {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

/* Link colours of the page content must not win over button text (contrast) */
main .mp-shop-top a.mp-top-cta,
main .mp-shop-top a.mp-top-cta:hover,
main .mp-shop-top a.mp-top-cta:focus-visible { color: #fff; text-decoration: none; }
main .mp-shop-top a.mp-top-cta-alt,
main .mp-shop-top a.mp-top-cta-alt:hover,
main .mp-shop-top a.mp-top-cta-alt:focus-visible { color: var(--mp-navy); }
main a.mp-shop-btn, main a.mp-shop-btn:hover { color: var(--mp-navy); text-decoration: none; }
main a.mp-sp-quote { color: var(--mp-blue); text-decoration: none; }
main a.mp-sp-quote:hover, main a.mp-sp-quote:focus-visible { color: #fff; }
.mp-mbar a.mp-mbar-quote { color: #fff; }
.mp-mbar a.mp-mbar-shop { color: var(--mp-navy); }
.nav-actions .btn { min-height: 44px; }
.mp-sp-more a { display: inline-flex; align-items: center; min-height: 44px; }

/* H54 plugin page: slim top bar (the page has no site header) */
.mp-h54-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 1px solid #d7e2ec;
  font-family: Tahoma, Arial, sans-serif;
}

.mp-h54-bar .mp-h54-home {
  color: #031b3f;
  font-weight: 700;
  text-decoration: none;
}

.mp-h54-bar .mp-h54-actions {
  display: flex;
  gap: 0.5rem;
}

.mp-h54-bar .btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid #005eb8;
  border-radius: 8px;
  background: #005eb8;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.mp-h54-bar .btn.mp-nav-shop {
  background: #f7c948;
  border-color: #f7c948;
  color: #031b3f;
}
