/* Grand Line parity — roof calculator UI | cachebust 2.4.2-mobile-cachebust */
.gl-roof-calc {
  --gl-accent: #E30613;
  --gl-accent-dark: #C10510;
  --gl-border: #e3e3e3;
  --gl-muted: #777;
  --gl-panel: #f5f5f5;
  --gl-radius: 4px;
  font-size: 1.4rem;
  line-height: 1.45;
}

.gl-roof-calc .white-bg {
  background: #fff;
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
  padding: 2rem 2.4rem 2.4rem;
}

.gl-roof-calc .steps-list {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 0 0 2.4rem;
  padding: 0 0 1.2rem;
  border-bottom: 1px solid var(--gl-border);
}

.gl-roof-calc .steps-list__item {
  flex: 1 1 0;
  min-width: 12rem;
  padding: 0.8rem 1rem 1.2rem;
  color: var(--gl-muted);
  font-size: 1.3rem;
  font-weight: 600;
}

.gl-roof-calc .steps-list__item--active,
.gl-roof-calc .steps-list__item--passed {
  color: #222;
}

.gl-roof-calc .steps-list__item--active {
  font-weight: 700;
}

.gl-roof-calc .steps-list__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 3px;
  background: var(--gl-accent);
  transition: width 0.25s ease;
}

.gl-roof-calc .calc-row {
  margin-bottom: 2.4rem;
}

.gl-roof-calc .calc-row__title {
  display: block;
  margin: 0 0 1.2rem;
  font-size: 1.6rem;
  font-weight: 700;
}

.gl-roof-calc .calc-row hr {
  border: 0;
  border-top: 1px solid var(--gl-border);
  margin: 2rem 0 0;
}

.gl-roof-calc .calc-inputs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gl-roof-calc .calc-inputs-list--slider {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.8rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.gl-roof-calc .calc-inputs-list--slider .calc-inputs-list__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.gl-roof-calc .calc-input {
  position: relative;
  display: block;
  min-width: 11rem;
  cursor: pointer;
}

.gl-roof-calc .calc-input__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gl-roof-calc .calc-input__bg {
  position: absolute;
  inset: 0;
  border: 2px solid var(--gl-border);
  border-radius: var(--gl-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gl-roof-calc .calc-input__input:checked + .calc-input__bg {
  border-color: var(--gl-accent);
  box-shadow: inset 0 0 0 1px var(--gl-accent);
}

.gl-roof-calc .calc-input__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  min-height: 11rem;
  padding: 1.2rem 1rem 1rem;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
}

.gl-roof-calc .calc-input__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
}

.gl-roof-calc .calc-input__visual img {
  max-width: 100%;
  max-height: 7rem;
  height: auto;
  object-fit: contain;
}

.gl-roof-calc .calc-input__visual--full-width img {
  width: 100%;
  max-height: 9rem;
}

.gl-roof-calc .calc-input__color {
  font-size: 1.2rem;
  font-weight: 600;
}

.gl-roof-calc .calc-input__brand {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.2rem;
}

.gl-roof-calc .calc-input__visual-fallback {
  display: block;
  width: 100%;
  height: 8rem;
  background: linear-gradient(135deg, #f2f2f2 0%, #e4e4e4 100%);
}

.gl-roof-calc .selected-product__title a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.gl-roof-calc .calc-input__price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #222;
}

.gl-roof-calc .calc-input--product {
  min-width: 14rem;
}

.gl-roof-calc .calc-input--product .calc-input__content {
  min-height: 16rem;
}

.gl-roof-calc .roof-parameters .col-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2.4rem;
  align-items: start;
}

.gl-roof-calc .roof-parameters__visual {
  background: var(--gl-panel);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
  padding: 2rem;
  min-height: 28rem;
  display: grid;
  place-items: center;
}

.gl-roof-calc .roof-parameters__visual img {
  max-width: 100%;
  max-height: 36rem;
  object-fit: contain;
}

