  /* ---------- Global layout ---------- */
  :root {
    --navy: #06427e;
    /* main brand navy */
    --navy-light: #0956a7;
    /* a slightly lighter navy for gradient */
    --accent: #ffa41c;
    --accent-soft: #ffd814;
    --price: #b12704;
    --border: #d5d9d9;
    --bg-page: #e3e6e6;
    --bg-card: #ffffff;
    --text-main: #111111;
    --text-subtle: #555555;
  }


  html,
  body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
      Roboto, Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
  }

  body {
    display: flex;
    justify-content: center;
  }

  .card {
    background: var(--bg-card);
    border-radius: 12px;
    margin: 16px;
    padding: 16px 16px 20px;
    max-width: 900px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(15, 17, 17, 0.15);
    box-sizing: border-box;
  }

  .section {
    margin-bottom: 22px;
    padding-top: 12px;
    border-top: 1px solid #eaeded;
  }

  /* ---------- Amazon-style header strip ---------- */

  .brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -16px -16px 0;
    /* let the navy strip touch card edges */
    padding: 10px 16px;
    background: linear-gradient(90deg, var(--navy) 0%, var(--navy-light) 100%);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
  }

  .brand-row img {
    max-height: 34px;
  }

  .rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
  }

  .licensing {
    display: flex;
    justify-content: end;
  }

  #rating-text {
    font-weight: 600;
  }

  .stars {
    color: var(--accent);
    font-size: 16px;
    letter-spacing: 1px;
    line-height: 1;
  }

  .reviews {
    color: #e3e6e6;
  }

  .titles {
    padding: 10px 2px 6px;
  }

  .titles .title1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
  }

  .titles .title2 {
    font-size: 13px;
    color: var(--text-subtle);
  }

  #project-address-main {
    font-weight: 800;
  }

  /* ---------- Carousel ---------- */

  /* --- HARD LOCK carousel size (wins cascade) --- */
  .carousel {
    max-width: 360px;
    width: 100%;
    margin: 0 auto 12px;
    position: relative;
  }

  .carousel .frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .carousel-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .carousel .frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
  }

  .carousel .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    font-size: 20px;
  }

  .carousel .nav.left {
    left: 8px;
  }

  .carousel .nav.right {
    right: 8px;
  }

  .carousel .caption {
    font-size: 13px;
    margin-top: 6px;
    color: #222222;
  }

  .carousel .dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
  }

  .carousel .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cfcfcf;
    cursor: pointer;
  }

  .carousel .dot.active {
    background: #555555;
  }

  /* ---------- Lightbox ---------- */
  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
  }

  .lightbox.open {
    display: flex;
  }

  .lightbox-inner {
    position: relative;
    width: min(960px, 96vw);
    height: min(720px, 86vh);
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    overflow: hidden;
  }

  .lightbox-image {
    width: 100%;
    height: 100%;
    background-size: contain;      /* show whole image */
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
  }

  .lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    background: rgba(255,255,255,0.15);
    color: #fff;
  }

  .lightbox-close:hover {
    background: rgba(255,255,255,0.25);
  }

  /* ---------- Section headers ---------- */

  .header-line {
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .header-line .label {
    font-weight: 500;
    color: var(--text-subtle);
  }

  .header-line .value {
    font-weight: 700;
  }

  /* ---------- Tiles (manufacturer / shingle / gutters) ---------- */

  .tile-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .tile-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
  }

  /* Hide manufacturer names under logo tiles (logos are enough) */
  #manufacturer-tiles .tile-bottom-text {
    display: none;
  }



  /* Default – unselected = white */
  .tile {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    width: 100%;
    height: 120px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    /* <-- changed from #f7fafa */
    text-align: center;
    transition: border 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    box-shadow: 0 1px 2px rgba(15, 17, 17, 0.08);
  }

  /* Selected – now gray fill */
  .tile.selected {
    border: 2px solid #06427e;
    background: #f7fafa;
    box-shadow: 0 0 0 2px rgba(6, 66, 126, 0.35);
  }

  .tile img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    display: block;
  }

  .tile-top-text,
  .tile-bottom-text {
    font-size: 11px;
    line-height: 1.2;
  }

  .tile-top-text {
    font-weight: 800;
    margin-bottom: 2px;
  }

  .tile-bottom-text {
    margin-top: 4px;
  }

  .shingle-tile {
    flex-direction: column;
    height: 140px;
  }

  .recommend-label {
    font-size: 11px;
    color: var(--navy);
    font-weight: 400;
    /* normal weight */
    font-style: italic;
    /* italic */
    margin-top: 4px;
  }


  /* ---------- Warranty cards ---------- */

  #warranty-tiles {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  /* Default (unselected) warranty cards → white */
  .warranty-card {
    min-width: 150px;
    max-width: 170px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #ffffff;
    /* <-- changed */
    cursor: pointer;
    box-sizing: border-box;
    transition: border 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  }

  /* Hover stays the same */
  .warranty-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(15, 17, 17, 0.18);
  }

  /* Selected → gray fill + subtle border */
  .warranty-card.selected {
    border: 2px solid #06427e;
    /* keep blue highlight OR change to gray */
    background: #f7fafa;
    /* <-- swapped with default */
    box-shadow: 0 0 0 2px rgba(6, 66, 126, 0.20);
  }


  .warranty-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
  }

  .warranty-price {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    margin-top: 4px;
    color: #707070;
  }

  .warranty-detail {
    font-size: 11px;
    line-height: 1.2;
    color: var(--text-subtle);
  }

  /* ---------- Add-on ---------- */

  .addon-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
  }

  .addon-text {
    display: flex;
    flex-direction: column;
  }

  .addon-desc {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 600;
  }

  .addon-main {
    font-size: 12px;
    color: #707070;
  }

  /* ---------- Custom items ---------- */

  #custom-items {
    margin-top: 4px;
  }

  .custom-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 0;
  }

  .custom-item .text {
    display: flex;
    flex-direction: column;
  }

  .custom-item .desc {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
  }

  .custom-item .price {
    font-size: 12px;
    color: #707070;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  .custom-item.disabled {
    opacity: 0.8;
  }

  .learn-row {
    margin: 4px 0 10px;
  }

  .learn-link {
    font-size: 13px;
    color: #007185;
    /* Amazon-ish link blue */
    text-decoration: none;
    cursor: pointer;
  }

  .learn-link.inline {
    margin-left: 6px;
    font-size: 12px;
  }

  .learn-link::after {
    content: ' ›';
    /* little chevron */
  }

  .learn-link:hover {
    text-decoration: underline;
    color: #c7511f;
    /* subtle orange on hover */
  }

  .learn-row.color-learn-row {
    margin: 12px;
  }

  #gutter-tiles .tile,
  #topper-tiles .tile,
  #chimney-tiles .tile {
    height: auto;
    padding: 6px 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
  }

  #gutter-tiles .tile-top-text,
  #topper-tiles .tile-top-text,
  #chimney-tiles .tile-top-text {
    font-size: 11px;
    line-height: 1.15;
    margin: 2px 0 4px;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  #gutter-tiles .tile img,
  #topper-tiles .tile img,
  #chimney-tiles .tile img {
    max-height: 80px;
    width: auto;
  }

  #gutter-tiles .tile-bottom-text,
  #topper-tiles .tile-bottom-text,
  #chimney-tiles .tile-bottom-text {
    font-size: 12px;
    margin-top: 4px;
    color: #707070;
  }

  /* Make Gutters behave like Labor Warranty: single row + horizontal scroll */
  #gutter-tiles {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  /* Don't let tiles shrink/wrap */
  #gutter-tiles .tile-wrapper {
    flex: 0 0 auto;
    width: 170px;            /* match "card-like" feel; adjust as desired */
  }

  /* Make the gutter tile fill the wrapper */
  #gutter-tiles .tile {
    width: 100%;
  }

  /* Make all "Customers also purchased" tile rows match widths */
  #gutter-tiles,
  #topper-tiles,
  #chimney-tiles {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  #gutter-tiles .tile-wrapper,
  #topper-tiles .tile-wrapper,
  #chimney-tiles .tile-wrapper {
    flex: 0 0 auto;
    width: 170px;            /* <-- pick your standard width */
  }

  #gutter-tiles .tile,
  #topper-tiles .tile,
  #chimney-tiles .tile {
    width: 100%;
  }

  /* Bottom price section */
  .price-section {
    margin-top: 18px;
    padding: 14px 14px 12px;
    border: 1px solid #eaeded;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15,17,17,0.10);
    text-align: center;
  }

  .price-section-label {
    font-size: 12px;
    color: var(--text-subtle);
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-bottom: 4px;
  }

  .price-section-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--price);
    line-height: 1.1;
  }

  .price-section-subtext {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-subtle);
  }

  /* Give room so the bar doesn't cover the bottom of the card */
  body {
    padding-bottom: 80px;
  }

  /* Floating bar at bottom of viewport */
  .floating-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    width: 100%;
    border-top: 1px solid #eaeded;
    box-shadow: 0 -2px 6px rgba(15, 17, 17, 0.2);
    padding: 8px 16px;
    z-index: 100;
    display: flex;
    justify-content: center;
  }

  .floating-bar-inner {
    max-width: 900px;
    width: 100%;
    display: flex;
    margin: 0 auto;
    padding: 10px 16px;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  /* Price text inside the bar */
  .floating-price-label {
    font-size: 15px;
    font-weight: 600;
  }

  .floating-price-label span {
    color: var(--price);
  }

  .floating-price-label,
  .add-to-cart-btn{
    flex: 0 0 auto;
  }

  /* Center disclaimer */
  .floating-disclaimer{
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .floating-disclaimer-icon{
    margin-right: 6px;
  }

  /* CTA button */
  .add-to-cart-btn {
    background: var(--navy);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .add-to-cart-btn:hover {
    filter: brightness(1.05);
  }

  .add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  /* Simple modal */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
  }

  .modal-overlay.open {
    display: flex;
  }

  .modal {
    background: #ffffff;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    padding: 16px 20px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    font-size: 14px;
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    padding-top: 10px;
  }

  .modal h3 {
    margin-top: 0;
    margin-bottom: 8px;
  }

  .modal-summary {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .modal-summary div {
    margin-bottom: 3px;
  }

  .modal-form-row {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
  }

  .modal-form-row label {
    font-weight: 600;
    margin-bottom: 2px;
  }

  .modal-form-row input,
  .modal-form-row textarea {
    font: inherit;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #d5d9d9;
  }

  .modal-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }

  .modal-actions button {
    font: inherit;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
  }

  .modal-actions .secondary {
    background: #ffffff;
    border-color: #d5d9d9;
  }

  .modal-actions .primary {
    background: var(--navy);
    color: #ffffff;
  }

  #selection-summary div {
    margin-bottom: 4px;
    font-size: 14px;
  }

  /* ---------- Price line ---------- */

  .price {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eaeded;
    font-size: 17px;
  }

  .price span#price {
    color: var(--price);
    font-weight: 700;
  }

  /* Color section */
  .color-hero {
    max-width: 380px;
    margin: 0 auto 8px;
    text-align: center;
  }

  .color-hero img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    object-fit: cover;
  }

  .color-hero-caption {
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
    color: var(--text-subtle);
  }

  /* Horizontal strip of color tiles */
  .color-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .color-tile {
    min-width: 110px;
    max-width: 110px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 17, 17, 0.15);
    cursor: pointer;
    box-sizing: border-box;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .color-tile.selected {
    border: 2px solid #06427e;
    box-shadow: 0 0 0 2px rgba(6, 66, 126, 0.35);
  }

  .color-tile img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
  }

  .color-tile-name {
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 4px;
  }

  .color-tile-category {
    font-size: 11px;
    color: #707070;
    margin-top: 2px;
    line-height: 1.2;
  }

  /* ---------- Utilities ---------- */
  .is-hidden {
    display: none !important;
  }

  /* ---------------- Mobile / small screens ---------------- */
  @media (max-width: 600px) {

    html, body { width: 100%; overflow-x: hidden; }
    img, video { max-width: 100%; height: auto; }

    body {
      padding-bottom: 110px;
      display: block;
    }

    .card {
      margin: 0;
      border-radius: 0;
      max-width: 100%;
      padding: 12px 12px 18px;
    }

    .section {
      margin-bottom: 16px;
      padding-top: 10px;
    }

    /* Header: stack */
    .brand-row {
      margin: -12px -12px 0;
      padding: 10px 12px;
      border-radius: 0;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }

    .brand-row img {
      max-height: 28px;
    }

    .licensing {
      justify-content: center !important;
    }

    .rating {
      width: 100%;
      justify-content: space-between;
      font-size: 12px;
    }

    .titles .title1 { font-size: 16px; }
    .titles .title2 { font-size: 12px; }

    /* Carousel: use aspect ratio (no hard height) */
    .carousel {
      max-width: 100%;
    }
    .carousel .frame {
      aspect-ratio: 4 / 5;
      height: auto !important;
    }

    /* Tile containers: default to 2-col grid instead of wrap math */
    .tile-container {
      flex-wrap: nowrap;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 6px;
      gap: 8px;
    }

    .tile-wrapper {
      flex: 0 0 auto;
      width: 160px;
    }

    .tile {
      height: 110px;
      padding: 6px;
      width: 100%;
    }

    .shingle-tile {
      height: auto !important;
      min-height: 140px;
      justify-content: flex-start;
      gap: 6px;
      padding: 8px 6px 10px;
      overflow: hidden;
    }

    /* Horizontal scroll sections: make card width smaller so more fit */
    #warranty-tiles .warranty-card,
    #financing-tiles .warranty-card {
      min-width: 140px;
      max-width: 160px;
    }

    /* Gutters/topper/chimney: keep horizontal scroll but smaller width */
    #gutter-tiles .tile-wrapper,
    #topper-tiles .tile-wrapper,
    #chimney-tiles .tile-wrapper {
      width: 150px;
    }

    .manufacturer-tile {
      height: 200px;
    }

    /* Color hero */
    .color-hero {
      max-width: 100%;
    }

    /* Floating bar: allow wrapping and reduce padding */
    .floating-bar {
      padding: 8px 10px;
      width: auto;
    }

    .floating-bar-inner {
      padding: 8px 10px;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .floating-disclaimer {
      white-space: normal;
      width: 100%;
      overflow: visible;
      text-overflow: unset;
      font-size: 12px;
      line-height: 1.2;
      flex: 1 1 100%;
      text-align: center;
      padding-bottom: 6px;
    }

    .add-to-cart-btn {
      width: 100%;
      justify-content: center;
      padding: 10px 16px;
      font-size: 14px;
    }

    /* Modal */
    .modal {
      width: calc(100% - 24px);
      padding: 14px 14px 16px;
      border-radius: 12px;
    }
  }

  /* Overlay should fill viewport and allow centering */
  .modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 200;
    background: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;

    /* mobile safari */
    padding: 12px;
  }

  .modal-overlay.open {
    display: flex;
  }

  /* Make modal scroll within viewport */
  .modal {
    width: min(520px, 100%);
    max-height: calc(100dvh - 24px); /* use dvh for mobile address bar */
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    background: #fff;
    border-radius: 12px;
    padding: 16px 16px 18px;
    box-sizing: border-box;
  }

  /* Keep action buttons reachable */
  .modal-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 10px;
    margin-top: 12px;
    border-top: 1px solid #eaeded;
  }

  /* Optional: sticky header for close */
  .modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eaeded;
    z-index: 1;
  }

  /* Close button style */
  .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }

  .modal-form-row {
    font-size: 16px;
  }
