/* Bench Brothers v70 — additions after live CSS; preserve all client-side overrides. */
:root { --bb-card-photo-ratio: 3 / 4; }

/* Hero logo centred on phones; image editor remains available. */
@media (max-width: 820px) {
  body[data-page="home"] .hero-logo-standalone {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    align-self: center !important;
    margin: 0 auto 18px !important;
    width: min(148px, 44vw) !important;
  }
  body[data-page="home"] .hero-logo-standalone__image,
  body[data-page="home"] .hero-logo-standalone > img {
    width: 100% !important;
    height: auto !important;
    max-height: 76px !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
}

/* More usable widths for long titles on desktop without crushing media. */
@media (min-width: 1080px) {
  .about-hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr) !important; }
  .about-hero__text { min-width: 0; padding: clamp(30px, 3.7vw, 68px) !important; }
  .about-hero__text h1 { max-width: none !important; overflow-wrap: normal; }
}
.full-banner__content { width: min(790px, calc(100% - 56px)) !important; max-width: 100% !important; }
.full-banner__content [data-editable-text] { position: relative; z-index: 3; }
.full-banner::after { pointer-events: none; }
.full-banner .option-boxes { pointer-events: none; }

/* The text width setting controls the text element, not a narrow auto-sized column. */
[data-bb-text-width="1"] { min-width: 0; max-width: 100% !important; box-sizing: border-box; }
@media (min-width: 821px) { [data-bb-text-width="1"] { width: var(--bb-text-width-desktop, 100%) !important; } }
@media (max-width: 820px) { [data-bb-text-width="1"] { width: var(--bb-text-width-mobile, 100%) !important; } }

/* Eliminate coloured strips when an editable photo is narrowed. */
@media (max-width: 820px) {
  .combo-interior,
  .combo-interior__image,
  .quiet-block__media,
  .image-pair__card,
  .feature-card__media,
  .about-production__slide { background-color: transparent !important; }
  [data-image-frame][data-image-custom-width="1"] { margin-left: auto !important; margin-right: auto !important; }
  [data-image-frame][data-image-custom-width="1"] > img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }
}

/* Product hero and thumbnails behave as a bounded gallery, not a giant growing column. */
body[data-page="product"] .product-gallery { min-width: 0 !important; }
body[data-page="product"] .product-gallery__frame { min-width: 0 !important; align-items: start !important; }
body[data-page="product"] .product-gallery__main {
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: var(--bb-img-ratio, 3 / 4) !important;
  position: relative;
  overflow: hidden;
  background: #f1efec;
}
body[data-page="product"] .product-gallery__main > img:not([hidden]) {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  inset: 0;
  display: block;
  object-fit: var(--bb-img-fit, contain) !important;
  object-position: var(--bb-img-position, center center) !important;
}
body[data-page="product"] .product-gallery__main > img[hidden] { display: none !important; }
body[data-page="product"] .product-gallery__active-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: grid;
  place-items: center;
  background: #1c1d1f;
  color: #fff;
  z-index: 1;
}
body[data-page="product"] .product-gallery__active-video a { color: #fff; padding: 25px; text-align: center; }
body[data-page="product"] .product-gallery__video-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 100%;
  font-size: 22px;
  color: #1c1d1f;
  background: #eceae6;
}
body[data-page="product"] .product-gallery__video-thumb small { font-size: 11px; font-weight: 500; }
body[data-page="product"] .product-gallery__thumbs--side button { box-sizing: border-box !important; overflow: hidden !important; }
@media (min-width: 821px) {
  body[data-page="product"] .product-gallery__frame { display: grid !important; grid-template-columns: 76px minmax(0, 1fr) !important; gap: 12px !important; }
  body[data-page="product"] .product-gallery__thumbs--side {
    height: min(78vh, 760px) !important;
    max-height: min(78vh, 760px) !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    scrollbar-width: thin;
    overscroll-behavior: contain;
  }
  body[data-page="product"] .product-gallery__thumbs--side button {
    flex: 0 0 82px !important;
    width: 100% !important;
    height: 82px !important;
    min-height: 82px !important;
    max-height: 82px !important;
  }
}
@media (max-width: 820px) {
  body[data-page="product"] .product-gallery__frame { display: flex !important; flex-direction: column !important; gap: 10px !important; }
  body[data-page="product"] .product-gallery__main { order: 0 !important; width: 100% !important; }
  body[data-page="product"] .product-gallery__thumbs--side {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
  }
  body[data-page="product"] .product-gallery__thumbs--side button {
    flex: 0 0 76px !important;
    width: 76px !important;
    height: 86px !important;
    min-height: 86px !important;
    max-height: 86px !important;
  }
}

