/*
 * Hand-authored fixes for bugs introduced by moving off WordPress/Divi.
 * Divi's real page appearance depended on: (a) per-post CSS cache files
 * (wp-content/et-cache/<id>/et-core-unified-*.css) that were never wired
 * into this static site, and (b) core theme JS that measured the header
 * on load and wrote inline pixel heights for the logo to size against.
 * Neither exists here, so a handful of things render broken without
 * these overrides. Loaded last (after generated-*.css) so it wins the
 * cascade without needing !important.
 */

* {
  box-sizing: border-box;
}
body {
  overflow-x: hidden;
}

/* --- Header logo ---
 * The logo's on-page size used to come from Divi's core JS measuring
 * #main-header and writing an inline pixel height for .logo_container,
 * which #logo then sized itself against as a percentage. With that JS
 * gone, the percentage heights resolve to nothing and the browser falls
 * back to the <img width="1000" height="222"> attributes, forcing the
 * whole header (and page) to ~1100px wide even on phones. Give it a
 * plain, fixed CSS size instead.
 */
.logo_container {
  height: auto;
  opacity: 1;
  display: block;
  padding: 16px 0 16px 30px;
}
#logo {
  height: 64px;
  width: auto;
  max-width: 100%;
  max-height: none;
}
@media (max-width: 767px) {
  .logo_container {
    padding: 14px 0 14px 16px;
  }
  #logo {
    height: 48px;
  }
}

/* --- Top nav ---
 * Divi positioned this nav with JS-computed offsets against the logo.
 * Lay it out with plain flexbox instead so it wraps cleanly at any width.
 */
#et-top-navigation {
  position: static;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 12px 24px;
}
#top-menu-nav {
  float: none;
}
#top-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
}
/* .container held the logo and nav as two stacked block rows (the
 * height/offset JS this depended on is gone, see file header comment) —
 * lay them out side by side instead, wrapping to a second row only when
 * the viewport is too narrow for both. */
#main-header .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
#main-header {
  border-bottom: 1px solid #eee;
}

/* Divi's PHP-backed sitewide search and the JS-driven mobile hamburger
 * never had a backend or toggle script in this static rebuild — both are
 * inert, so hide rather than ship broken UI. */
#et_top_search,
#et_search_icon,
.et_search_outer,
#et_mobile_nav_menu {
  display: none !important;
}

/* --- Buttons ---
 * Divi's "dark layout" button preset (white text/border, transparent
 * background) is meant to sit on a colored section background that was
 * only ever supplied by the per-post CSS cache above — so these render
 * as invisible white-on-white. Give them real, on-brand styling.
 */
a.et_pb_button {
  display: inline-block;
  background-color: #ef5f00;
  border: 2px solid #ef5f00;
  color: #fff;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
a.et_pb_button:hover {
  background-color: #111;
  border-color: #111;
  color: #fff;
}

/* --- .btn ---
 * Used by the newer, componentized parts of the site (AddToCartBar, the
 * cart/checkout form) — unlike .et_pb_button above, this class was never
 * actually defined anywhere, so "Add to cart" and "Pay with PayFast"
 * rendered as unstyled native buttons. Same brand color as .et_pb_button,
 * without Divi's fragile arrow-slide hover mechanics.
 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #ef5f00;
  border: 2px solid #ef5f00;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}
.btn:hover {
  background-color: #111;
  border-color: #111;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
  transform: none;
}
