/* === Breadcrumb bridge (from product-new.php inline block) === */
/* Bridge hides .crumbs on phone (≤480px) — re-show. Not sticky on
   desktop, so it scrolls out naturally on mobile too.
   Also revert full-width "See Other…" button on mobile to auto-width. */
@media (max-width:480px){html body .crumbs{display:flex !important}}
@media (max-width:768px){
  html body .sec-ctas{flex-direction:row !important;justify-content:center !important}
  html body .sec-ctas .link-btn{width:auto !important;flex:0 0 auto !important}
  /* Crumbs wrap to 2 lines on long part-types — let the row grow vertically
     instead of clipping at the fixed 40px the bridge sets on mobile. */
  html body .crumbs .wrap{height:auto !important;min-height:40px !important;align-items:center !important;padding-top:8px !important;padding-bottom:8px !important;line-height:1.4 !important}
  /* Lift the product h1 above the gallery on mobile (matches Amazon/eBay
     pattern). HTML source order stays gallery → info → h1 for SEO; we
     just flip the visual order here. `display: contents` on .product-info
     flattens it into the flex parent so the h1 + price-card siblings
     can be ordered independently. */
  html body .product-container.hero-grid{display:flex !important;flex-direction:column !important;gap:8px !important;row-gap:8px !important}
  html body .product-container.hero-grid .product-gallery{order:2 !important}
  html body .product-container.hero-grid .product-info{display:contents !important}
  html body .product-container.hero-grid .product-info > h1.title{order:1 !important;margin-bottom:14px !important}
  html body .product-container.hero-grid .product-info > *:not(h1.title){order:3 !important}

  /* Halve the vertical padding/margin around the price-card on mobile so
     the page feels less stretched vertically. */
  html body .price-card{padding-top:14px !important;padding-bottom:14px !important;margin-top:14px !important;margin-bottom:0 !important}
  /* Center-align Ask Wrenchy + See Other rows and tighten their spacing.
     Bridge has `.beautified-product .ask-wrenchy-button-container { margin: 10px 0 -12px !important }`
     and `.beautified-product .sec-ctas { margin-bottom: -12px !important }`
     — match specificity to override. Plus parent `.hero-grid` is now
     `display:flex;flex-direction:column`, so text-align doesn't center
     the inline-flex button — use `align-self: center` instead. */
  html body .beautified-product .ask-wrenchy-button-container,
  html body .product-container .ask-wrenchy-button-container{
    margin:8px 0 4px 0 !important;text-align:center !important;align-self:center !important;
  }
  html body .beautified-product .sec-ctas,
  html body .product-container .sec-ctas{
    margin:8px 0 0 0 !important;justify-content:center !important;align-self:center !important;
  }

  /* Guarantee strip (.why-oem-banner): stack each stat full-width with
     thin green dividers between rows. Same layout as hl-product. The
     hero-grid is now a flex column so the banner needs explicit
     width/align-self to fill the row. */
  html body .why-oem-banner{
    flex-direction:column !important;align-items:stretch !important;
    gap:0 !important;padding:8px 16px !important;
    /* 50px side gutter from the page edge so the strip feels inset
       from other body content. align-self+width adjusted accordingly. */
    width:calc(100% - 100px) !important;align-self:center !important;
    margin-left:50px !important;margin-right:50px !important;
    box-sizing:border-box !important;
  }
  html body .why-oem-banner .gb-shield{align-self:center !important;margin-bottom:4px !important}
  html body .why-oem-banner .gb-stat{
    flex-direction:row !important;justify-content:center !important;
    align-items:baseline !important;gap:6px !important;
    width:100% !important;padding:8px 0 !important;text-align:center !important;
    white-space:nowrap !important;
  }
  html body .why-oem-banner .gb-stat b{font-size:14px !important;letter-spacing:-0.005em !important}
  html body .why-oem-banner .gb-stat em{margin-top:0 !important;font-size:10.5px !important;letter-spacing:.06em !important}
  html body .why-oem-banner .gb-sep{
    display:block !important;
    width:100% !important;height:1px !important;
    background:linear-gradient(90deg,transparent,rgba(16,185,129,.45),transparent) !important;
    margin:0 !important;
  }

  /* Lifetime-warranty banner: keep the LIFETIME seal in its own column to
     the LEFT of the text on mobile. Bridge sets `.warranty {flex-wrap: wrap}`
     which kicks the seal to a new row above the text. */
  html body .warranty{flex-wrap:nowrap !important;align-items:center !important}
  html body .warranty .seal{flex:0 0 auto !important;align-self:center !important}
  html body .warranty .txt{flex:1 1 auto !important;min-width:0 !important}
}

