/* BeanHestia mobile shell and product-detail hardening — 2026-09-11 */
html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

.v7-static-header,
#app,
.site-footer {
  width: 100%;
  max-width: 100%;
}

.v7-static-header,
.site-footer {
  overflow-x: clip;
}

@supports not (overflow: clip) {
  .v7-static-header,
  .site-footer {
    overflow-x: hidden;
  }
}

@media (max-width: 1050px) {
  .v7-static-top {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  .v7-static-top > * {
    min-width: 0;
  }

  .v7-static-search {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 100%;
  }

  .v7-static-search select,
  .v7-static-search input,
  .v7-static-search button {
    min-width: 0;
  }

  .v7-static-nav {
    width: 100%;
    max-width: 100vw;
  }

  .detail-wrap .container,
  .detail-grid,
  .detail-hero,
  .buy-box {
    min-width: 0;
    max-width: 100%;
  }

  .detail-grid > *,
  .detail-hero > *,
  .footer-grid > * {
    min-width: 0;
  }

  .price-table {
    max-width: 100%;
  }
}

/* Collapse the PDP hero earlier so mobile/tablet Safari never keeps a desktop-width inner grid. */
@media (max-width: 820px) {
  .detail-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .detail-visual {
    min-height: 210px;
  }

  .detail-title {
    font-size: clamp(30px, 7.5vw, 40px);
    overflow-wrap: anywhere;
  }

  .attribute-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .buy-box {
    padding: 20px;
  }
}

@media (max-width: 680px) {
  .v7-static-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .v7-static-brand {
    grid-column: 1;
    min-width: 0;
  }

  .v7-static-login {
    grid-column: 2;
    margin-left: 0;
  }

  .v7-static-orders {
    display: none !important;
  }

  .v7-static-cart {
    grid-column: 3;
    padding: 6px 4px;
  }

  .v7-static-search {
    grid-column: 1 / -1;
    grid-row: 2;
    order: initial;
    grid-template-columns: minmax(78px, 28%) minmax(0, 1fr) 64px;
  }

  .v7-static-nav {
    padding: 0 8px;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .v7-static-nav::-webkit-scrollbar {
    display: none;
  }

  .v7-static-nav .seller {
    margin-left: 0;
  }

  .detail-wrap {
    padding: 28px 0 52px;
  }

  .detail-wrap > .container {
    width: calc(100% - 24px);
    max-width: none;
  }

  .breadcrumbs {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .detail-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px;
  }

  .detail-visual {
    min-height: 190px;
  }

  .attribute-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .buy-box {
    width: 100%;
    padding: 18px;
    border-radius: 14px;
  }

  .buy-box .field,
  .buy-box .select,
  .buy-box input,
  .buy-box select {
    min-width: 0;
    max-width: 100%;
  }

  .total-box {
    gap: 12px;
  }

  .total-box strong {
    font-size: 24px;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .site-footer {
    overflow: hidden;
  }

  .site-footer > .container {
    width: calc(100% - 24px);
    max-width: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 26px 18px;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .footer-grid a,
  .footer-grid p {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  .v7-static-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .v7-static-login {
    display: none !important;
  }

  .v7-static-cart {
    grid-column: 2;
  }

  .v7-static-search {
    grid-column: 1 / -1;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .footer-grid > div:first-child {
    grid-column: auto;
  }
}
