/* The footer is rendered by the theme itself (the route is mapped to a real layout,
   see the module's registerLayoutRoutes()). No footer overrides are needed here — any
   would fight the theme's own styling. */

/* Kramp search page: the theme's own header search bar drives the Kramp catalog search,
   so its markup/CSS are untouched. Only the theme's live-search suggestion panel is
   suppressed, because results are rendered in the Kramp results table instead. */
body.kramp-uses-theme-search .search-result,
body.kramp-uses-theme-search .search-results-empty {
  display: none !important;
}

/* The store category selector does not apply to the Kramp pricelist. */
body.kramp-uses-theme-search .search-categories {
  display: none !important;
}

  #kramp-catalog-search .kramp-journal-search {
    align-items: stretch;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    display: flex;
    margin: 30px 0 22px;
    min-height: 52px;
    overflow: visible;
    width: 100%;
  }

  #kramp-catalog-search .kramp-search-department {
    align-items: center;
    border-right: 1px solid #e5e5e5;
    color: #555;
    display: flex;
    flex: 0 0 285px;
    font-size: 14px;
    padding: 0 16px;
    white-space: nowrap;
  }

  #kramp-catalog-search .kramp-search-field {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    position: relative;
  }

  #kramp-catalog-search #kramp-search-query {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #333;
    font-size: 14px;
    height: 52px;
    line-height: 52px;
    outline: none;
    padding: 0 16px;
    width: 100%;
  }

  #kramp-catalog-search .kramp-search-field .help-block {
    margin: 7px 0 0;
    padding-left: 16px;
  }

  #kramp-catalog-search #kramp-search-button {
    align-items: center;
    background: #fff;
    border: 0;
    border-left: 1px solid #e5e5e5;
    color: #333;
    display: flex;
    flex: 0 0 auto;
    font-size: 14px;
    justify-content: center;
    min-width: 88px;
    padding: 0 18px;
  }

  #kramp-catalog-search #kramp-search-button:hover,
  #kramp-catalog-search #kramp-search-button:focus {
    background: #f5f5f5;
  }

  #kramp-search-results {
    clear: both;
    margin-top: 26px;
  }

  #kramp-search-results .table {
    margin-bottom: 15px;
  }

  #kramp-search-results .kramp-availability-cell {
    white-space: nowrap;
  }

  #kramp-search-results .kramp-availability-quantity {
    display: inline-block;
    margin-right: 8px;
    max-width: 80px;
    text-align: center;
    vertical-align: middle;
  }

  #kramp-search-results .kramp-check-availability {
    min-width: 155px;
    vertical-align: middle;
  }

  #kramp-availability-modal .modal-dialog {
    max-width: 560px;
  }

  #kramp-availability-modal .modal-header {
    border-bottom: 1px solid #eee;
    padding: 20px 25px;
  }

  #kramp-availability-modal .modal-body {
    padding: 25px;
  }

  #kramp-availability-product {
    margin-bottom: 18px;
  }

  #kramp-availability-modal .kramp-availability-card {
    border-radius: 4px;
    margin-bottom: 18px;
    padding: 16px 18px;
  }

  #kramp-availability-modal .kramp-availability-card strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
  }

  #kramp-availability-modal .kramp-availability-card p {
    margin-bottom: 10px;
  }

  #kramp-availability-modal .kramp-available {
    background: #ecfff3;
    border: 1px solid #77e59b;
    color: #18884b;
  }

  #kramp-availability-modal .kramp-not-available {
    background: #fff1f2;
    border: 1px solid #ff8e99;
    color: #d9293e;
  }

  #kramp-availability-modal .kramp-availability-meta {
    border-top: 1px solid rgba(0, 0, 0, .12);
    color: #555;
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
  }

  #kramp-product-request-form {
    border-top: 1px solid #ddd;
    padding-top: 18px;
  }

  #kramp-product-request-form h4 {
    font-weight: 700;
    margin-top: 0;
  }

  #kramp-availability-modal .kramp-request-confirmation {
    padding: 18px 0 8px;
    text-align: center;
  }

  #kramp-availability-modal .kramp-request-check {
    align-items: center;
    background: #22965b;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: 28px;
    height: 52px;
    justify-content: center;
    margin-bottom: 12px;
    width: 52px;
  }

  #kramp-availability-modal .kramp-request-confirmation h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
  }

  #kramp-availability-modal .kramp-request-confirmation p {
    color: #777;
    margin: 0;
  }

  @media (max-width: 767px) {
    #kramp-catalog-search .kramp-journal-search {
      display: block;
    }

    #kramp-catalog-search .kramp-search-department {
      border-bottom: 1px solid #e5e5e5;
      border-right: 0;
      min-height: 44px;
      width: 100%;
    }

    #kramp-catalog-search #kramp-search-button {
      border-left: 0;
      border-top: 1px solid #e5e5e5;
      height: 44px;
      width: 100%;
    }

    #kramp-search-results .kramp-availability-cell {
      white-space: normal;
    }

    #kramp-search-results .kramp-availability-quantity,
    #kramp-search-results .kramp-check-availability {
      display: block;
      margin: 0 0 8px;
      max-width: none;
      width: 100%;
    }

    #kramp-availability-modal .kramp-availability-meta {
      display: block;
    }

    #kramp-availability-modal .kramp-availability-meta span {
      display: block;
      margin-top: 6px;
    }
  }

