/*
 * Yacht Listing Page — mobile / phone polish
 * Source: html_maket/neweditsandmobile/Jeff Brown Yachts - Listing Page
 * Desktop baseline stays in yacht-listing-page.css / custom_yacht_style.css.
 * Header and footer are site-wide — not restyled here.
 */

#jb_body.page-yacht-detail .t-short {
  display: none;
}

#jb_body.page-yacht-detail .tour-cta {
  display: none;
  border-bottom: 1px solid #eeeef0;
  padding: 0 0 24px;
  margin: 0 0 32px;
}

#jb_body.page-yacht-detail .tour-cta h3 {
  font-family: "Mesmerize-ex-lt", "Mesmerize", sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  text-transform: uppercase;
  color: #1d1d1b;
  margin: 0;
}

#jb_body.page-yacht-detail .tour-cta p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  margin: 10px 0 18px;
  font-family: "Myriad-Pro-Light", "Myriad Pro", sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  color: #575760;
}

#jb_body.page-yacht-detail .tour-cta p b {
  font-family: "Myriad-Pro-Regular", "Myriad Pro", sans-serif;
  font-weight: 400;
  color: #000;
}

#jb_body.page-yacht-detail .tour-cta .btn-sm,
#jb_body.page-yacht-detail .tour-cta [data-open-tour] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 24px;
  border: 1px solid #41647b;
  border-radius: 2px;
  background: #41647b;
  color: #fff;
  font-family: "Mesmerize-ex-lt", "Mesmerize", sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 18px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}

#jb_body.page-yacht-detail .tour-cta .btn-sm:hover,
#jb_body.page-yacht-detail .tour-cta [data-open-tour]:hover {
  background: #365466;
  border-color: #365466;
}

/* Mobile sticky contact / loan bar */
#jb_body.page-yacht-detail .mbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: #fff;
  border-top: 1px solid #eeeef0;
  box-shadow: 0 -4px 24px rgba(132, 144, 163, 0.1);
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  gap: 12px;
}

#jb_body.page-yacht-detail .mbar button,
#jb_body.page-yacht-detail .mbar a {
  flex: 1;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Mesmerize-ex-lt", "Mesmerize", sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 18px;
  text-transform: uppercase;
  border-radius: 2px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  cursor: pointer;
}

#jb_body.page-yacht-detail .mbar .m-out {
  border: 1px solid #000;
  color: #000;
  background: transparent;
}

#jb_body.page-yacht-detail .mbar .m-out:hover {
  background: rgba(0, 0, 0, 0.05);
}

#jb_body.page-yacht-detail .mbar .m-call {
  border: 1px solid #41647b;
  background: #41647b;
  color: #fff;
}

#jb_body.page-yacht-detail .mbar .m-call:hover {
  background: #365466;
  border-color: #365466;
}

#jb_body.page-yacht-detail .mbar-loan {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 14px;
}

#jb_body.page-yacht-detail .mbar-loan .ml-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#jb_body.page-yacht-detail .mbar-loan .ml-lbl {
  font-family: "Myriad-Pro-Regular", "Myriad Pro", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  color: #000;
}

#jb_body.page-yacht-detail .mbar-loan .ml-note {
  font-family: "Myriad-Pro-Light", "Myriad Pro", sans-serif;
  font-weight: 300;
  font-size: 12px;
  line-height: 16px;
  color: #575760;
  margin: 2px 0 0;
  max-width: 200px;
}

#jb_body.page-yacht-detail .mbar-loan .ml-amt {
  font-family: "Myriad-Pro-Semibold", "Myriad Pro", sans-serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 32px;
  color: #000;
  white-space: nowrap;
}

#jb_body.page-yacht-detail .mbar-loan .m-call {
  width: 100%;
  flex: none;
}

/* Request info modal (from sticky Contact dealer) */
#jb_body.page-yacht-detail .jby-st.rq .jby-st-panel {
  width: min(520px, 100%);
}

