/**
 * Veroc Web - Header & Footer Styles
 * Elementor Compatible | Mobile-First Responsive
 * 
 * Business Info:
 * - Address: 18 Esther Cres, Welland, Ontario, Canada
 * - Phone: 905-414-9484
 * 
 * @package Veroc_Web
 * @version 3.0
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --navy: #0f172a;
  --cyan: #06b6d4;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --header-mobile: 60px;
  --header-desktop-top: 40px;
  --header-desktop-main: 80px;
  --header-desktop-total: 120px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  --radius: 8px;
  --radius-lg: 12px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   BASE STYLES
   ======================================== */
html {
  scroll-behavior: smooth;
}

body.veroc-header-footer {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   MOBILE HEADER (Default)
   ======================================== */
.veroc-desktop-header {
  display: none;
}

.veroc-mobile-header {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--white);
  box-shadow: var(--shadow-md);
  height: var(--header-mobile);
}

.mobile-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
  max-width: 100%;
}

.mobile-logo {
  display: flex;
  align-items: center;
}

.mobile-logo .custom-logo {
  max-height: 40px;
  width: auto;
}

.mobile-site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-cart-btn {
  position: relative;
  padding: 8px;
  color: var(--gray-600);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--primary);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hamburger Button */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  gap: 5px;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 380px;
  height: 100vh;
  background: var(--white);
  z-index: 10000;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-nav-drawer.active {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  position: sticky;
  top: 0;
  z-index: 10;
}

.drawer-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.drawer-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.drawer-content {
  padding: 20px;
}

.mobile-primary-menu {
  list-style: none;
  margin: 0 0 24px 0;
  padding: 0;
}

.mobile-primary-menu li {
  border-bottom: 1px solid var(--gray-100);
}

.mobile-primary-menu a {
  display: block;
  padding: 16px 0;
  color: var(--gray-800);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 500;
  transition: color 0.2s;
}

.mobile-primary-menu a:hover {
  color: var(--primary);
}

.drawer-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.drawer-section-title {
  margin: 0 0 12px 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  font-weight: 600;
}

.drawer-service-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.drawer-service-list li {
  margin-bottom: 10px;
}

.drawer-service-list a {
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-service-list a::before {
  content: "→";
  color: var(--primary);
  font-weight: 600;
}

.drawer-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-full {
  width: 100%;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

body.menu-open {
  overflow: hidden;
}

.veroc-header-footer .site {
  padding-top: var(--header-mobile);
}

/* ========================================
   DESKTOP HEADER (768px+)
   ======================================== */
@media (min-width: 768px) {
  .veroc-mobile-header {
    display: none;
  }

  .veroc-desktop-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--white);
    box-shadow: var(--shadow-md);
  }

  .veroc-header-footer .site {
    padding-top: var(--header-desktop-total);
  }

  .header-top-bar {
    background: var(--navy);
    color: var(--white);
    height: var(--header-desktop-top);
  }

  .header-top-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
  }

  .top-bar-left {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  .top-bar-link,
  .top-bar-text {
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .top-bar-link:hover {
    color: var(--white);
  }

  .top-bar-link .dashicons,
  .top-bar-text .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--cyan);
  }

  .top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .header-main {
    height: var(--header-desktop-main);
    background: var(--white);
  }

  .header-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
  }

  .header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .header-logo .custom-logo {
    max-height: 50px;
    width: auto;
  }

  .site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
  }

  .site-tagline {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--gray-500);
  }

  .header-navigation {
    position: relative;
  }

  .primary-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
  }

  .primary-menu li {
    position: relative;
  }

  .menu-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
  }

  .menu-link:hover,
  .primary-menu .current-menu-item .menu-link {
    color: var(--primary);
    background: var(--gray-50);
  }

  .mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 32px;
    min-width: 700px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    margin-top: 20px;
  }

  .menu-item-has-children:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  .mega-menu-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .mega-title {
    margin: 0 0 16px 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    font-weight: 600;
  }

  .mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mega-list li {
    margin-bottom: 10px;
  }

  .mega-list a {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
  }

  .mega-list a:hover {
    color: var(--primary);
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .header-cart {
    position: relative;
    padding: 10px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
  }

  .header-cart:hover {
    background: var(--gray-100);
    color: var(--primary);
  }

  .header-cart .cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
  }

  .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
  }
}

/* ========================================
   MOBILE FOOTER (Default)
   ======================================== */
.veroc-desktop-footer {
  display: none;
}

.veroc-mobile-footer {
  display: block;
  background: var(--navy);
  color: var(--gray-300);
  padding: 40px 0 20px;
}

.veroc-mobile-footer .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.mobile-footer-contact {
  text-align: center;
  margin-bottom: 32px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
}

.footer-brand-name {
  color: var(--white);
  font-size: 1.5rem;
  margin: 0 0 8px 0;
}

.footer-tagline {
  color: var(--gray-400);
  font-size: 0.9375rem;
  margin: 0 0 20px 0;
}

.footer-phone-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 12px;
}

.footer-email-link {
  display: block;
  color: var(--cyan);
  text-decoration: none;
  font-size: 1rem;
  margin-bottom: 12px;
}

.footer-address {
  color: var(--gray-400);
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1.6;
}

.footer-accordion {
  margin-bottom: 32px;
}

.footer-accordion-item {
  border-bottom: 1px solid var(--gray-700);
}

.footer-accordion-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
}

.footer-accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-icon {
  width: 20px;
  height: 20px;
  position: relative;
}

.accordion-icon::before,
.accordion-icon::after {
  content: '';
  position: absolute;
  background: var(--gray-400);
  transition: transform 0.2s;
}

