/* ==========================================================================
   Marketplace - phone layout (below 768px)
   Loaded with media="(max-width: 767.98px)", so tablet and desktop never use it.
   Selectors start with body.marketplace-page to win over the page's inline
   desktop overrides, several of which use !important. The site header above
   the hero comes from header.php and is not restyled here.
   ========================================================================== */

body.marketplace-page {
  --mpm-ink: #0f1c24;
  --mpm-text: #5b6675;
  --mpm-muted: #94a3b8;
  --mpm-line: #e7ecf1;
  --mpm-page: #f6f8fa;
  --mpm-accent: #07debe;
  --mpm-accent-dark: #05a892;
  --mpm-whatsapp: #22c55e;
  --mpm-radius: 18px;
  --mpm-shadow: 0 6px 20px rgba(15, 28, 36, 0.06);
  background: var(--mpm-page);
  -webkit-tap-highlight-color: transparent;
}

body.marketplace-page .container {
  padding-left: 16px;
  padding-right: 16px;
}

/* --------------------------------------------------------------------------
   Hero (white, as on desktop): title beside the picture, text and buttons below.
   On phones the site header floats over the top of the page, so the hero starts
   below it. --mpm-header-h is the header's measured height (set by the page
   script); 92px is used until it is measured.
   -------------------------------------------------------------------------- */
body.marketplace-page .mp-hero-section {
  display: block;
  min-height: 0;
  padding: calc(var(--mpm-header-h, 92px) + 22px) 0 52px;
}

body.marketplace-page .mp-hero-section::before {
  top: 0;
  right: -40%;
  width: 360px;
  height: 360px;
}

body.marketplace-page .mp-hero-section::after {
  display: none;
}

body.marketplace-page .mp-hero-container > .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44%;
  column-gap: 8px;
  align-items: center;
  margin: 0;
}

body.marketplace-page .mp-hero-text {
  display: contents;
}

body.marketplace-page .mp-badge-pill {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: start;
  margin: 0 0 16px;
  padding: 7px 14px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
}

