/*
  Accomplice Event Rentals - site styles (public site).
  Loaded by core/template_header.cfm as assets/css/style.css?v<css_version> (css_version = YYMMDD-HHMMSS of this file's last change,
  set in Application.cfm, so every edit busts the browser cache by itself).
  Load order: Bootstrap 4.4.1 -> theme.css -> this file -> page styles (page_header / <style> in each page, they win over this file).
  Layout and components, SHARED by both sites. Every color / font comes from assets/css/theme.css (site specific): do not hard-code one here.
*/

:root {
  /* layout (colors and fonts are in theme.css) */
  --sidebar-width: 200px;
  --container-max: 1400px;
  --header-icons-gap: 18px;          /* mobile header: space between Menu / account / cart / search */
  --footer-height: 156px;            /* fallback, the real height is set by assets/js/main.js */
  /* the mobile breakpoint is 1080px (CSS cannot use a variable in a media query): keep the @media at the end of this file in sync */
}

/* ---------- base ---------- */
html, body {
  height: 100%;
}
body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
}
h1, h2, h3 {
  font-family: var(--font-heading);
}
a {
  color: var(--color-primary);
}
a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}
.text-primary {
  color: var(--color-primary) !important;
}
a.text-primary:focus, a.text-primary:hover {
  color: var(--color-text-muted) !important;
}
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-primary:hover,
.btn-primary.focus, .btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled).active, .btn-primary:not(:disabled):not(.disabled):active, .show > .btn-primary.dropdown-toggle {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}
.btn-primary.focus, .btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled).active:focus, .btn-primary:not(:disabled):not(.disabled):active:focus, .show > .btn-primary.dropdown-toggle:focus {
  box-shadow: 0 0 0 .2rem var(--color-primary-focus-ring);
}
.container {
  max-width: var(--container-max);
}

/* ---------- backgrounds ---------- */
.bg-theme {
  background: var(--bg-theme-solid);
  background: var(--bg-theme-gradient);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  height: 100%;
}
.bg_white {
  background-color: var(--color-white);
}

/* ---------- page shell ---------- */
.page {
  position: relative;
  margin-left: var(--sidebar-width);
  min-height: 100%;
}
/* short pages: the white section fills the browser height down to the footer (the footer is absolute at the bottom, .page_content keeps its height as padding) */
.page_content {
  min-height: 100vh;
  min-height: 100dvh;      /* phones: 100vh counts the area under the browser's address / navigation bar, which made short pages (home) scroll for nothing; dvh is the visible height. Browsers without dvh keep the 100vh line above */
  display: flex;
  flex-direction: column;
  padding-bottom: var(--footer-height); /* main.js sets the real footer height */
}
.page_content > section.bg_white:last-of-type {
  flex: 1 0 auto;
}
.header {
  background: none;
}
.menu_mobile {
  display: none;
}

/* ---------- sidebar menu (categories) ---------- */
.sidebar {
  position: absolute;
  top: 0;
  left: calc(var(--sidebar-width) * -1);
  z-index: 9;
  display: block;
  width: var(--sidebar-width);
  min-height: 100%;
  height: auto;            /* grows with the menu: no inner scrollbar, the page itself scrolls if the menu is taller than the browser */
  border: none;
  overflow-x: clip;
  overflow-y: visible;
  list-style: none;
}
.nav_accordion_box {
  text-align: right;
  padding: 20px 20px 60px 0;
  margin-top: 100px;       /* logo space */
}
.nav_accordion_box_mobile {
  text-align: center;
  padding: 20px;
  list-style: none;
  text-transform: uppercase;
}
.nav_accordion_box li, .nav_accordion_box a, .nav_accordion_box_mobile li, .nav_accordion_box_mobile a {
  color: var(--color-text-on-theme);
  font-size: var(--font-size-nav);
  text-transform: uppercase;
}
.nav_accordion_box li:hover, .nav_accordion_box a:hover, .nav_accordion_box_mobile li:hover, .nav_accordion_box_mobile a:hover {
  color: var(--color-text-on-theme-hover);
}
.nav_accordion_box_mobile li:hover, .nav_accordion_box_mobile a:hover {
  font-weight: bold;
}
/* master only: active products per category (review) */
.cat_count {
  font-size: 0.6em;
  opacity: 0.75;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: none;
  font-weight: normal;
  color: var(--color-text-muted);
}
/* category being viewed */
.nav_accordion_box a.cat_active, .nav_accordion_box_mobile a.cat_active {
  color: var(--color-text-on-theme-hover);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.sub_nav {
  padding-top: 5px;
  padding-bottom: 15px;
}
.sub_nav a {
  display: block;
  line-height: 24px;
  color: var(--color-text-sub-menu);
  font-size: 20px;
  text-transform: uppercase;
}

/* ---------- header navigation ---------- */
.header_logo a {
  display: block;
  line-height: 0;          /* no inline-image gap under the logo: it centers exactly against the icons */
}
.header_logo img {
  display: block;
}
.main_nav {
  padding-right: 12px;
}
.main_nav a {
  color: var(--color-text-muted);
  margin-left: 15px;
}
.main_nav a:hover {
  color: var(--color-text-on-theme-hover);
}
.main_nav_icons {
  color: var(--color-accent) !important;
}
.main_nav_icons:hover {
  color: var(--color-text-on-theme-hover) !important;
}
.main_nav_mobile_icon {
  color: var(--color-accent) !important;
  font-size: 1.2em;
}
.main_nav_mobile_icon:hover {
  text-decoration: none;
  color: var(--color-text-on-theme-hover) !important;
}
.main_nav_dot {            /* "signed in" dot on the mobile account icon */
  position: absolute;
  top: -2px;
  right: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-online);
}

