/**
 * Seaplast India Theme Header Stylesheet
 * Custom CSS for Header UI matching the dark oceanic theme and vibrant CTA.
 */

.sp-site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background-color: var(--sp-bg-dark);
  background: linear-gradient(180deg, #030D1B 0%, #06152B 100%);
  border-bottom: 1px solid var(--sp-border-dark);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

/* WordPress Admin Bar Sticky Header Offset */
body.admin-bar .sp-site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .sp-site-header {
    top: 46px;
  }
}

.sp-site-header.sp-header-scrolled {
  background: var(--sp-bg-dark-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.sp-header-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--sp-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* -------------------------------------------------------------
 * BRAND LOGO STYLING
 * ------------------------------------------------------------- */
.sp-brand-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sp-brand-logo .custom-logo,
.sp-brand-logo img {
  max-height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
}

.sp-logo-link {
  display: inline-block;
  text-decoration: none;
}

.sp-logo-wrapper {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.sp-logo-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: var(--sp-brand-teal);
  display: flex;
  align-items: flex-start;
  text-shadow: 0 0 20px var(--sp-brand-teal-glow);
}

.sp-logo-reg {
  font-size: 14px;
  font-weight: 700;
  margin-left: 2px;
  position: relative;
  top: 2px;
}

.sp-logo-subtext {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #FFFFFF;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.9;
}

/* -------------------------------------------------------------
 * PRIMARY NAVIGATION STYLING
 * ------------------------------------------------------------- */
.sp-primary-nav {
  display: flex;
  align-items: center;
  height: 100%;
}

.sp-nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 28px;
  height: 100%;
}

.sp-nav-menu > li {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.sp-nav-menu > li > a {
  color: var(--sp-text-light);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.sp-nav-menu > li > a:hover,
.sp-nav-menu > li:hover > a {
  color: var(--sp-brand-teal);
}

/* Dropdown Caret Icon */
.sp-caret,
.sp-nav-menu > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
  position: relative;
  top: -2px;
  transition: transform 0.25s ease;
}

.sp-nav-menu > li.menu-item-has-children:hover > a::after {
  transform: rotate(225deg);
  top: 2px;
}

/* -------------------------------------------------------------
 * SUBMENU / DROPDOWN STYLING
 * ------------------------------------------------------------- */
.sp-nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: -16px;
  min-width: 230px;
  background: #06172E;
  border: 1px solid rgba(0, 168, 198, 0.2);
  border-radius: 12px;
  padding: 10px 0;
  margin: 0;
  list-style: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.sp-nav-menu > li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sp-nav-menu .sub-menu li {
  width: 100%;
}

.sp-nav-menu .sub-menu a {
  display: block;
  padding: 10px 20px;
  color: #CBD5E1;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sp-nav-menu .sub-menu a:hover {
  background: rgba(0, 168, 198, 0.12);
  color: #FFFFFF;
  padding-left: 24px;
}

/* -------------------------------------------------------------
 * HEADER ACTIONS & REQUEST QUOTE BUTTON
 * ------------------------------------------------------------- */
.sp-header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* WooCommerce Cart Icon */
.sp-cart-button {
  position: relative;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.sp-cart-button:hover {
  background: rgba(0, 168, 198, 0.2);
  color: var(--sp-brand-teal);
}

.sp-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--sp-brand-orange-start);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Quote Button */
.sp-btn-quote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--sp-brand-orange-start) 0%, var(--sp-brand-orange-end) 100%);
  color: #FFFFFF !important;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(255, 107, 0, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.sp-btn-quote:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 0, 0.5);
  background: linear-gradient(135deg, #FF7700 0%, #FF9500 100%);
}

.sp-btn-quote .sp-btn-arrow {
  transition: transform 0.25s ease;
}

.sp-btn-quote:hover .sp-btn-arrow {
  transform: translateX(4px);
}

/* -------------------------------------------------------------
 * MOBILE HAMBURGER MENU TOGGLE
 * ------------------------------------------------------------- */
