/* kruise.com custom CSS (LIVE) - Version 1.1 - 1 Dec 2026
   Helix Ultimate loads this file automatically when it exists.
   v1.1: phone layout fixes (course lists as cards, state list 2/4 columns, smaller gap under the
         header), copied from the test site custom.css v1.7 after the mobile review.
   v1.0: long menu lists (the 50 states) scroll instead of running off the bottom of the screen.
   The test site's custom.css (v1.5) has more changes waiting on review; only this one is live. */

/* ---- Long menu lists scroll ------------------------------------------------------
   Shopping > Online Insurance Courses opens a 50-state list. The header is fixed (sticky), so
   the page cannot scroll to the bottom of the list and half the states were cut off.
   On desktop, a sub-menu with no further sub-menus is limited to the screen height and scrolls
   inside itself (mouse wheel or trackpad while the pointer is over the list). */
@media (min-width: 992px) {
  .sp-megamenu-parent .sp-dropdown-sub:not(:has(.sp-dropdown)) .sp-dropdown-inner {
    max-height: calc(100vh - 240px);
    min-height: 200px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ---- Phones (live v1.1) -----------------------------------------------------------------
   Mobile review 1 Dec at 375px wide: the course list tables (state pages, subscriptions) were
   about 570px wide, so License Type, the price and the Product details button were cut off the
   right edge. Below 768px each table row becomes a card. Labels match the table headings:
   course tables have 7 columns (Course Number, Insurance Credits, License Type), the
   subscriptions table 6 (Course Number, License Type). */
@media (max-width: 767.98px) {
  #sp-main-body { padding-top: 24px; padding-bottom: 32px; }
  #sp-section-1 > .row { margin-left: 0; margin-right: 0; }

  table.hikashop_products_table,
  table.hikashop_products_table > tbody,
  table.hikashop_products_table > tbody > tr,
  table.hikashop_products_table > tbody > tr > td {
    display: block;
    width: 100% !important;
  }
  table.hikashop_products_table > thead { display: none; }
  table.hikashop_products_table > tbody > tr {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 16px;
    background: #fff !important;
  }
  table.hikashop_products_table > tbody > tr > td {
    border: 0 !important;
    padding: 3px 0 !important;
    background: transparent !important;
    text-align: left;
  }
  table.hikashop_products_table td.hikashop_product_image_row,
  table.hikashop_products_table td.hikashop_product_name_row,
  table.hikashop_products_table td.hikashop_product_price_row,
  table.hikashop_products_table td.hikashop_product_add_to_cart_row { text-align: center; }
  table.hikashop_products_table td.hikashop_product_image_row img { max-width: 100%; height: auto; }
  table.hikashop_products_table td.hikashop_product_name_row { font-weight: 600; padding-bottom: 6px !important; }
  table.hikashop_products_table > tbody > tr > td:nth-child(3)::before,
  table.hikashop_products_table > tbody > tr > td:nth-child(4)::before,
  table.hikashop_products_table > tbody > tr > td:nth-child(5)::before { font-weight: 600; }
  table.hikashop_products_table > tbody > tr > td:nth-child(3)::before { content: "Course Number: "; }
  table.hikashop_products_table:has(> tbody > tr > td:nth-child(7)) > tbody > tr > td:nth-child(4)::before { content: "Insurance Credits: "; }
  table.hikashop_products_table:has(> tbody > tr > td:nth-child(7)) > tbody > tr > td:nth-child(5)::before { content: "License Type: "; }
  table.hikashop_products_table:not(:has(> tbody > tr > td:nth-child(7))) > tbody > tr > td:nth-child(4)::before { content: "License Type: "; }
  table.hikashop_products_table > tbody > tr > td > p { display: inline; margin: 0; }
  table.hikashop_products_table > tbody > tr > td:nth-child(3):not(:has(*)),
  table.hikashop_products_table > tbody > tr > td:nth-child(4):not(:has(*)),
  table.hikashop_products_table > tbody > tr > td:nth-child(5):not(:has(*)) { display: none; }
  table.hikashop_products_table td.hikashop_product_add_to_cart_row .hikabtn { margin-bottom: 0; }
}

/* Phones and tablets (live v1.1): the state list on Shopping > Online Insurance Courses is 7 columns
   (HikaShop sets width:14% on each item), so on a phone the state names ran into each other.
   Below 768px: 2 columns; 768-991px: 4 columns. */
@media (max-width: 991.98px) {
  ul.hikashop_category_list { display: block; list-style: none; padding-left: 0; }
  ul.hikashop_category_list > li.hikashop_category_list_item { width: 25% !important; padding: 6px 8px; }
}
@media (max-width: 767.98px) {
  ul.hikashop_category_list > li.hikashop_category_list_item { width: 50% !important; }
}
