/* ============================================
   Warrior Wildlife — Custom Overrides
   Fixes for WP-to-static conversion issues
   ============================================ */

/* === Fix 1: Sticky Header === */
.elementor-location-header,
header[data-elementor-type="header"] {
  position: sticky !important;
  top: 0;
  z-index: 9999;
  width: 100% !important;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Override frozen inline position:fixed from WP capture */
.elementor-sticky,
.elementor-sticky--active {
  position: relative !important;
  width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  top: auto !important;
}

/* Hide the ghost spacer Elementor leaves behind */
.elementor-sticky__spacer {
  display: none !important;
}

/* === Fix 3: Navigation System === */

/* --- 3A: Desktop dropdowns (min-width: 1025px) --- */
@media (min-width: 1025px) {
  /* Hide hamburger and mobile dropdown on desktop */
  .elementor-menu-toggle {
    display: none !important;
  }
  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    display: none !important;
  }

  /* Desktop flyout submenus */
  .elementor-nav-menu--main .menu-item-has-children {
    position: relative;
  }
  .elementor-nav-menu--main .menu-item-has-children > .sub-menu {
    display: none !important;
    position: absolute !important;
    top: 100%;
    left: 0;
    background: #fff !important;
    min-width: 220px;
    width: max-content;
    max-width: 320px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14) !important;
    z-index: 10000 !important;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  .elementor-nav-menu--main .menu-item-has-children:hover > .sub-menu {
    display: block !important;
  }

  /* Nested flyout to the right */
  .elementor-nav-menu--main .sub-menu .menu-item-has-children > .sub-menu {
    position: absolute !important;
    top: 0 !important;
    left: 100% !important;
    background: #fff !important;
    z-index: 10001 !important;
  }

  /* Sub-menu item styling */
  .elementor-nav-menu--main .sub-menu li {
    display: block !important;
    width: 100%;
  }
  .elementor-nav-menu--main .sub-menu a {
    padding: 10px 20px !important;
    white-space: nowrap;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #222 !important;
    font-size: 14px;
  }
  .elementor-nav-menu--main .sub-menu .sub-arrow {
    display: inline-flex !important;
    align-items: center !important;
  }
  .elementor-nav-menu--main .sub-menu a:hover {
    background: #f5f5f5;
    color: #222 !important;
  }
}

/* --- 3B: Tablet/Mobile nav (max-width: 1024px) --- */
@media (max-width: 1024px) {
  /* Hide desktop nav, show hamburger */
  .elementor-nav-menu--main {
    display: none !important;
  }
  .elementor-menu-toggle {
    display: flex !important;
    z-index: 99999 !important;
    cursor: pointer;
  }

  /* Allow dropdown to escape narrow column */
  .elementor-location-header .elementor-column,
  .elementor-location-header .elementor-widget-wrap,
  .elementor-location-header .elementor-widget-container,
  .elementor-location-header .elementor-widget-nav-menu {
    overflow: visible !important;
  }

  /* Mobile dropdown container */
  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    display: none;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-height: calc(100vh - 80px) !important;
    height: auto !important;
    z-index: 99998 !important;
    background: #fff !important;
    overflow-y: auto !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
  }

  /* Show when hamburger is active */
  .elementor-menu-toggle.elementor-active + .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    display: block !important;
    max-height: calc(100vh - 80px) !important;
    transform: scaleY(1) !important;
    overflow-y: auto !important;
  }

  /* Mobile sub-menu accordion */
  .elementor-nav-menu--dropdown .menu-item-has-children > .sub-menu {
    display: none !important;
    position: static !important;
    box-shadow: none !important;
    background: transparent !important;
    padding-left: 15px !important;
  }
  .elementor-nav-menu--dropdown .menu-item-has-children.sub-menu-open > .sub-menu {
    display: block !important;
  }

  /* Stretch dropdown to full width */
  .elementor-nav-menu--stretch .elementor-nav-menu__container.elementor-nav-menu--dropdown {
    position: fixed !important;
    width: 100vw !important;
    left: 0 !important;
  }

  /* Mobile dropdown link styling */
  .elementor-nav-menu--dropdown a {
    padding: 12px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    color: #222 !important;
    border-bottom: 1px solid #f0f0f0;
    text-align: center !important;
  }

  .elementor-nav-menu--dropdown .sub-arrow {
    display: inline-flex !important;
    align-items: center !important;
  }
  .elementor-nav-menu--dropdown a:hover,
  .elementor-nav-menu--dropdown a.elementor-item-active {
    color: #222 !important;
    background: #fafafa;
  }
}