body.marketplace-page .mp-hero-title {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

body.marketplace-page .mp-hero-visual {
  grid-column: 2;
  grid-row: 2;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.marketplace-page .mp-hero-showcase-img {
  width: 100%;
  max-width: none;
  margin: 0;
  filter: drop-shadow(0 12px 20px rgba(15, 23, 42, 0.14));
}

body.marketplace-page .mp-hero-showcase-img:hover {
  transform: none;
}

body.marketplace-page .mp-hero-subtitle {
  grid-column: 1 / -1;
  grid-row: 3;
  max-width: none;
  margin: 16px 0 20px;
  font-size: 14.5px;
  line-height: 1.6;
}

body.marketplace-page .mp-hero-actions {
  grid-column: 1 / -1;
  grid-row: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

/* Buttons: same size, shape and type as desktop, sized for thumbs */
body.marketplace-page .mp-hero-actions .mp-btn-primary,
body.marketplace-page .mp-hero-actions .mp-btn-secondary {
  height: 50px;
  min-width: 0;
  padding: 0 12px;
  gap: 8px;
  border-radius: 12px;
  font-size: 14.5px;
  white-space: nowrap;
  transform: none !important;
}

body.marketplace-page .mp-hero-actions .mp-btn-secondary {
  border-width: 1.5px !important;
}

body.marketplace-page .mp-btn-secondary .play-icon-circle {
  width: 24px;
  height: 24px;
  font-size: 9px;
}

body.marketplace-page .mp-trust-features {
  display: none;
}

/* --------------------------------------------------------------------------
   Search box: a white card overlapping the bottom of the hero, as on desktop
   -------------------------------------------------------------------------- */
body.marketplace-page .mp-search-container {
  max-width: none;
  margin-top: -26px;
  padding: 0 16px;
}

body.marketplace-page .mp-search-card {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

body.marketplace-page .mp-search-select-group,
body.marketplace-page .mp-search-btn {
  display: none;
}

body.marketplace-page .mp-search-icon {
  left: 18px;
  color: #64748b;
  font-size: 17px;
}

body.marketplace-page .mp-search-input {
  height: 54px;
  padding: 0 16px 0 48px;
  border: 1px solid var(--mpm-line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--mpm-ink);
  font-size: 16px; /* 16px stops iPhones zooming in when the box is tapped */
  box-shadow: 0 12px 30px rgba(15, 28, 36, 0.1);
}

body.marketplace-page .mp-search-input::placeholder {
  color: #8a96a3;
}

body.marketplace-page .mp-search-input:focus {
  border-color: var(--mpm-ink);
  box-shadow: 0 0 0 3px rgba(21, 33, 42, 0.12), 0 12px 30px rgba(15, 28, 36, 0.1);
}
/* --------------------------------------------------------------------------
   Category chips: one swipeable row
   -------------------------------------------------------------------------- */
body.marketplace-page #popular-tools {
  padding-top: 0 !important;
}

body.marketplace-page .mp-categories-bar {
  margin: 0 -16px;
  padding: 14px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.marketplace-page .mp-categories-bar::-webkit-scrollbar {
  display: none;
}

body.marketplace-page .mp-pills-list {
  flex-wrap: nowrap;
  gap: 10px;
  width: max-content;
  padding-right: 16px;
}

body.marketplace-page .mp-pill-item {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--mpm-line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--mpm-ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 28, 36, 0.04);
  transform: none !important;
}

body.marketplace-page .mp-pill-item i {
  font-size: 17px;
}

body.marketplace-page .mp-pill-item[data-cat="all"] i {
  color: var(--mpm-accent-dark);
}

body.marketplace-page .mp-pill-item.active {
  box-shadow: 0 6px 16px rgba(21, 33, 42, 0.2);
}

body.marketplace-page .mp-pill-count {
  display: none;
}

/* --------------------------------------------------------------------------
   "Popular Tools" heading
   -------------------------------------------------------------------------- */
body.marketplace-page .mp-catalog-header {
  align-items: center;
  margin: 16px 0 12px;
  padding: 0;
}

body.marketplace-page .mp-catalog-title {
  margin: 0;
  font-size: 24px;
}

body.marketplace-page .mp-catalog-subtitle {
  display: none;
}

body.marketplace-page .mp-view-all-link {
  font-size: 15px;
  transform: none;
}

/* --------------------------------------------------------------------------
   Tool cards: logo left, details right, chat button bottom right
   -------------------------------------------------------------------------- */
body.marketplace-page .mp-products-grid {
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 26px;
}

/* Short list until "View All" (keep n+5 in step with $mobileVisibleTools = 4 in marketplace.php) */
body.marketplace-page .mp-products-grid.is-collapsed .mp-card:nth-child(n+5) {
  display: none !important;
}

/* Card layout on phones:
     [logo]  Name                        >
             Short description (2 lines)
     From $10.99                 * In Stock
     [      Chat with agent (full width)    ]
   The button gets its own row so the name, badge and price always have the full width. */
body.marketplace-page .mp-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid #edf1f4;
  border-radius: var(--mpm-radius);
  box-shadow: var(--mpm-shadow);
  transform: none !important;
}

body.marketplace-page .mp-card > div:first-child,
body.marketplace-page .mp-card-header,
body.marketplace-page .mp-card-title-group,
body.marketplace-page .mp-card-body,
body.marketplace-page .mp-card-footer {
  display: contents;
}

body.marketplace-page .mp-card-logo-box {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  transform: none !important;
}

body.marketplace-page .mp-card-logo-box svg {
  width: 32px;
  height: 32px;
}

body.marketplace-page .mp-card-title {
  grid-column: 2;
  grid-row: 1;
  margin: 0 0 4px;
  padding-right: 30px; /* room for the arrow */
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

body.marketplace-page .mp-card-chevron {
  position: absolute;
  top: 8px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--mpm-muted);
  font-size: 15px;
  text-decoration: none;
}

body.marketplace-page .mp-card-category-tag,
body.marketplace-page .mp-card-plans,
body.marketplace-page .mp-card-price-row .text-muted,
body.marketplace-page .mp-btn-learn {
  display: none;
}

body.marketplace-page .mp-card-desc {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  margin: 0;
  color: var(--mpm-text);
  font-size: 13.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* Price on the left, stock badge on the right, across the whole card */
body.marketplace-page .mp-card-price-row {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: center;
  justify-self: start;
  display: block;
  margin: 14px 0 0;
}

body.marketplace-page .mp-card-body > div:not(.mp-card-price-row) {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: center;
  justify-self: end;
  margin-top: 14px;
}

body.marketplace-page .mp-card-price {
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
}

body.marketplace-page .mp-stock-badge {
  margin: 0;
  padding: 5px 11px;
  border: 0;
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  font-size: 12.5px;
  line-height: 1.2;
  white-space: nowrap;
}

body.marketplace-page .mp-btn-chat {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  width: 100%;
  height: 46px;
  margin-top: 14px;
  padding: 0 16px;
  gap: 8px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  transform: none !important;
}

body.marketplace-page .mp-btn-chat i {
  font-size: 18px;
}
.mpm-show-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  margin: -12px 0 28px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: var(--mpm-ink);
  font-size: 14.5px;
  font-weight: 700;
}

.mpm-show-all[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   How it works: three steps side by side
   -------------------------------------------------------------------------- */
body.marketplace-page .mp-how-it-works {
  margin: 0 0 26px !important;
  padding: 26px 14px 24px;
  border-radius: 22px;
}

body.marketplace-page .mp-how-head {
  margin-bottom: 22px;
}

body.marketplace-page .mp-reviews-eyebrow {
  padding: 5px 12px;
  font-size: 11px;
}

body.marketplace-page .mp-how-title {
  margin: 12px 0 6px;
  font-size: 23px;
}

body.marketplace-page .mp-how-sub {
  font-size: 13.5px;
}

body.marketplace-page .mp-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.marketplace-page .mp-step-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none !important;
}

body.marketplace-page .mp-step-card:not(:last-child)::after {
  display: block;
  top: 28px;
  left: calc(50% + 36px);
  width: calc(100% - 64px);
  border-top-width: 2px;
}

body.marketplace-page .mp-step-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 16px;
  font-size: 22px;
}

body.marketplace-page .mp-step-num {
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  font-size: 11px;
}

body.marketplace-page .mp-step-label {
  display: none;
}

body.marketplace-page .mp-step-title {
  margin: 0 0 4px;
  font-size: 13.5px;
  line-height: 1.3;
}

body.marketplace-page .mp-step-desc {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Reviews: one card at a time with arrows on the sides
   -------------------------------------------------------------------------- */
body.marketplace-page .mp-reviews {
  margin: 0 0 28px;
  padding: 24px 0 0;
}

body.marketplace-page .mp-reviews-head {
  margin-bottom: 16px;
}

body.marketplace-page .mp-reviews-title {
  margin: 12px 0 6px;
  font-size: 21px;
}

body.marketplace-page .mp-reviews-sub {
  font-size: 13px;
}

body.marketplace-page .mp-tst {
  margin-bottom: 16px;
  padding: 0 52px;
}

body.marketplace-page .mp-tst-track {
  gap: 12px;
  padding: 6px 2px 28px;
  margin-bottom: -14px;
}

body.marketplace-page .mp-tst-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  top: calc(50% - 12px);
  width: 44px;
  height: 44px;
  font-size: 14px;
}

body.marketplace-page .mp-tst-prev {
  left: 0;
}

body.marketplace-page .mp-tst-next {
  right: 0;
}

body.marketplace-page .mp-tst.is-static {
  padding: 0;
}

body.marketplace-page .mp-tst-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  flex-basis: 100%;
  padding: 16px;
  border-radius: 18px;
  transform: none !important;
}