#jb_body.page-yacht-detail .jby-st.rq .jby-st-body {
  padding: 32px 40px 32px;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-field {
  margin-top: 24px;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-field:first-of-type {
  margin-top: 0;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-field textarea {
  height: 88px;
  min-height: 88px;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-btn-navy {
  width: 100%;
  margin-top: 28px;
}

#jb_body.page-yacht-detail .jby-rq-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  font-family: "Myriad-Pro-Light", "Myriad Pro", sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  color: #575760;
}

#jb_body.page-yacht-detail .jby-rq-or::before,
#jb_body.page-yacht-detail .jby-rq-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #eeeef0;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-btn-out {
  width: 100%;
  margin-top: 0;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-st-done {
  padding: 56px 40px;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-st-phone {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #a1a1ac;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-st-phone select,
#jb_body.page-yacht-detail .jby-st.rq .jby-st-phone input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-st-phone select {
  width: auto;
  min-width: 88px;
  padding-right: 8px;
  color: #575760;
}

#jb_body.page-yacht-detail .jby-st.rq .jby-st-phone input {
  flex: 1;
  min-width: 0;
}

/* ---------- ≤1080 ---------- */
@media (max-width: 1080px) {
  /* Template `.wrap` uses --page-pad: 24px below 1080 */
  #jb_body.page-yacht-detail .container,
  #jb_body.page-yacht-detail .yacht-detail > .container,
  #jb_body.page-yacht-detail #loan-calculator.container,
  #jb_body.page-yacht-detail #loan-calculator,
  #jb_body.page-yacht-detail .price-value-factors > .container,
  #jb_body.page-yacht-detail .latest-yachts-section > .container {
    padding-left: 24px;
    padding-right: 24px;
  }

  #jb_body.page-yacht-detail #right-form-block,
  #jb_body.page-yacht-detail .right-form-block {
    position: static;
  }

  #loan-calculator .loan-calculator-wrapper > .loan-calculator-grid {
    grid-template-columns: 1fr;
  }

  #loan-calculator .loan-calculator-form {
    width: 100%;
    max-width: none;
  }

  #loan-calculator .loan-calculator-result {
    padding-top: 40px;
  }
}