/* === Reviews Carousel — Un-freeze Swiper === */
.elementor-widget-reviews .elementor-swiper {
  position: relative;
  overflow: hidden;
}

.elementor-widget-reviews .elementor-main-swiper {
  overflow: hidden !important;
}

.elementor-widget-reviews .swiper-wrapper {
  display: flex !important;
  transition: transform 0.5s ease;
}

.elementor-widget-reviews .swiper-slide {
  display: block !important;
  flex-shrink: 0;
  opacity: 1 !important;
  visibility: visible !important;
  box-sizing: border-box;
}

/* Next/prev arrows — no background, no pagination */
.elementor-widget-reviews .elementor-swiper-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none !important;
  border: none !important;
  cursor: pointer;
  color: #222;
  font-size: 20px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  transition: color 0.2s;
}

.elementor-widget-reviews .elementor-swiper-button:hover {
  color: #C48B45;
}

.elementor-widget-reviews .elementor-swiper-button-prev {
  left: -5px;
}

.elementor-widget-reviews .elementor-swiper-button-next {
  right: -5px;
}

/* Hide pagination dots if any */
.elementor-widget-reviews .swiper-pagination {
  display: none !important;
}

/* Responsive slides per view */
@media (max-width: 1024px) {
  .elementor-widget-reviews .swiper-slide {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

@media (max-width: 767px) {
  .elementor-widget-reviews .swiper-slide {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* === Fix 7: Smooth Scroll === */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* === Srcset cleanup — prevent broken external image requests === */
img[srcset*="warriorwildlife.com"] {
  srcset: none;
}

/* ============================================
   Form-relay forms (replaces Gravity Forms)
   ============================================ */
.ww-form {
  display: block;
  width: 100%;
}

.ww-form .ww-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.ww-form .ww-form-row > .ww-form-field {
  flex: 1 1 calc(50% - 6px);
  min-width: 0;
}

.ww-form .ww-form-field--full {
  flex: 1 1 100%;
}

.ww-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--contrast, #222);
  margin-bottom: 6px;
}

.ww-form .ww-form-required {
  color: #c0392b;
  margin-left: 2px;
}

.ww-form input[type="text"],
.ww-form input[type="email"],
.ww-form input[type="tel"],
.ww-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--contrast, #222);
  background: #fff;
  border: 1px solid #d0d4d9;
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ww-form input[type="text"]:focus,
.ww-form input[type="email"]:focus,
.ww-form input[type="tel"]:focus,
.ww-form textarea:focus {
  outline: none;
  border-color: var(--accent, #1e73be);
  box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.15);
}

.ww-form textarea {
  min-height: 130px;
  resize: vertical;
}

.ww-form .ww-form-honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ww-form .ww-form-submit {
  display: inline-block;
  margin-top: 6px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
  background: var(--accent, #1e73be);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.ww-form .ww-form-submit:hover {
  background: #15568f;
}

.ww-form .ww-form-submit:active {
  transform: translateY(1px);
}

.ww-form .ww-form-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.ww-form-required-legend {
  font-size: 13px;
  color: #555;
  margin-bottom: 14px;
}

@media (max-width: 540px) {
  .ww-form .ww-form-row > .ww-form-field {
    flex: 1 1 100%;
  }
}

/* Short form sits on dark hero sections — force labels readable on dark */
.ww-form--short label {
  color: #fff;
}

.ww-form--short .ww-form-required {
  color: #ff6b6b;
}