body.marketplace-page .mp-tst-quote,
body.marketplace-page .mp-tst-g {
  display: none;
}

body.marketplace-page .mp-tst-person {
  display: contents;
}

body.marketplace-page .mp-tst-avatar {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: center;
  width: 50px;
  height: 50px;
  font-size: 21px;
}

body.marketplace-page .mp-tst-stars {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 6px;
  font-size: 14px;
}

body.marketplace-page .mp-tst-body {
  grid-column: 2;
  grid-row: 2;
  margin-bottom: 8px;
}

body.marketplace-page .mp-tst-body .mp-tst-text {
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

body.marketplace-page .mp-tst-who {
  grid-column: 2;
  grid-row: 3;
}

body.marketplace-page .mp-tst-name {
  font-size: 13.5px;
}

body.marketplace-page .mp-tst-role {
  font-size: 11.5px;
}

/* Dark Google rating bar: rating on top, full-width button underneath.
   Side by side there is not enough width on a phone, so the button covered the text. */
body.marketplace-page .mp-reviews-summary {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 16px;
  padding: 18px 16px 16px;
  border-radius: 20px;
}

body.marketplace-page .mp-reviews-score {
  min-width: 0;
  gap: 14px;
}

body.marketplace-page .mp-google-g {
  width: 52px;
  height: 52px;
  padding: 12px;
}

body.marketplace-page .mp-reviews-rating {
  gap: 10px;
}

body.marketplace-page .mp-reviews-rating strong {
  font-size: 30px;
}

body.marketplace-page .mp-reviews-stars {
  gap: 3px;
  font-size: 15px;
}

body.marketplace-page .mp-reviews-count {
  margin-top: 4px;
  font-size: 13.5px;
}

body.marketplace-page .mp-reviews-actions {
  display: block;
  width: 100%;
}

body.marketplace-page .mp-reviews-btn-primary {
  display: flex;
  justify-content: center;
  width: 100%;
  height: 50px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(7, 222, 190, 0.25);
  transform: none !important;
}

body.marketplace-page .mp-reviews-btn-primary:active {
  background: var(--mpm-accent-dark);
}

body.marketplace-page .mp-reviews-btn-ghost {
  display: none;
}
/* --------------------------------------------------------------------------
   Narrow phones (under 375px): give text more room
   -------------------------------------------------------------------------- */
@media (max-width: 374.98px) {
  body.marketplace-page .mp-hero-title {
    font-size: 24px;
  }
  body.marketplace-page .mp-hero-actions .mp-btn-primary,
  body.marketplace-page .mp-hero-actions .mp-btn-secondary {
    font-size: 13px;
    padding: 0 8px;
  }
  body.marketplace-page .mp-tst {
    padding: 0 46px;
  }
  body.marketplace-page .mp-tst-arrow {
    width: 40px;
    height: 40px;
  }
}
