/* GTIR 5.62.1 – Safari/PWA stability and compact responsive geometry. */
:root {
  --gtir-stable-mobile-nav: 84px;
  --gtir-stable-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: auto !important;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 100%;
  overflow-x: clip !important;
}

body :where(main, section, article, aside, header, footer, nav, form, fieldset, div) {
  min-width: 0;
}

body :where(img, video, iframe) {
  max-width: 100%;
}

#gtir-update31 {
  display: none !important;
}

.gtir-site-header,
.gtir-mobile-bottom-nav,
.main-image-wrap,
.thumbnails,
.gtir-global-footer {
  overflow-anchor: none;
}

@media (max-width: 760px) {
  html body {
    width: 100% !important;
    min-width: 0 !important;
    padding-bottom: calc(var(--gtir-stable-mobile-nav) + var(--gtir-stable-safe-bottom) + 8px) !important;
  }

  html body :where(h1, h2, h3, h4, p, a, button, summary, label, legend, span, strong, b, small, li, dt, dd) {
    max-width: 100%;
    writing-mode: horizontal-tb !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
  }

  html body .gtir-site-header.is-authenticated {
    position: static !important;
    top: auto !important;
  }

  html body .gtir-site-header .gtir-header-inner,
  html body .gtir-site-header.is-guest .gtir-header-inner {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px !important;
  }

  html body .gtir-site-header .gtir-logo,
  html body .gtir-site-header.is-guest .gtir-logo {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 10px !important;
    font-size: clamp(23px, 7.4vw, 29px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  html body .gtir-site-header.is-authenticated .gtir-logo {
    width: auto !important;
    margin-bottom: 0 !important;
  }

  html body .gtir-site-header .gtir-home-mark,
  html body .gtir-site-header.is-guest .gtir-home-mark {
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
    margin-right: 6px !important;
  }

  html body .gtir-site-header .gtir-beta-badge {
    min-width: 0 !important;
    max-width: 124px !important;
    margin-left: 6px !important;
    padding: 3px 5px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 7px !important;
  }

  html body .gtir-site-header.is-guest .gtir-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
  }

  html body .gtir-site-header.is-guest .gtir-nav-link {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 50px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    font-size: clamp(12px, 3.45vw, 15px) !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  html body .gtir-site-header.is-guest .gtir-nav-link > span {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    line-height: inherit !important;
    writing-mode: horizontal-tb !important;
  }

  html body .gtir-site-header.is-guest .gtir-nav-link > span[aria-hidden="true"] {
    display: inline-flex !important;
    flex: 0 0 22px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html body .gtir-site-header.is-guest .gtir-advertise-nav,
  html body .gtir-site-header.is-guest .gtir-terms-link {
    display: flex !important;
    grid-template-columns: none !important;
    justify-content: center !important;
    text-align: center !important;
  }

  html body .gtir-site-header.is-guest .gtir-advertise-nav,
  html body .gtir-site-header.is-guest .gtir-advertise-nav > span {
    background: #C03C10 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  html body .gtir-site-header.is-guest .gtir-terms-link {
    grid-column: 1 / -1 !important;
    min-height: 48px !important;
  }

  html body .gtir-site-header.is-guest .gtir-terms-link > span,
  html body .gtir-site-header.is-guest .gtir-advertise-nav > span {
    width: 100% !important;
    text-align: center !important;
  }

  html body .gtir-site-header.is-guest .gtir-languages {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 40px !important;
    height: auto !important;
    padding: 5px 7px !important;
    gap: 8px !important;
  }

  html body .gtir-mobile-bottom-nav {
    width: 100% !important;
    max-width: 100% !important;
    min-height: calc(var(--gtir-stable-mobile-nav) + var(--gtir-stable-safe-bottom)) !important;
    height: auto !important;
    padding-bottom: calc(10px + var(--gtir-stable-safe-bottom)) !important;
  }

  html body .gtir-mobile-bottom-nav > a {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body .gtir-mobile-nav-label {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    line-height: 1.08 !important;
  }

  html body .gtir-plus-contact-bar {
    display: none !important;
    position: static !important;
  }

  html body .gtir-plus-has-bar {
    padding-bottom: 0 !important;
  }

  html body .gtir-global-footer {
    width: auto !important;
    max-width: calc(100% - 24px) !important;
    margin: 20px 12px calc(var(--gtir-stable-mobile-nav) + var(--gtir-stable-safe-bottom) + 14px) !important;
    padding: 14px !important;
  }

  html body .gtir-footer-links,
  html body .gtir-footer-meta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 0 !important;
  }

  html body .gtir-footer-links > a,
  html body .gtir-footer-links > button {
    width: 100% !important;
    min-height: 44px !important;
    padding: 8px 2px !important;
  }

  html body .legal26 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 16px auto 30px !important;
    padding: 0 12px !important;
  }

  html body .legal26 > h1 {
    max-width: 100% !important;
    margin: 8px 0 16px !important;
    font-size: clamp(28px, 8.5vw, 38px) !important;
    line-height: 1.12 !important;
  }

  html body .legal26 section {
    min-height: 0 !important;
    height: auto !important;
    margin-bottom: 12px !important;
    padding: 16px !important;
  }

  html body .detail-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px auto 22px !important;
    padding: 0 10px calc(var(--gtir-stable-mobile-nav) + 16px) !important;
  }

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

  html body .detail-grid > *,
  html body .detail-card,
  html body .seller-card {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  html body .main-image-wrap {
    width: 100% !important;
    height: clamp(240px, 69vw, 340px) !important;
    max-height: 340px !important;
  }

  html body .main-image-wrap .detail-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  html body .thumbnails {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  html body .detail-body,
  html body .seller-card {
    padding: 13px !important;
  }

  html body .detail-title {
    margin-bottom: 6px !important;
    font-size: clamp(22px, 6.8vw, 28px) !important;
    line-height: 1.12 !important;
  }

  html body .detail-price {
    margin: 3px 0 8px !important;
    font-size: clamp(22px, 6.5vw, 27px) !important;
  }

  html body .seller-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  html body .seller-actions > *,
  html body .seller-actions > form > button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 46px !important;
    margin: 0 !important;
  }

  html body .seller-actions .primary,
  html body .seller-actions .gtir-workflow-link,
  html body .seller-actions .report-box {
    grid-column: 1 / -1 !important;
  }

  html body .seller-actions :where(a, button, summary, span) {
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  html body #gtir-ui-status {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(var(--gtir-stable-mobile-nav) + var(--gtir-stable-safe-bottom) + 10px) !important;
    max-width: none !important;
    transform: none !important;
  }
}

@media (max-width: 370px) {
  html body .gtir-site-header .gtir-beta-badge {
    display: none !important;
  }

  html body .seller-actions {
    grid-template-columns: 1fr !important;
  }

  html body .seller-actions > * {
    grid-column: 1 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body,
  body * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