.gl-roof-calc .form-row {
  position: relative;
  margin-bottom: 1.2rem;
}

.gl-roof-calc .form-row__title {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.gl-roof-calc .form-control {
  width: 100%;
  min-height: 4.4rem;
  padding: 0.8rem 4rem 0.8rem 1.2rem;
  border: 1px solid #ccc;
  border-radius: var(--gl-radius);
  font: inherit;
  font-size: 1.6rem;
  background: #fff;
}

.gl-roof-calc .form-control:focus {
  border-color: var(--gl-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 121, 0, 0.15);
}

.gl-roof-calc .form-row__icon {
  position: absolute;
  right: 1.2rem;
  bottom: 1.1rem;
  color: var(--gl-muted);
  font-size: 1.2rem;
  font-weight: 700;
  pointer-events: none;
}

.gl-roof-calc .form-row.is-error .form-control {
  border-color: #d32f2f;
}

.gl-roof-calc .error-msg {
  display: none;
  margin-top: 0.4rem;
  color: #d32f2f;
  font-size: 1.2rem;
}

.gl-roof-calc .form-row.is-error .error-msg {
  display: block;
}

.gl-roof-calc .checkbox-panel {
  margin-bottom: 1.6rem;
}

.gl-roof-calc .checkbox-panel__title {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.gl-roof-calc .checkbox-panel__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gl-roof-calc .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 1.3rem;
}

.gl-roof-calc .checkbox__input {
  width: 1.6rem;
  height: 1.6rem;
  accent-color: var(--gl-accent);
}

.gl-roof-calc .calc-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  margin-top: 1.6rem;
}

.gl-roof-calc .gray-panel {
  background: var(--gl-panel);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
  padding: 1.6rem;
  margin-bottom: 1.6rem;
}

.gl-roof-calc .subheading {
  margin: -0.4rem 0 1.2rem;
  color: var(--gl-muted);
  font-size: 1.3rem;
}

.gl-roof-calc .color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.gl-roof-calc .color-swatch {
  width: 3.2rem;
  height: 3.2rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch-color, #ccc);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.gl-roof-calc .color-swatch.is-active {
  border-color: var(--gl-accent);
  box-shadow: 0 0 0 2px rgba(255, 121, 0, 0.25);
}

.gl-roof-calc .calc-row--thickness {
  margin-top: 1.2rem;
}

.gl-roof-calc .calc-row--thickness .form-control,
.gl-roof-calc [data-thickness-select] {
  max-width: 18rem;
  height: 4rem;
  padding: 0 1.2rem;
  border: 1px solid rgba(20, 20, 20, 0.16);
  border-radius: 0.4rem;
  background: #fff;
  font-size: 1.4rem;
}

.gl-roof-calc .filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}

.gl-roof-calc .filter-row label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.gl-roof-calc .filter-row select {
  width: 100%;
  min-height: 4rem;
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: var(--gl-radius);
  font: inherit;
}

.gl-roof-calc .sheet-length-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
  margin: 1.6rem 0;
}

.gl-roof-calc .counter {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: var(--gl-radius);
  overflow: hidden;
}