/* ---------- ≤820 (phones / small tablets) ---------- */
@media (max-width: 820px) {
  #jb_body.page-yacht-detail {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  /* Back / Share row sticks under the site header */
  #jb_body.page-yacht-detail .row-buttons {
    position: sticky;
    top: 74px;
    z-index: 80;
    background: #fdfeff;
    border-bottom: 1px solid #eeeef0;
    margin-bottom: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 52px;
    transition: box-shadow 0.25s;
  }

  #jb_body.page-yacht-detail.layout-v1 .row-buttons {
    top: 0;
  }

  #jb_body.page-yacht-detail .row-buttons.is-stuck {
    box-shadow: 0 4px 16px rgba(132, 144, 163, 0.1);
  }

  /* Gallery mosaic: hero + 2 thumbs (hide 3rd/4th) */
  #jb_body.page-yacht-detail .gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 190px 120px;
    height: auto;
    max-height: none;
    gap: 6px;
    border-radius: 0;
  }

  #jb_body.page-yacht-detail .gallery-left {
    grid-column: 1 / 3;
    grid-row: 1;
    height: 190px;
    max-height: 190px;
  }

  #jb_body.page-yacht-detail .gallery-left img,
  #jb_body.page-yacht-detail .gallery-left iframe,
  #jb_body.page-yacht-detail .gallery-left video {
    max-height: 190px;
    height: 100%;
    width: 100%;
    object-fit: cover;
  }

  #jb_body.page-yacht-detail .gallery-right {
    display: contents;
  }

  #jb_body.page-yacht-detail .gallery-right-row:first-child {
    display: contents;
  }

  #jb_body.page-yacht-detail .gallery-right-row:last-child {
    display: none;
  }

  #jb_body.page-yacht-detail .gallery-right-item {
    height: 120px;
    max-height: 120px;
  }

  #jb_body.page-yacht-detail .gallery-right-item img {
    max-height: 120px;
    height: 100%;
  }

  /* Key specs: two columns */
  #jb_body.page-yacht-detail #key-specs > .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px 20px;
  }

  /* Sidebar form replaced by sticky bar + tour prompt */
  #jb_body.page-yacht-detail .right-block {
    display: none !important;
  }

  #jb_body.page-yacht-detail .tour-cta {
    display: block;
  }

  #jb_body.page-yacht-detail .left-block {
    max-width: none;
  }

  /* Spec tabs: single scrolling row */
  #jb_body.page-yacht-detail .specs-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0 24px;
  }

  #jb_body.page-yacht-detail .specs-tabs::-webkit-scrollbar {
    display: none;
  }

  #jb_body.page-yacht-detail .spec-tab {
    margin-right: 0;
    flex: 0 0 auto;
  }

  /* Keep 2-col specs on phones (override 639→1col) */
  #jb_body.page-yacht-detail #technical-specifications .specs-grid,
  #jb_body.page-yacht-detail #technical-specifications .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 20px;
  }

  /* Insurance: shield first, centered */
  #jb_body.page-yacht-detail .yacht-vessel-insurance-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    padding: 24px;
  }

  #jb_body.page-yacht-detail .yacht-vessel-insurance-icon {
    order: -1;
    margin: 0 0 18px;
    align-self: center;
  }

  #jb_body.page-yacht-detail .yacht-vessel-insurance-content {
    width: 100%;
  }

  #jb_body.page-yacht-detail .yacht-vessel-insurance-btn {
    width: 100%;
    justify-content: center;
  }

  /* Loan terms: one row of three, short labels */
  #jb_body.page-yacht-detail #loanTermButtons,
  #loan-calculator #loanTermButtons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex-wrap: nowrap;
  }

  #jb_body.page-yacht-detail .loan-term-btn,
  #loan-calculator .loan-term-btn {
    padding: 9px 8px;
    width: 100%;
    text-align: center;
  }

  #jb_body.page-yacht-detail .t-long {
    display: none;
  }

  #jb_body.page-yacht-detail .t-short {
    display: inline;
  }

  #loan-calculator .loan-calculator-form {
    padding: 22px;
  }

  #loan-calculator #monthlyPaymentDisplay {
    font-size: 44px;
    line-height: 60px;
  }

  /* Payment panel lives in sticky bar on phones */
  #loan-calculator .loan-calculator-result {
    display: none !important;
  }

  #jb_body.page-yacht-detail .mbar {
    display: flex;
  }

  #jb_body.page-yacht-detail:not(.loan-view) .mbar-loan {
    display: none;
  }

  #jb_body.page-yacht-detail.loan-view .mbar:not(.mbar-loan) {
    display: none;
  }

  #jb_body.page-yacht-detail.loan-view .mbar-loan {
    display: flex;
  }

  /* Warranties: single column on phones */
  #jb_body.page-yacht-detail #vessel-warranties > .grid {
    grid-template-columns: 1fr !important;
  }

  /* Event rails: keep cards a touch narrower on phones */
  #jb_body.page-yacht-detail .in-person-event-card {
    flex-basis: 290px;
  }

  #jb_body.page-yacht-detail .live-stream-event-card {
    flex-basis: 300px;
  }

  #jb_body.page-yacht-detail #loan-calculator {
    padding-top: 48px;
  }

  #jb_body.page-yacht-detail .yacht-download-pdf,
  #jb_body.page-yacht-detail .yacht-vessel-insurance,
  #jb_body.page-yacht-detail .row-p-m {
    margin-top: 48px;
  }

  #jb_body.page-yacht-detail .row-p-m-underline.row-first {
    margin-top: 0;
  }
}

/* ---------- ≤600 (phone polish) ---------- */
@media (max-width: 600px) {
  #jb_body.page-yacht-detail .yacht-download-pdf-inner {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    text-align: center;
  }

  #jb_body.page-yacht-detail .yacht-download-pdf-inner .h3-style,
  #jb_body.page-yacht-detail .yacht-download-pdf-title {
    width: 100%;
    text-align: center;
  }

  #jb_body.page-yacht-detail .yacht-download-pdf-btn {
    width: 100%;
    justify-content: center;
  }

  #jb_body.page-yacht-detail .jby-st.rq .jby-st-body {
    padding: 44px 22px 26px;
  }

  #jb_body.page-yacht-detail .mbar {
    padding-left: 24px;
    padding-right: 24px;
  }
}
