/*
Theme Name: Globonex Executive Brand Theme
Theme URI: https://globonex.com
Author: Globonex DevOps & Engineering
Author URI: https://globonex.com
Description: Executive glassmorphism WordPress theme built from scratch to mirror the Executive CMS Billing Automation portal. Features 6 built-in color schemes, expanded Customizer controls, responsive navigation, and block editor support.
Version: 1.1.0
Tested up to: 6.7
Requires at least: 5.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: globonex-billing-theme
Tags: executive, glassmorphism, responsive, customizer, hosting, billing-portal, custom-colors, block-styles
*/

/* Reset & Foundational Rules */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100%;
}

body {
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  background-color: var(--body-bg, #f4f7fb);
  color: var(--text-main, #0f172a);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
}

/* Global Fluid Media & Embed Elements */
img, video, iframe, embed, object {
  max-width: 100% !important;
  height: auto;
  box-sizing: border-box;
}

table {
  max-width: 100%;
  box-sizing: border-box;
}

pre, code {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-width: 100%;
}

/* Break-Word Protection Across All Headings and Text */
h1, h2, h3, h4, h5, h6, p, span, a, label, li {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a {
  color: var(--primary-color, #0564d2);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover, a:focus {
  color: var(--primary-hover, #034ca3);
}

/* Container Engine - 100% Full-Width Responsive Canvas */
.site-container {
  width: 100%;
  max-width: var(--container-max-width, 100%);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 2.5vw, 2.5rem);
  padding-right: clamp(1rem, 2.5vw, 2.5rem);
  box-sizing: border-box;
  overflow-x: clip;
}

#primary, .site-main, .whmcs-header, .whmcs-nav-bar, .site-footer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Ensure Grid & Flex Children Shrink Gracefully Without Forcing Horizontal Overflow */
.content-area,
.sidebar-area,
.site-content-layout > *,
.footer-col {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Executive Card / Surface */
.glass-card,
.site-card,
article.post,
article.page {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--bg-card-border, #e2e8f0);
  border-radius: var(--radius-card, 12px);
  box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.08));
  padding: 2.25rem;
  margin-bottom: 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Button Component Hierarchy */
.btn, button, input[type="submit"], input[type="button"], .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary, input[type="submit"], .wp-block-button__link {
  background: var(--btn-primary-bg, #0564d2) !important;
  color: var(--btn-primary-text, #ffffff) !important;
  box-shadow: 0 4px 12px rgba(5, 100, 210, 0.25);
}

.btn-primary:hover, input[type="submit"]:hover, .wp-block-button__link:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 100, 210, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main, #0f172a);
  border: 1px solid var(--btn-secondary-border, #e2e8f0);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--primary-color, #0564d2);
  color: var(--primary-color, #0564d2);
}

/* Header & Top Bar */
.whmcs-header {
  background: var(--header-bg, #1e3e62);
  color: var(--header-text, #ffffff);
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

.whmcs-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.whmcs-brand {
  flex-shrink: 0;
}

.whmcs-brand a,
.whmcs-brand-link {
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.whmcs-brand a:hover,
.whmcs-brand-link:hover {
  color: #ffffff;
  opacity: 0.95;
}

.whmcs-brand-logo {
  max-height: 42px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
}

.whmcs-brand-fallback-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.site-brand-title {
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  color: #ffffff;
}

/* Polished Header Action Buttons */
.whmcs-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.whmcs-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  min-height: 36px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-sizing: border-box;
  line-height: 1.2;
}

.whmcs-btn-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.whmcs-action-kb {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.whmcs-action-kb:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.whmcs-action-cart {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
  display: inline-flex;
  align-items: center;
  position: relative;
}
.whmcs-action-cart:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.whmcs-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  margin-left: 5px;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

.globonex-header-quote-btn {
  background: linear-gradient(135deg, #0564d2 0%, #0284c7 100%);
  color: #ffffff !important;
  border: none !important;
  padding: 0.42rem 0.95rem;
  min-height: 36px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  cursor: pointer;
}
.globonex-header-quote-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}

.whmcs-action-login {
  background: var(--btn-primary-bg, #0564d2);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(5, 100, 210, 0.25);
}
.whmcs-action-login:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 100, 210, 0.38);
}

.globonex-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 0.42rem 0.85rem;
  min-height: 36px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-sizing: border-box;
}
.globonex-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* Sticky Navigation Bar */
.whmcs-nav-bar {
  background: var(--nav-bg, #1e3e62);
  border-bottom: 3px solid var(--nav-border-bottom, #0564d2);
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  width: 100%;
}

.whmcs-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  width: 100%;
}

.whmcs-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.whmcs-menu li {
  position: relative;
}

.whmcs-menu > li > a {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.15rem;
  color: var(--nav-text, #e2e8f0);
  font-weight: 600;
  font-size: 0.93rem;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.whmcs-menu > li > a:hover,
.whmcs-menu > li.current-menu-item > a,
.whmcs-menu > li.current_page_item > a {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.whmcs-menu .menu-item-has-children > a::after,
.whmcs-menu .page_item_has_children > a::after {
  content: '▾';
  display: inline-block;
  margin-left: 0.45rem;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.whmcs-menu .menu-item-has-children:hover > a::after,
.whmcs-menu .page_item_has_children:hover > a::after {
  transform: rotate(180deg);
}

/* Dropdown Sub-menus */
.whmcs-menu ul.sub-menu,
.whmcs-menu ul.children {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--header-bg, #1e3e62);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 3px solid var(--primary-color, #0564d2);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  display: none;
  z-index: 10000;
  backdrop-filter: blur(12px);
}

.whmcs-menu li:hover > ul.sub-menu,
.whmcs-menu li:hover > ul.children {
  display: block;
  animation: whmcsMenuFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes whmcsMenuFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.whmcs-menu ul.sub-menu a,
.whmcs-menu ul.children a {
  display: block;
  padding: 0.7rem 1.25rem;
  font-size: 0.88rem;
  color: #cbd5e1;
  border-radius: 0;
  transition: all 0.2s ease;
}

.whmcs-menu ul.sub-menu a:hover,
.whmcs-menu ul.children a:hover {
  background: var(--primary-color, #0564d2);
  color: #ffffff;
  padding-left: 1.5rem;
}

.whmcs-submenu-toggle {
  display: none;
}

/* Mobile Hamburger Button */
.whmcs-mobile-toggle {
  display: none;
  background: var(--primary-color, #0564d2);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.whmcs-mobile-toggle:hover {
  filter: brightness(1.1);
}

/* Footer Hierarchy */
.site-footer {
  background: var(--footer-bg, #0f172a);
  color: var(--footer-text, #94a3b8);
  padding: 3.5rem 0 2rem 0;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4, .site-footer h5, .site-footer h6 {
  color: var(--footer-heading, #ffffff) !important;
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.footer-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
  width: 100%;
}

.footer-col {
  min-width: 0;
  max-width: 100%;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  width: 100%;
}

.footer-links-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links-inline li {
  margin: 0;
}

.footer-links-inline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links-inline a:hover {
  color: var(--primary-color, #0564d2);
  text-decoration: underline;
}

/* Responsive Content Layout Engine */
.site-content-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  width: 100%;
}

.site-content-layout.has-sidebar {
  grid-template-columns: 1fr 320px;
}

/* Responsive Breakpoints & Mobile Optimization */
@media (max-width: 900px) {
  .site-content-layout.has-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar-area {
    margin-top: 1rem;
  }
}

@media (max-width: 860px) {
  .whmcs-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .whmcs-brand {
    display: flex;
    justify-content: center;
    text-align: center;
  }

  .whmcs-header-actions {
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }

  .whmcs-mobile-toggle {
    display: inline-flex;
  }

  .whmcs-nav-inner {
    flex-wrap: wrap;
    padding: 0.5rem 0;
  }

  .whmcs-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--nav-bg);
    border-radius: 0 0 8px 8px;
  }

  .whmcs-menu.active {
    display: flex;
  }

  .whmcs-menu li {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .whmcs-menu > li > a {
    flex: 1;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    font-size: 0.98rem;
  }

  .whmcs-menu .menu-item-has-children > a::after,
  .whmcs-menu .page_item_has_children > a::after {
    display: none;
  }

  .whmcs-submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .whmcs-submenu-toggle.expanded .whmcs-arrow-icon {
    transform: rotate(180deg);
  }

  .whmcs-menu ul.sub-menu,
  .whmcs-menu ul.children {
    position: static;
    display: none;
    width: 100%;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    border-left: 4px solid var(--primary-color, #0564d2);
    padding-left: 0.5rem;
    border-radius: 0;
  }

  .whmcs-menu li.sub-menu-open > ul.sub-menu,
  .whmcs-menu li.sub-menu-open > ul.children {
    display: block;
  }
}

@media (max-width: 768px) {
  .site-content-layout,
  .site-content-layout.has-sidebar {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    width: 100%;
  }

  .sidebar-area {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 100%;
  }

  .footer-widgets-grid {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 2rem;
    width: 100%;
  }

  .footer-col {
    text-align: center;
    width: 100%;
    max-width: 100%;
  }

  .footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
  }

  .footer-bottom {
    flex-direction: column !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0.85rem;
    width: 100%;
  }

  .footer-links-inline {
    justify-content: center !important;
    gap: 1rem;
    width: 100%;
  }

  .site-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .whmcs-header-inner {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .whmcs-header-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }
}

@media (max-width: 576px) {
  .globonex-theme-toggle-text {
    display: none;
  }
  .whmcs-action-btn {
    padding: 0.38rem 0.65rem;
    font-size: 0.78rem;
    min-height: 34px;
  }
  .whmcs-action-kb .whmcs-btn-text {
    display: none;
  }
  .whmcs-action-cart .whmcs-btn-text {
    display: none;
  }
  .site-card,
  .glass-card,
  article.post,
  article.page {
    padding: 1.5rem 1.2rem;
  }
}

/* Page Area Title Banner & Breadcrumbs */
.page-title-banner {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-left: 4px solid var(--primary-color) !important;
  border-radius: var(--radius-card, 12px);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-title, .entry-title {
  color: var(--headings-color);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.page-breadcrumbs {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.page-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.page-breadcrumbs a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.page-breadcrumbs .breadcrumb-separator {
  color: var(--text-muted);
  opacity: 0.6;
}

.page-breadcrumbs .breadcrumb-current {
  color: var(--primary-color);
  font-weight: 600;
}