.gl-roof-calc .counter__btn {
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  background: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

.gl-roof-calc .counter__input {
  width: 5rem;
  height: 3.6rem;
  border: 0;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  text-align: center;
  font: inherit;
}

.gl-roof-calc .selected-products-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gl-roof-calc .selected-product {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  padding: 1.2rem 0;
  border-top: 1px solid var(--gl-border);
}

.gl-roof-calc .selected-product__img {
  width: 8rem;
  height: 8rem;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
}

.gl-roof-calc .selected-product__title {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.gl-roof-calc .selected-product__meta {
  margin: 0;
  color: var(--gl-muted);
  font-size: 1.2rem;
}

.gl-roof-calc .selected-product__price {
  margin: 0.4rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.gl-roof-calc .calc-row__info-msg {
  display: block;
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  background: #fff8ef;
  border: 1px solid #ffe0b2;
  border-radius: var(--gl-radius);
  color: #6d4c1a;
  font-size: 1.2rem;
}

.gl-roof-calc .basket-section__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30rem;
  gap: 2.4rem;
  align-items: start;
}

.gl-roof-calc .basket-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gl-roof-calc .basket-item {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--gl-border);
}

.gl-roof-calc .basket-item__title {
  margin: 0 0 0.6rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.gl-roof-calc .basket-item__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  color: var(--gl-muted);
  font-size: 1.3rem;
}

.gl-roof-calc .basket-item__price {
  margin-left: auto;
  font-weight: 700;
  color: #222;
}

.gl-roof-calc .basket-section__sidebar {
  position: sticky;
  top: 1.6rem;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
}

.gl-roof-calc .basket-section__sidebar__title {
  display: block;
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

.gl-roof-calc .basket-section__total-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gl-roof-calc .basket-section__total-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.6rem 0;
}

.gl-roof-calc .basket-section__total-item__title {
  margin: 0;
  color: var(--gl-muted);
  font-size: 1.3rem;
}

.gl-roof-calc .basket-section__total-item__value {
  margin: 0;
  font-weight: 700;
}

.gl-roof-calc .basket-section__total-item__value--price {
  font-size: 2rem;
  color: #222;
}

.gl-roof-calc hr {
  border: 0;
  border-top: 1px solid var(--gl-border);
  margin: 1.2rem 0;
}

.gl-roof-calc .btn-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.gl-roof-calc .btn--default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.8rem;
  padding: 0 2.4rem;
  border: 0;
  border-radius: var(--gl-radius);
  background: var(--gl-accent);
  color: #fff;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.gl-roof-calc .btn--default:hover {
  background: var(--gl-accent-dark);
  color: #fff;
}

.gl-roof-calc .btn--default:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gl-roof-calc .btn--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.8rem;
  padding: 0 2.4rem;
  border: 1px solid #ccc;
  border-radius: var(--gl-radius);
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.gl-roof-calc .btn--block {
  width: 100%;
}

.gl-roof-calc .calc-input--link {
  text-decoration: none;
  color: inherit;
}

.gl-roof-calc .calc-input--link:hover .calc-input__bg {
  border-color: var(--gl-accent);
}

.gl-roof-calc.calculator-hub-gl .calc-inputs-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

@media (max-width: 768px) {
  .gl-roof-calc.calculator-hub-gl .calc-inputs-list {
    grid-template-columns: 1fr;
  }
}


.gl-roof-calc .gl-roof-calc__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30rem;
  gap: 2.4rem;
  align-items: start;
}

.gl-roof-calc .gl-roof-calc__layout--full {
  grid-template-columns: 1fr;
}

.gl-roof-calc .gl-roof-calc__layout--full [data-roof-aside],
.gl-roof-calc .gl-roof-calc__layout--full [data-gl-aside] {
  display: block;
}


.gl-roof-calc .gl-roof-calc__aside-panel {
  position: sticky;
  top: 1.6rem;
}