.kramp-storefront-modal .modal-header {
    background: #b30000;
    color: #fff;
}

.kramp-storefront-modal .modal-header .modal-title,
.kramp-storefront-modal .modal-header .close {
    color: #fff;
    opacity: 1;
}

.kramp-storefront-alert {
    padding: 14px 16px;
    border-radius: 4px;
    background: #fdf2f2;
    border: 1px solid #f3c6c6;
    color: #8a1f1f;
    font-size: 15px;
    line-height: 1.5;
}

.kramp-storefront-alert .fa {
    margin-right: 8px;
}

.kramp-sf-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.kramp-sf-list li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.kramp-storefront-request {
    margin-top: 18px;
    border-top: 1px solid #e5e5e5;
    padding-top: 16px;
}

.kramp-storefront-confirm {
    padding: 18px 16px;
    border-radius: 4px;
    background: #eef9f0;
    border: 1px solid #cfead4;
    color: #1f7a33;
    font-size: 15px;
}

.kramp-storefront-confirm .fa {
    margin-right: 8px;
}

/* Kramp search results: the "Ex Tax:" line under the tax-inclusive price. */
.kramp-price-ex-tax {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}

/* ==================================================================
   Kramp search page — responsive results
   ================================================================== */

/* Phones: stack each result row as a labelled card instead of scrolling
   a 6-column table sideways. Labels come from the td[data-label]. */
@media (max-width: 767px) {
    /* Stacked layout replaces the horizontal scroller. */
    #kramp-search-results.table-responsive {
        overflow-x: visible;
        border: 0;
        margin-bottom: 0;
    }

    #kramp-search-results .kramp-results-table {
        border: 0;
    }

    #kramp-search-results .kramp-results-table thead {
        display: none;
    }

    #kramp-search-results .kramp-results-table,
    #kramp-search-results .kramp-results-table tbody,
    #kramp-search-results .kramp-results-table tr,
    #kramp-search-results .kramp-results-table td {
        display: block;
        width: 100%;
    }

    #kramp-search-results .kramp-results-table tr {
        margin-bottom: 14px;
        border: 1px solid #ddd;
        border-radius: 4px;
        overflow: hidden;
    }

    #kramp-search-results .kramp-results-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        border-bottom: 1px solid #f0f0f0;
        padding: 10px 12px;
        text-align: right;
    }

    #kramp-search-results .kramp-results-table td:last-child {
        border-bottom: 0;
    }

    /* Column heading rendered as the label on the left of each cell. */
    #kramp-search-results .kramp-results-table td::before {
        content: attr(data-label);
        flex: 0 0 40%;
        font-weight: 600;
        text-align: left;
        color: #666;
    }

    /* Quantity + availability button go full width under their label. */
    #kramp-search-results .kramp-results-table td.kramp-availability-cell {
        display: block;
        text-align: left;
    }

    #kramp-search-results .kramp-results-table td.kramp-availability-cell::before {
        display: block;
        margin-bottom: 8px;
    }

    #kramp-search-results .kramp-availability-quantity,
    #kramp-search-results .kramp-check-availability {
        display: block;
        width: 100%;
        max-width: none;
        margin: 0 0 8px;
    }

    /* Pagination and the result counter stack and centre. */
    #kramp-search-results .row > [class*="col-"] {
        text-align: center !important;
    }

    #kramp-search-results .pagination {
        margin: 8px 0;
    }
}

/* Plain "enter at least 3 characters" hint — no alert box/background, so it sits
   cleanly on the theme background (light or dark). */
.kramp-search-hint {
    background: none;
    border: 0;
    padding: 12px 0;
    margin: 0;
    color: inherit;
    opacity: .7;
    padding: 5px;
}