.accordion-icon::before {
  width: 12px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.accordion-icon::after {
  width: 2px;
  height: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.footer-accordion-item[open] .accordion-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.accordion-content {
  list-style: none;
  margin: 0;
  padding: 0 0 16px 0;
}

.accordion-content li {
  margin-bottom: 10px;
}

.accordion-content a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.9375rem;
}

.accordion-content a:hover {
  color: var(--white);
}

.mobile-footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.social-link {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-decoration: none;
  transition: all 0.2s;
}

.social-link:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

.mobile-footer-legal {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.mobile-footer-legal a {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.875rem;
}

.mobile-footer-copyright {
  text-align: center;
}

.mobile-footer-copyright p {
  color: var(--gray-500);
  font-size: 0.8125rem;
  margin: 0;
}

/* ========================================
   DESKTOP FOOTER (768px+)
   ======================================== */
@media (min-width: 768px) {
  .veroc-mobile-footer {
    display: none;
  }

  .veroc-desktop-footer {
    display: block;
    background: var(--navy);
    color: var(--gray-300);
    padding: 64px 0 32px;
  }

  .veroc-desktop-footer .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
  }

  .footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
  }

  .footer-brand-col {
    padding-right: 32px;
  }

  .footer-logo .custom-logo {
    max-height: 50px;
    width: auto;
    margin-bottom: 16px;
  }

  .footer-site-title {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0 0 16px 0;
  }

  .footer-description {
    color: var(--gray-400);
    margin-bottom: 20px;
    line-height: 1.6;
  }

  .footer-contact {
    margin-bottom: 24px;
  }

  .footer-contact p {
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .footer-contact a {
    color: var(--gray-300);
    text-decoration: none;
  }

  .footer-contact a:hover {
    color: var(--white);
  }

  .footer-contact .dashicons {
    color: var(--cyan);
    font-size: 16px;
    width: 16px;
    height: 16px;
  }

  .footer-social {
    display: flex;
    gap: 12px;
  }

  .footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: all 0.2s;
  }

  .footer-social a:hover {
    background: var(--primary);
    transform: translateY(-2px);
  }

  .footer-column-title {
    color: var(--white);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 20px 0;
    font-weight: 600;
  }

  .footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .footer-menu li {
    margin-bottom: 12px;
  }

  .footer-menu a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
  }

  .footer-menu a:hover {
    color: var(--white);
  }

  .footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .copyright {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin: 0;
  }

  .footer-legal-links {
    display: flex;
    gap: 24px;
  }

  .footer-legal-links a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.875rem;
  }

  .footer-legal-links a:hover {
    color: var(--white);
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .mobile-nav-drawer,
  .mobile-overlay,
  .hamburger,
  .mega-menu {
    transition: none;
  }
}

/* ========================================
   ELEMENTOR COMPATIBILITY
   ======================================== */
/* Hide default header/footer when Elementor Pro is active */
.elementor-location-header ~ #mobile-header,
.elementor-location-header ~ #desktop-header {
  display: none !important;
}

.elementor-location-footer ~ #mobile-footer,
.elementor-location-footer ~ #desktop-footer {
  display: none !important;
}

/* Ensure proper spacing when using Elementor */
body.elementor-page .veroc-header-footer .site {
  padding-top: 0;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .veroc-mobile-header,
  .veroc-desktop-header,
  .veroc-mobile-footer,
  .veroc-desktop-footer {
    display: none !important;
  }

  body.veroc-header-footer .site {
    padding-top: 0 !important;
  }
}

/* ========================================
   WOOCOMMERCE INTEGRATION
   ======================================== */
.woocommerce-cart .header-cart,
.woocommerce-checkout .header-cart {
  color: var(--primary);
}

/* ========================================
   ADMIN BAR COMPATIBILITY
   ======================================== */
body.admin-bar .veroc-mobile-header {
  top: 46px;
}

body.admin-bar .veroc-desktop-header {
  top: 46px;
}

body.admin-bar .veroc-header-footer .site {
  padding-top: calc(var(--header-mobile) + 46px);
}

@media (min-width: 783px) {
  body.admin-bar .veroc-mobile-header,
  body.admin-bar .veroc-desktop-header {
    top: 32px;
  }

  body.admin-bar .veroc-header-footer .site {
    padding-top: calc(var(--header-desktop-total) + 32px);
  }
}

/* ========================================
   STICKY HEADER ON SCROLL
   ======================================== */
.veroc-desktop-header.scrolled .header-main {
  box-shadow: var(--shadow-lg);
}

.veroc-desktop-header.scrolled .header-top-bar {
  height: 0;
  overflow: hidden;
  opacity: 0;
}


/* ========================================
   HIDE DEFAULT PAGE TITLES
   ======================================== */

/* Hide entry title and page headers */
.entry-title,
.page-title,
h1.entry-title,
.wp-block-post-title,
.post-title,
.page-header,
.entry-header,
.archive-header {
  display: none !important;
}

/* Remove spacing from hidden headers */
.page-header + *,
.entry-header + *,
.archive-header + *,
.entry-title + *,
.page-title + * {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Ensure content starts at top */
.site-content {
  padding-top: 0 !important;
}

/* Remove any default padding from main content area */
#primary,
#main,
.content-area,
.site-main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Specifically target the white background section before hero */
.page .entry-content > *:first-child:not(.hero):not(.wp-block-cover):not(.wp-block-group),
.single .entry-content > *:first-child:not(.hero):not(.wp-block-cover):not(.wp-block-group) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Hide any h1 that appears right after header (the white title section) */
.veroc-header-footer .site-content > h1:first-of-type,
.veroc-header-footer #primary > h1:first-of-type,
.veroc-header-footer main > h1:first-of-type,
.veroc-header-footer .entry-content > h1:first-of-type {
  display: none !important;
}