/*
Theme Name: Autohex
Theme URI: https://autohexshop.com/
Author: Autohex Automotive Electronics
Author URI: https://autohexshop.com/
Description: Premium dark-themed automotive software, electronics, and ECU module repair theme for WordPress. Custom-crafted for Autohex in Oton, Iloilo, Philippines.
Version: 1.0.6
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: Proprietary
Text Domain: autohex
*/

/* WordPress Core Alignment & Reset classes */
.alignnone {
  margin: 5px 20px 20px 0;
}
.aligncenter, div.aligncenter {
  display: block;
  margin: 5px auto;
}
.alignright {
  float: right;
  margin: 5px 0 20px 20px;
}
.alignleft {
  float: left;
  margin: 5px 20px 20px 0;
}
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  white-space: nowrap;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

/* -------------------------------------------------------------
 * 1. WordPress Admin Bar Compatibility for Fixed Header
 * ----------------------------------------------------------- */
.admin-bar .autohex-header {
  top: 32px !important;
}

@media screen and (max-width: 782px) {
  .admin-bar .autohex-header {
    top: 46px !important;
  }
}

/* Ensure single product page padding accounts for fixed header */
.autohex-single-product-page {
  padding-top: 8rem;
}

.admin-bar .autohex-single-product-page {
  padding-top: 10.5rem;
}

@media screen and (max-width: 782px) {
  .autohex-single-product-page {
    padding-top: 6.5rem;
  }
  .admin-bar .autohex-single-product-page {
    padding-top: 9rem;
  }
}

/* -------------------------------------------------------------
 * 2. Navigation Mega Dropdowns & Hover Functionality
 * ----------------------------------------------------------- */
.has-dropdown {
  position: relative;
}

.has-dropdown > .dropdown-panel {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  padding-top: 0.5rem;
  z-index: 1000 !important;
}

/* Pure CSS hover & focus-within fallback so dropdowns open instantly */
.has-dropdown:hover > .dropdown-panel,
.has-dropdown:focus-within > .dropdown-panel,
.has-dropdown.dropdown-active > .dropdown-panel {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.has-dropdown:hover svg,
.has-dropdown.dropdown-active svg {
  transform: rotate(180deg);
}

/* Mobile drawer positioning & z-index */
#mobile-drawer {
  position: relative;
  z-index: 999;
}

/* -------------------------------------------------------------
 * 3. WooCommerce Header Cart Icon & Live Counter
 * ----------------------------------------------------------- */
.autohex-header-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--light, #e9e7e2);
  transition: color 0.2s ease, transform 0.2s ease;
}

.autohex-header-cart:hover {
  color: var(--red, #e10600);
  transform: scale(1.08);
}

.autohex-cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--red, #e10600);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  height: 18px;
  min-width: 18px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.autohex-cart-count.empty {
  display: none;
}

/* -------------------------------------------------------------
 * 4. Custom WordPress Nav Menu Compatibility (Appearance > Menus)
 * ----------------------------------------------------------- */
.autohex-custom-nav ul {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.autohex-custom-nav li {
  position: relative;
}

.autohex-custom-nav li a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--light, #e9e7e2);
  transition: color 0.2s ease;
  text-decoration: none;
}

.autohex-custom-nav li a:hover,
.autohex-custom-nav li.current-menu-item > a,
.autohex-custom-nav li.current-menu-ancestor > a {
  color: var(--red, #e10600);
}

.autohex-custom-nav ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: rgba(14, 10, 9, 0.98);
  border: 1px solid var(--line, rgba(203, 198, 185, 0.14));
  padding: 0.75rem 0;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
  z-index: 1000;
  flex-direction: column;
  gap: 0;
}

.autohex-custom-nav li:hover > ul.sub-menu,
.autohex-custom-nav li:focus-within > ul.sub-menu {
  display: flex !important;
}

.autohex-custom-nav ul.sub-menu li {
  width: 100%;
}

.autohex-custom-nav ul.sub-menu li a {
  padding: 0.5rem 1.25rem;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--light, #e9e7e2);
  display: block;
}

.autohex-custom-nav ul.sub-menu li a:hover {
  background: rgba(225, 6, 0, 0.1);
  color: var(--red, #e10600);
}

/* -------------------------------------------------------------
 * 5. Strict Header Logo Size Lock (Prevents WooCommerce height:auto blowout)
 * ----------------------------------------------------------- */
.autohex-logo-img,
header.autohex-header img,
.autohex-header img,
body.woocommerce-page header.autohex-header img,
body.woocommerce header.autohex-header img,
.woocommerce-page .autohex-logo-img,
.woocommerce .autohex-logo-img {
  height: 40px !important;
  max-height: 48px !important;
  width: auto !important;
  max-width: 200px !important;
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0 !important;
}

@media (min-width: 768px) {
  .autohex-logo-img,
  header.autohex-header img,
  .autohex-header img,
  body.woocommerce-page header.autohex-header img,
  body.woocommerce header.autohex-header img,
  .woocommerce-page .autohex-logo-img,
  .woocommerce .autohex-logo-img {
    height: 48px !important;
    max-height: 48px !important;
    width: auto !important;
    max-width: 220px !important;
  }
}

/* Ensure desktop navigation items do not wrap */
header.autohex-header nav {
  flex-wrap: nowrap !important;
}

header.autohex-header nav a {
  white-space: nowrap !important;
}

/* -------------------------------------------------------------
 * 6. WooCommerce Primary Buttons - Autohex Racing Red (Overrides WC default purple)
 * ----------------------------------------------------------- */
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce button.single_add_to_cart_button,
.woocommerce input.button.alt,
button.single_add_to_cart_button,
.woocommerce #respond input#submit.alt {
  background-color: var(--red, #e10600) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.14em !important;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.single_add_to_cart_button:hover,
button.single_add_to_cart_button:hover,
.woocommerce #respond input#submit.alt:hover {
  background-color: #b50500 !important;
  color: #ffffff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 20px rgba(225, 6, 0, 0.4) !important;
}