/* === Fitment accordion (from product-new.php inline block) === */
                .fitment-accordion { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
                .make-section { border-bottom: 1px solid #e5e7eb; }
                .make-section:last-child { border-bottom: none; }
                .make-header {
                    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 12px;
                    padding: 14px 16px; background: linear-gradient(to right, #f0f9ff, #e0f2fe); cursor: pointer;
                    font-weight: 600; font-size: 16px; color: #1e40af;
                    transition: all 0.2s; border-left: 4px solid #3b82f6;
                    user-select: none; -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
                }
                .make-header .make-name { grid-column: 1; min-width: 0; }
                /* "X models" badge sits at the right edge, just before the toggle. */
                .make-header .fitment-badge { grid-column: 2; }
                .make-header .toggle-icon { grid-column: 3; align-self: center; }
                /* (tap to expand) / (tap to collapse) hint dropped at every
                   viewport — the +/− toggle icon conveys the affordance. */
                .make-header .make-hint { display: none !important; }
                /* Mobile make-row tweaks (parity with hl-product): hide the
                   bridge's "MANUFACTURER" kicker pseudo so the make name has
                   full width, and tighten the badge so it doesn't crowd. */
                @media (max-width: 768px) {
                    body #fitmentAccordion .make-header::before {
                        display: none !important;
                        content: none !important;
                    }
                    .make-header .fitment-badge { padding: 2px 6px !important; font-size: 11px !important; }
                }
                .make-header:hover { background: linear-gradient(to right, #e0f2fe, #dbeafe); }
                .make-header.expanded { background: linear-gradient(to right, #dbeafe, #bfdbfe); }
                .make-header:active { background: #dbeafe; transform: scale(0.995); }
                .make-header.not-collapsible { cursor: default; }
                .make-header.not-collapsible:hover { background: linear-gradient(to right, #f0f9ff, #e0f2fe); }
                .make-header.not-collapsible:active { transform: none; }
                .make-header .toggle-icon {
                    display: flex; align-items: center; justify-content: center;
                    width: 28px; height: 28px; background: #3b82f6; color: #fff;
                    border-radius: 50%; font-size: 14px; font-weight: bold;
                    transition: all 0.3s; box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
                }
                .make-header .toggle-icon::before { content: '+'; }
                .make-header.expanded .toggle-icon { background: #1d4ed8; transform: rotate(180deg); }
                .make-header.expanded .toggle-icon::before { content: '−'; }
                .make-content { max-height: 0; overflow: hidden; padding: 0; transition: max-height 0.3s ease; }
                .make-content.show { max-height: none; }
                .model-section { border-top: 1px solid #e5e7eb; transition: all 0.3s ease; }
                /* Card-style expanded state with border, shadow, and spacing */
                .model-section:has(.model-header.expanded) {
                    border: 2px solid #eab308 !important;
                    border-radius: 8px;
                    margin: 12px 4px;
                    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.2);
                    background: #fffef5;
                }
                /* Non-expanded sections after an expanded section need their top border */
                .model-section:has(.model-header.expanded) + .model-section:not(:has(.model-header.expanded)) { border-top: 1px solid #e5e7eb; }
                .model-header {
                    padding: 12px 16px 12px 32px; background: #fefce8; cursor: pointer;
                    font-weight: 500; font-size: 14px; color: #854d0e;
                    transition: all 0.2s; border-left: 4px solid transparent;
                    user-select: none; -webkit-tap-highlight-color: rgba(234, 179, 8, 0.2);
                }
                .model-section:has(.model-header.expanded) .model-header {
                    border-radius: 6px 6px 0 0;
                    border-left: none;
                }
                .model-header:hover { background: #fef9c3; border-left-color: #eab308; }
                .model-header.expanded { background: #fef9c3; border-left-color: #eab308; }
                .model-header:active { background: #fef08a; transform: scale(0.995); }
                .model-header .toggle-icon {
                    display: flex; align-items: center; justify-content: center;
                    width: 24px; height: 24px; background: #eab308; color: #fff;
                    border-radius: 50%; font-size: 12px; font-weight: bold;
                    transition: all 0.3s; box-shadow: 0 2px 4px rgba(234, 179, 8, 0.3);
                }
                .model-header .toggle-icon::before { content: '+'; }
                .model-header.expanded .toggle-icon { background: #ca8a04; transform: rotate(180deg); }
                .model-header.expanded .toggle-icon::before { content: '−'; }
                .model-content { max-height: 0; overflow: hidden; padding: 0; transition: max-height 0.3s ease; }
                .model-content.show { max-height: none; }
                .model-section:has(.model-header.expanded) .model-content {
                    border-radius: 0 0 6px 6px;
                    overflow: hidden;
                }
                .model-content table { width: 100%; border-collapse: collapse; }
                .model-content th { background: #f9fafb; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; color: #475569; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
                .model-content td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; color: #334155; background: #f9fafb; }
                .model-section:has(.model-header.expanded) .model-content tbody tr:last-child td { border-bottom: none; }
                .model-content tbody tr:hover td { background: #f1f5f9; }
                /* Mobile scroll wrapper for fitment table */
                .fitment-scroll-container {
                    position: relative;
                    width: 100%;
                }
                .fitment-table-wrapper {
                    width: 100%;
                    overflow-x: auto;
                    -webkit-overflow-scrolling: touch;
                }
                .scroll-fade {
                    position: absolute;
                    top: 0;
                    width: 40px;
                    height: 100%;
                    pointer-events: none;
                    z-index: 2;
                    opacity: 0;
                    transition: opacity 0.15s;
                }
                .scroll-fade-left {
                    left: 0;
                    background: linear-gradient(to right, rgba(250,250,250,0.95), transparent);
                }
                .scroll-fade-right {
                    right: 0;
                    background: linear-gradient(to left, rgba(250,250,250,0.95), transparent);
                }
                .mobile-scroll-hint {
                    display: none; /* JS will set to flex when scrollable */
                    text-align: center;
                    padding: 6px 10px;
                    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
                    color: #1e40af;
                    font-size: 11px;
                    font-weight: 500;
                    border-radius: 4px 4px 0 0;
                    margin-bottom: 0;
                    align-items: center;
                    justify-content: center;
                    gap: 10px;
                }
                .mobile-scroll-hint.show { display: flex; }
                .scroll-hint-arrow { display: inline-block; font-size: 16px; line-height: 1; font-weight: 700; color: #1e40af; opacity: 0; transition: opacity 0.18s ease, transform 0.18s ease; transform: translateX(0); width: 12px; text-align: center; }
                .scroll-hint-arrow.active { opacity: 1; }
                .scroll-hint-arrow-left.active { animation: scroll-hint-nudge-left 1.6s ease-in-out infinite; }
                .scroll-hint-arrow-right.active { animation: scroll-hint-nudge-right 1.6s ease-in-out infinite; }
                @keyframes scroll-hint-nudge-left { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-3px); } }
                @keyframes scroll-hint-nudge-right { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
                @media (max-width: 768px) {
                    .model-content { padding: 0; }
                }
                .fitment-details-table {
                    width: 100%; border-collapse: collapse;
                    min-width: 500px; /* Ensure table doesn't shrink too small */
                }
                .fitment-details-table th {
                    background: #f9fafb; padding: 10px 12px; text-align: left;
                    font-weight: 600; color: #475569; font-size: 12px;
                    border-bottom: 2px solid #e2e8f0; white-space: nowrap;
                }
                /* Desktop: show SUBMODEL as one word */
                .fitment-details-table th .submodel-desktop { display: inline; }
                .fitment-details-table th .submodel-mobile { display: none; }
                @media (max-width: 768px) {
                    .fitment-details-table th .submodel-desktop { display: none; }
                    .fitment-details-table th .submodel-mobile { display: inline; }
                }
                .fitment-details-table td {
                    padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; color: #334155; background: #f9fafb;
                }
                /* Years column should never wrap */
                .fitment-details-table td.years-cell {
                    white-space: nowrap;
                }
                .fitment-details-table tbody tr:hover td { background: #f1f5f9; }
                .fitment-details-table tr:last-child td { border-bottom: none; }

                /* Mobile swipe-scroll for the fitment table — restore native
                   table semantics (the v2 bridge converts it to display:contents
                   + grid, which collapses cols) so the wrapper's overflow-x +
                   table min-width drive horizontal scroll. Re-enable the
                   white-fade overlays + visible scrollbar to match live www. */
                .fitment-details-table { width: 100% !important; min-width: 560px !important; }
                body #fitmentAccordion .fitment-details-table { min-width: 560px !important; }
                @media (max-width: 768px) {
                    html body #fitmentAccordion table.fitment-details-table { display: table !important; min-width: 600px !important; width: 600px !important; }
                    html body #fitmentAccordion table.fitment-details-table thead { display: table-header-group !important; }
                    html body #fitmentAccordion table.fitment-details-table tbody { display: table-row-group !important; }
                    html body #fitmentAccordion table.fitment-details-table tr { display: table-row !important; grid-template-columns: none !important; padding: 0 !important; gap: 0 !important; }
                    html body #fitmentAccordion table.fitment-details-table th,
                    html body #fitmentAccordion table.fitment-details-table td { display: table-cell !important; padding: 10px 12px !important; white-space: nowrap !important; vertical-align: middle !important; }
                    html body #fitmentAccordion .fitment-table-wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
                    html body #fitmentAccordion .mobile-scroll-hint.show { display: flex !important; }
                    html body #fitmentAccordion .fitment-scroll-container { position: relative !important; }
                    html body #fitmentAccordion .fitment-scroll-container .scroll-fade {
                        display: block !important;
                        position: absolute !important; top: 0 !important; bottom: 0 !important;
                        width: 40px !important; pointer-events: none !important; z-index: 2 !important;
                        opacity: 0; transition: opacity 0.15s ease;
                    }
                    html body #fitmentAccordion .fitment-scroll-container .scroll-fade-left {
                        left: 0 !important;
                        background: linear-gradient(to right, rgba(255,255,255,0.96), rgba(255,255,255,0)) !important;
                    }
                    html body #fitmentAccordion .fitment-scroll-container .scroll-fade-right {
                        right: 0 !important;
                        background: linear-gradient(to left, rgba(255,255,255,0.96), rgba(255,255,255,0)) !important;
                    }
                    html body #fitmentAccordion .fitment-table-wrapper {
                        scrollbar-width: thin !important;
                        scrollbar-color: rgba(59,130,246,0.5) rgba(148,163,184,0.15) !important;
                    }
                    html body #fitmentAccordion .fitment-table-wrapper::-webkit-scrollbar { height: 8px !important; -webkit-appearance: auto !important; background: rgba(148,163,184,0.15) !important; }
                    html body #fitmentAccordion .fitment-table-wrapper::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.55) !important; border-radius: 4px !important; }
                    html body #fitmentAccordion .fitment-table-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(29,78,216,0.7) !important; }
                    html body #fitmentAccordion .fitment-table-wrapper::-webkit-scrollbar-track { background: rgba(148,163,184,0.15) !important; border-radius: 4px !important; }
                    html body #fitmentAccordion .fitment-details-table th:nth-child(n+4),
                    html body #fitmentAccordion .fitment-details-table td:nth-child(n+4) { display: table-cell !important; }
                }

                .fitment-badge {
                    display: inline-block; background: #dbeafe; color: #1e40af;
                    padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500;
                }
                .model-badge {
                    display: inline-block; background: #dcfce7; color: #166534;
                    padding: 2px 6px; border-radius: 10px; font-size: 11px; font-weight: 500;
                }
                .expand-all-btn {
                    padding: 6px 12px; background: #f3f4f6; border: 1px solid #d1d5db;
                    border-radius: 4px; cursor: pointer; font-size: 12px; color: #374151;
                    margin-bottom: 12px; transition: background 0.2s;
                }
                .expand-all-btn:hover { background: #e5e7eb; }
                .expand-hint, .collapse-hint {
                    font-size: 11px; color: #6b7280; font-weight: normal; margin-left: 8px;
                }
                .expand-hint { display: inline; }
                .collapse-hint { display: none; }
                .make-header.expanded .expand-hint, .model-header.expanded .expand-hint { display: none; }
                .make-header.expanded .collapse-hint, .model-header.expanded .collapse-hint { display: inline; }
                @media (max-width: 768px) { .tap-word { display: inline; } .click-word { display: none; } }
                @media (min-width: 769px) { .tap-word { display: none; } .click-word { display: inline; } }
                .year-range { font-size: 12px; color: #059669; font-weight: 600; }
                .model-header { display: grid; grid-template-columns: 150px auto 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 0 8px; }
                .model-header .model-name { grid-column: 1; grid-row: 1; }
                .model-header .year-range { grid-column: 2; grid-row: 1; }
                .model-header .model-hint { grid-column: 1 / 4; grid-row: 2; margin-top: 2px; }
                .model-header .toggle-icon { grid-column: 4; grid-row: 1 / 3; align-self: center; }
                .model-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
                .model-hint { font-size: 11px; }
                .model-header:hover .model-hint { text-decoration: underline; text-decoration-color: #6b7280; text-underline-offset: 2px; }
                .make-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
                .make-header .fitment-badge { text-align: center; }
                .make-hint { font-size: 11px; }
                .make-header .make-name { text-decoration: none; transition: text-decoration 0.2s; }
                .make-header:hover .make-name { text-decoration: underline; text-decoration-color: #3b82f6; text-underline-offset: 2px; }
                .make-header.not-collapsible:hover .make-name { text-decoration: none; }
                .model-header .model-name { text-decoration: none; transition: text-decoration 0.2s; }
                .model-header:hover .model-name { text-decoration: underline; text-decoration-color: #eab308; text-underline-offset: 2px; }

/* === Back-to-top button (from product-new.php inline block) === */
#gpBackToTop {
  position: fixed;
  bottom: 35px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: opacity 0.3s ease, background 0.2s ease;
  display: none;
  opacity: 0;
  pointer-events: none;
}

#gpBackToTop:hover {
  background: rgba(0,0,0,0.6);
}

@media (max-width: 768px) {
  #gpBackToTop {
    display: block !important;
  }
}

/* === Zoom-lens gallery main-image (from product-new.php inline block) === */
.beautified-product .main-image{ cursor:zoom-in; position:relative; }
.beautified-product .zoom-lens{
  display:none; position:absolute;
  width:300px; height:300px; border-radius:50%;
  border:3px solid rgba(37,99,235,.5);
  box-shadow:0 0 0 1px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.15);
  pointer-events:none; z-index:10;
  background-repeat:no-repeat;
}

/* === H1 title: no hyphenation or mid-word breaking (override v2-legacy-bridge) === */
/* Bridge sets `hyphens: auto` + `overflow-wrap: anywhere` which splits
   "Dorman" → "Dor-man" on narrow viewports — undo that for the h1.title. */
h1.title { hyphens: none !important; -webkit-hyphens: none !important; word-break: keep-all !important; overflow-wrap: break-word !important; }