.sp-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10001;
}

.sp-hamburger-bar {
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Mobile Active Animation */
.sp-mobile-toggle.is-active .sp-hamburger-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.sp-mobile-toggle.is-active .sp-hamburger-bar:nth-child(2) {
  opacity: 0;
}

.sp-mobile-toggle.is-active .sp-hamburger-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* -------------------------------------------------------------
 * RESPONSIVE MEDIA QUERIES FOR MOBILE HEADER
 * ------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --sp-header-height: 72px;
  }

  .sp-header-container {
    padding: 0 20px;
    gap: 16px;
  }

  .sp-header-actions {
    gap: 12px;
  }

  .sp-btn-quote {
    padding: 9px 18px;
    font-size: 13px;
  }

  .sp-mobile-toggle {
    display: flex;
  }

  .sp-primary-nav {
    position: fixed;
    top: var(--sp-header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--sp-header-height));
    background: #030D1B;
    background: linear-gradient(180deg, #030D1B 0%, #06172E 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: stretch;
    padding: 24px 20px 40px 20px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  }

  /* Admin bar offset for mobile menu drawer */
  body.admin-bar .sp-primary-nav {
    top: calc(var(--sp-header-height) + 32px);
    height: calc(100vh - var(--sp-header-height) - 32px);
  }

  .sp-primary-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .sp-nav-menu {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    height: auto;
    gap: 8px;
  }

  .sp-nav-menu > li {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  .sp-nav-menu > li > a {
    width: 100%;
    justify-content: space-between;
    font-size: 17px;
    font-weight: 600;
    padding: 14px 12px;
    color: #F1F5F9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .sp-nav-menu > li > a:hover,
  .sp-nav-menu > li.is-open > a {
    background-color: rgba(0, 168, 198, 0.12);
    color: var(--sp-brand-teal);
  }

  /* Rotate submenu caret in mobile menu */
  .sp-nav-menu > li.menu-item-has-children.is-open > a::after {
    transform: rotate(225deg);
    top: 2px;
  }

  .sp-nav-menu .sub-menu {
    position: static;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin: 6px 0 10px 0;
    padding: 8px 0;
    display: none;
  }

  .sp-nav-menu > li.is-open > .sub-menu {
    display: block;
    animation: spFadeInDown 0.25s ease;
  }

  .sp-nav-menu .sub-menu a {
    font-size: 15px;
    padding: 10px 18px;
    color: #94A3B8;
  }

  .sp-nav-menu .sub-menu a:hover {
    color: #FFFFFF;
    background: rgba(0, 168, 198, 0.15);
    padding-left: 22px;
  }

  /* Mobile Drawer CTA Container */
  .sp-mobile-nav-cta {
    display: block;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
  }

  .sp-btn-quote-drawer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
  }
}

@media (max-width: 782px) {
  body.admin-bar .sp-primary-nav {
    top: calc(var(--sp-header-height) + 46px);
    height: calc(100vh - var(--sp-header-height) - 46px);
  }
}

@media (max-width: 640px) {
  :root {
    --sp-header-height: 66px;
  }

  .sp-header-container {
    padding: 0 16px;
    gap: 10px;
  }

  .sp-logo-text {
    font-size: 24px;
  }

  .sp-logo-subtext {
    font-size: 8.5px;
    letter-spacing: 2px;
  }

  .sp-btn-quote {
    padding: 9px 16px;
    font-size: 13px;
    gap: 6px;
  }

  .sp-btn-quote .sp-btn-arrow {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 440px) {
  .sp-header-actions .sp-btn-quote span {
    display: none;
  }

  .sp-header-actions .sp-btn-quote {
    padding: 10px;
    border-radius: 50%;
    min-width: 38px;
    height: 38px;
  }

  .sp-header-actions .sp-btn-quote .sp-btn-arrow {
    margin: 0;
  }
}

@keyframes spFadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