/* No canvas fade before curtain gets over the page, even on large monitors. */
html, body { background-color: #fafafc; }
html.bb-nav-arrival, html.bb-nav-arrival body { background-color: #1c1d1f !important; }
html.bb-nav-arrival::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #1c1d1f;
  z-index: 1499;
  pointer-events: none;
}
body.is-leaving #app { opacity: 1 !important; }
.page-transition { background: transparent !important; }
.page-transition__panel { background: #1c1d1f !important; }

/* Admin category order: same visual affordance as product order. */
.admin-item--category .admin-drag-handle { cursor: grab; flex: 0 0 auto; }
.admin-item--category.is-drag-over { outline: 2px dashed #1c1d1f; outline-offset: -2px; }


/* v72: client finish pass — mobile logo, editable text zones, clean image widths, stronger product gallery */

/* Mobile first-screen logo sits in the center, not glued to the left edge. */
@media (max-width: 820px) {
  body[data-page="home"] .hero-copy,
  body[data-page="home"] .hero-main__content {
    align-items: center !important;
    text-align: center !important;
  }
  body[data-page="home"] .hero-logo-standalone,
  body[data-page="home"] .hero-logo-standalone[data-editable-image="brand.logo"] {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body[data-page="home"] .hero-logo-standalone__image,
  body[data-page="home"] .hero-logo-standalone > img {
    margin-left: auto !important;
    margin-right: auto !important;
    object-position: center center !important;
  }
}

/* The large custom-order banner and the material floating card should stay easy to click in edit mode. */
body[data-page="home"] .full-banner__content,
body[data-page="home"] .floating-card,
body[data-page="about"] .about-hero__text,
body[data-page="about"] .about-value__copy {
  position: relative;
  z-index: 3;
}

/* About page: give the left text block a wider, cleaner measure like the other pages. */
body[data-page="about"] .about-hero {
  align-items: start !important;
}
body[data-page="about"] .about-hero__text {
  max-width: min(720px, 100%) !important;
  width: 100% !important;
}
body[data-page="about"] .about-hero__text .hero-title,
body[data-page="about"] .about-hero__text .hero-text,
body[data-page="about"] .about-value__copy .section-title,
body[data-page="about"] .about-value__copy .section-lead {
  max-width: min(680px, 100%) !important;
}

/* When the editor reduces the image width, do not leave a fake colored frame around the picture. */
[data-image-frame] {
  background: transparent !important;
}
[data-image-frame] > img,
[data-image-frame] > picture,
[data-image-frame] > video,
[data-image-frame] > iframe {
  background: transparent !important;
}
body[data-page="home"] .combo-product__image,
body[data-page="home"] .combo-interior__image,
body[data-page="home"] .quiet-block__media,
body[data-page="home"] .category-slide__media,
body[data-page="product"] .product-card__media,
body[data-page="product"] .product-gallery__main,
body[data-page="about"] .about-hero__image,
body[data-page="about"] .about-value__image {
  overflow: hidden !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Product cards: keep 3:4 by default, so the client does not need to reset every new image manually. */
.product-card__media,
body[data-page="catalog"] .product-card__media,
body[data-page="home"] .product-card__media {
  aspect-ratio: var(--bb-img-ratio, 3 / 4) !important;
  min-height: 0 !important;
}
.product-card__media > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: var(--bb-img-fit, cover) !important;
  object-position: var(--bb-img-position, center center) !important;
}

/* Product page: bounded main frame + stable thumb rail even if there are many photos/videos. */
body[data-page="product"] .product-page {
  align-items: start !important;
}
body[data-page="product"] .product-gallery,
body[data-page="product"] .product-gallery__frame {
  min-width: 0 !important;
}
body[data-page="product"] .product-gallery__thumbs--side {
  align-self: start !important;
  align-content: start !important;
}
@media (min-width: 821px) {
  body[data-page="product"] .product-gallery__frame {
    grid-template-columns: 88px minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  body[data-page="product"] .product-gallery__thumbs--side {
    width: 88px !important;
    height: clamp(420px, 72vh, 760px) !important;
    max-height: clamp(420px, 72vh, 760px) !important;
    padding-right: 2px !important;
  }
  body[data-page="product"] .product-gallery__thumbs--side button {
    flex: 0 0 96px !important;
    width: 88px !important;
    height: 96px !important;
    min-height: 96px !important;
    border-radius: 12px !important;
  }
  body[data-page="product"] .product-gallery__main {
    aspect-ratio: var(--bb-img-ratio, 3 / 4) !important;
    min-height: 0 !important;
    height: auto !important;
  }
  body[data-page="product"] .product-info {
    min-width: 0 !important;
  }
}
@media (max-width: 820px) {
  body[data-page="product"] .product-gallery__thumbs--side {
    padding-bottom: 4px !important;
  }
  body[data-page="product"] .product-gallery__thumbs--side button {
    border-radius: 10px !important;
  }
}
body[data-page="product"] .product-gallery__thumbs--side img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}
body[data-page="product"] .crumb {
  opacity: .72;
}

/* Prevent the desktop panel flash during page transitions. */
html,
body,
#app {
  background-color: #fafafc !important;
}
html.bb-nav-arrival,
html.bb-nav-arrival body,
body.is-leaving,
body.is-leaving #app {
  background-color: #1c1d1f !important;
}
body.is-leaving #app {
  transition: none !important;
}

/* Smaller screens: keep about text readable and balanced. */
@media (max-width: 820px) {
  body[data-page="about"] .about-hero__text,
  body[data-page="about"] .about-value__copy {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body[data-page="about"] .about-hero__text .hero-title,
  body[data-page="about"] .about-hero__text .hero-text {
    max-width: 100% !important;
  }
}