@media (max-width: 960px) {
  .gl-roof-calc .roof-parameters .col-row,
  .gl-roof-calc .basket-section__inner,
  .gl-roof-calc .gl-roof-calc__layout {
    grid-template-columns: 1fr;
  }

  .gl-roof-calc .filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .gl-roof-calc {
    overflow: hidden;
  }

  /* The site-wide action bar must not cover calculator navigation. */
  .gl-roof-calc [data-roof-footer],
  .gl-roof-calc [data-gl-footer] {
    position: sticky;
    bottom: calc(7.2rem + env(safe-area-inset-bottom));
    z-index: 191;
    padding: 0.8rem 0 calc(0.8rem + env(safe-area-inset-bottom));
    background: var(--gl-surface, #fff);
    border-top: 1px solid var(--gl-border);
  }

  .gl-roof-calc [data-roof-footer] .btn-panel,
  .gl-roof-calc [data-gl-footer] .btn-panel {
    margin-top: 0;
  }

  .gl-roof-calc .white-bg {
    padding: 1.6rem;
    border-radius: 0;
  }

  .gl-roof-calc .steps-list {
    display: flex;
    overflow-x: auto;
    gap: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .gl-roof-calc .steps-list::-webkit-scrollbar {
    display: none;
  }

  .gl-roof-calc .steps-list__item {
    flex: 0 0 auto;
    min-width: 12rem;
    padding: 1.2rem 1.4rem;
    font-size: 1.3rem;
    white-space: nowrap;
  }

  .gl-roof-calc .calc-inputs-list,
  .gl-roof-calc .calc-inputs-list--slider {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .gl-roof-calc .calc-inputs-list__item,
  .gl-roof-calc .calc-inputs-list--slider .calc-inputs-list__item {
    min-width: 0;
    flex: initial;
  }

  .gl-roof-calc .calc-input {
    width: 100%;
    min-width: 0;
  }

  .gl-roof-calc .calc-input__visual {
    width: 100%;
    height: 7.2rem;
    min-height: 0;
  }

  .gl-roof-calc .calc-input__visual img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
  }

  .gl-roof-calc .calc-input__content {
    gap: 0.8rem;
    min-height: 12.2rem;
    padding: 0.9rem 0.7rem 0.8rem;
    font-size: 1.25rem;
    line-height: 1.25;
  }

  .gl-roof-calc .form-control,
  .gl-roof-calc select,
  .gl-roof-calc [data-thickness-select] {
    min-height: 4.8rem;
    font-size: 1.6rem;
  }

  .gl-roof-calc .roof-parameters__visual {
    min-height: 18rem;
  }

  .gl-roof-calc .gl-roof-calc__aside-panel {
    position: static;
  }

  .gl-roof-calc .basket-section,
  .gl-roof-calc .calc-actions,
  .gl-roof-calc .lead-form {
    padding-bottom: calc(1.6rem + env(safe-area-inset-bottom));
  }

  .gl-roof-calc .calc-options-row {
    grid-template-columns: 1fr;
  }

  .gl-roof-calc .color-swatches {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .gl-roof-calc .calc-input__visual {
    height: 6.4rem;
  }

  .gl-roof-calc .calc-input__content {
    min-height: 11.2rem;
    font-size: 1.2rem;
  }
}

/* Result mode: the calculator becomes a focused result screen. */
body.kv-roof-calc-result .site-main--roof-calculator-gl > :not(.calculator-section) {
  display: none !important;
}

body.kv-roof-calc-result .site-main--roof-calculator-gl .calculator-section {
  padding-top: 2.4rem;
  padding-bottom: 3.2rem;
}

body.kv-roof-calc-result .gl-roof-calc__layout {
  grid-template-columns: minmax(0, 1fr);
}

body.kv-roof-calc-result .gl-roof-calc [data-roof-aside] {
  display: none !important;
}

.gl-roof-calc {
  scroll-margin-top: calc(var(--mp-header-height, 148px) + 12px);
}

@media (max-width: 767px) {
  /* The fixed global CTA is useful during selection, but overlaps result actions. */
  body.kv-roof-calc-result .mobile-action-bar {
    display: none !important;
  }

  body.kv-roof-calc-result .site-main--roof-calculator-gl .calculator-section {
    padding-top: 1.2rem;
    padding-bottom: calc(3.2rem + env(safe-area-inset-bottom));
  }

  .gl-roof-calc {
    scroll-margin-top: calc(var(--mp-header-height-mobile, 126px) + 12px);
  }

  /* The share action is always fully reachable above fixed mobile controls. */
  body.kv-roof-calc-result [data-calculator-export="share"] {
    margin-bottom: calc(2.4rem + env(safe-area-inset-bottom));
  }
}