/* ---------- full screen mobile menu (#myNav) ---------- */
.overlay {
  height: 0%;
  width: 100%;
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  background: var(--bg-theme-solid);
  background: var(--bg-theme-gradient);
  overflow: scroll;
  transition: 0.5s;
}
.overlay-content {
  position: relative;
  width: 100%;
  text-align: center;
}
.overlay .closebtn {
  position: absolute;
  top: 20px;
  right: 45px;
  z-index: 15;
  display: block;
  padding: 8px;
  text-decoration: none;
  font-size: 60px;
  color: var(--color-text-close);
  transition: 0.3s;
}
.overlay .closebtn:hover {
  color: var(--color-text-on-theme-hover);
}
@media screen and (max-height: 450px) {
  .overlay .closebtn {
    font-size: 40px;
    top: 15px;
    right: 35px;
  }
}

/* ---------- search overlay (#myOverlay) ---------- */
.search_overlay {
  height: 100%;
  width: 100%;
  display: none;
  position: fixed;
  z-index: 15;
  top: 0;
  left: 0;
  background-color: var(--bg-search-overlay);
}
.search_overlay_content {
  position: relative;
  top: 46%;
  width: 80%;
  text-align: center;
  margin: auto;
}
.search_overlay .closebtn {
  position: absolute;
  top: 7px;
  right: 45px;
  font-size: 60px;
  cursor: pointer;
  color: var(--color-white);
}
.search_overlay .closebtn:hover {
  color: var(--color-text-muted);
}

/* ---------- product images ---------- */
/* reserve the square (images are 800 x 800) and show the placeholder until the real image has loaded.
   loading="lazy" on the img: the first row / the main image are eager, the rest load when they get close to the screen */
img.lazy_img {
  display: inline-block;   /* same flow as before (a <br> follows the image) */
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--color-placeholder) url('../images/placeholder.png') center / cover no-repeat;
}

/* ---------- product cards (category, search and home listings) ---------- */
.product a {
  color: var(--color-product-link);
  font-weight: bold;
}
.product img {
  margin-bottom: 6px;
  transition: all 0.5s ease-in-out 0s;
  border: 1px solid var(--color-placeholder);
}
.product:hover img {
  transform: scale(1.06);
}

/* ---------- category page: title left, product count top right ---------- */
.category_head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.category_head h1 {
  margin: 0 0 .5rem;
}
.category_count {
  flex: none;
  color: var(--color-text-count);
  font-size: 1rem;
  white-space: nowrap;
}

/* ---------- cart: Export Cart button ---------- */
.export_button i {
  font-size: .7em;
  vertical-align: .08em;
}

/* ---------- footer ---------- */
.footer {
  width: 100%;
  position: absolute;
  bottom: 0;
}
.footer_right {
  padding-right: 5px;
}
.footer_right a {
  color: var(--color-text-muted);
  margin-left: 10px;
}
.footer_right a:hover {
  color: var(--color-text-on-theme-hover);
}
.footer_breadcrumb {
  color: var(--color-text-footer);
  font-size: 0.95em;
  padding-left: 5px;
}
.footer_breadcrumb a, .footer_copy a {
  color: var(--color-text-footer);
}
.footer_breadcrumb a:hover, .footer_copy a:hover {
  color: var(--color-text-on-theme-hover);
}
.footer_copy {
  color: var(--color-text-footer);
  font-size: 0.8em;
}

/* ---------- mobile (max 1080px) ---------- */
@media only screen and (max-width: 1080px) {
  .page {
    margin-left: 0;
  }
  .sidebar {
    display: none;
  }
  .menu_item {
    display: none;
  }
  .menu_mobile {
    display: inline-block;
  }

  /* header: logo and icons on one line, icons evenly spaced and centered vertically on the logo */
  .header .row {
    align-items: center;
  }
  .main_nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--header-icons-gap);
    padding-right: 0;
  }
  .main_nav > a, .main_nav > span {
    margin: 0 !important;  /* beats the old inline margins; the spacing is the gap above */
    line-height: 1;
  }
  .main_nav .fas {
    display: block;
    line-height: 1;
  }
}
