/* Taevaskoja – quote form summary as a bottom sheet on phones and tablets (≤1150px, i.e. wherever the
   form and the summary card no longer sit side by side). Same pattern and look as the sub-page side
   menu pill (.side-bar): a fixed white pill at the bottom with the card title and the running total;
   tapping it slides the summary card up as a sheet over a dimmed page. JS: assets/js/enquiry-sheet.js */

.enquiry-bar,
.enquiry-overlay,
.enquiry__close {
  display: none;
}

@media (max-width: 1150px) {
  /* the inline card is replaced by the pill; it only renders as the open sheet */
  .enquiry-layout .enquiry--summary {
    display: none;
  }
  .enquiry-layout .enquiry--summary.is-open {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -0.5rem 2rem rgba(0, 0, 0, .25);
  }
  .enquiry-layout .enquiry--summary.is-open .enquiry__card {
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: none;
  }
  .enquiry-layout .enquiry--summary.is-open .enquiry__head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-right: 4rem;
  }
  .enquiry-layout .enquiry--summary.is-open .enquiry__close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: 1.25rem;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
  }
  .enquiry-layout .enquiry--summary.is-open .enquiry__close:hover,
  .enquiry-layout .enquiry--summary.is-open .enquiry__close:focus-visible {
    background: rgba(255, 255, 255, .3);
    outline: none;
  }

  /* bottom pill */
  .enquiry-bar {
    display: block;
    position: fixed;
    left: .625rem;
    right: .625rem;
    bottom: .625rem;
    z-index: 80;
    transition: transform .3s ease, opacity .3s ease;
  }
  .enquiry-bar[hidden] {
    display: none;
  }
  .enquiry-bar__toggle {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    height: 3.75rem;
    padding: .875rem .875rem .875rem 2.25rem;
    border: 0;
    border-radius: 12.5rem;
    background: var(--white, #fff);
    color: var(--g-100, #113617);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    line-height: normal;
    text-align: left;
    box-shadow: 3px 3px 21px 10px rgba(148, 154, 149, .5);
    cursor: pointer;
  }
  .enquiry-bar__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .enquiry-bar__total {
    flex-shrink: 0;
    padding: .25rem .75rem;
    border-radius: 999px;
    background: var(--yellow, #f6e27f);
    font-size: .9375rem;
  }
  .enquiry-bar__total[hidden] {
    display: none;
  }
  .enquiry-bar__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
  }
  body.has-enquiry-bar {
    padding-bottom: 5rem;
  }
  body.enquiry-sheet-open {
    overflow: hidden;
  }

  /* dimmed page behind the sheet */
  .enquiry-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(17, 54, 23, .5);
  }
  .enquiry-overlay[hidden] {
    display: none;
  }
}
