/* Siembra Contigo - Custom Styles */

body.overflow-hidden {
  overflow: hidden;
}

/* Admin Bar & Banner Offset Handling */
#masthead {
  top: var(--admin-bar-height, 0px) !important;
  z-index: 1000;
}

#app-banner {
  position: relative;
  z-index: 1002; /* Above everything to hide menu origin */
  background-color: #005eb8; /* Primary Orange */
}

body.is-scrolled #app-banner {
  display: none !important;
}

#masthead.is-scrolled {
  top: var(--admin-bar-height, 0px) !important;
}

:root {
  --header-height: 72px;
  --admin-bar-height: 0px;
}

/* Admin Bar Offset */
.admin-bar #masthead {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar #masthead {
    top: 46px;
  }
}

/* Header & Logo */
.search-active #search-toggle {
  display: none;
}

.mobile-search-active #logo-wrapper {
  display: none;
}

/* Search Interactions */
.search-input-bg {
  background-color: #c9671e;
}

#search-container {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 0;
  opacity: 0;
  overflow: hidden;
}

.search-active #search-container {
  max-width: 500px;
  opacity: 1;
  margin-right: 1rem;
}

.search-card-offer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.hamburger-inner,
.hamburger-inner::after,
.hamburger-inner::before {
  background-color: #fff !important;
}

.is-scrolled .hamburger-inner,
.is-scrolled .hamburger-inner::after,
.is-scrolled .hamburger-inner::before {
  background-color: #000 !important;
}

/* Navigation Sliding */
#site-navigation {
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.5s ease;
}

@media (min-width: 1024px) {
  .search-active #site-navigation {
    opacity: 1;
    transform: none;
  }
}

/* Mobile Search Overlay */
@media (max-width: 1023px) {
  #search-container {
    position: absolute;
    inset: 0;
    max-width: none;
    width: 100%;
    z-index: 1000 !important; /* Above everything */
    background-color: #e87722; /* Match primary background */
    display: none;
    transform: none;
    pointer-events: none;
  }

  .search-active #search-container {
    display: flex !important;
    opacity: 1;
    margin-right: 0;
    pointer-events: auto;
  }
}

/* Mobile Menu Overlay */
@media (max-width: 1023px) {
  #mobile-menu-overlay {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    background: #e87722;
    color: #ffffff;
    z-index: 1100; /* Above sticky header */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-100%);
    visibility: hidden;
    pointer-events: none;
    height: 100dvh;
    padding-top: 0; /* Header handles padding */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #mobile-menu-overlay ::-webkit-scrollbar {
    width: 4px;
  }

  #mobile-menu-overlay ::-webkit-scrollbar-track {
    background: transparent;
  }

  #mobile-menu-overlay ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
  }

  #mobile-menu-overlay.is-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  /* Active State Highlight - Rounded & Darker */
  .is-current-page {
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.15); /* Darker orange effect */
    border-radius: 0.5rem;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  /* Remove old pseudo-element logic */
  .is-current-page::before {
    display: none;
  }

  /* Ensure the container clips the ultra-wide highlight */
  #mobile-menu-overlay {
    overflow-x: hidden;
  }

  /* Modern Grid Accordion Technique */
  .mobile-accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition:
      grid-template-rows 0.3s ease-out,
      opacity 0.3s ease-out,
      margin 0.3s ease-out;
    opacity: 0;
  }

  .mobile-accordion-item.is-active > .mobile-accordion-content,
  .mobile-accordion-content.is-initially-open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 0;
  }

  /* Inner wrapper needed for grid-template-rows trick */
  .mobile-accordion-content > ul {
    min-height: 0;
  }

  /* Premium Accordion Styling */
  .mobile-accordion-trigger {
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
  }

  .mobile-accordion-item.is-active > .mobile-accordion-trigger,
  .mobile-accordion-item.is-active > div > .mobile-accordion-trigger {
    color: #ffffff; /* Keep white on orange background */
  }

  .mobile-accordion-item.is-active > .mobile-accordion-trigger i,
  .mobile-accordion-item.is-active > div > .mobile-accordion-trigger i {
    transform: rotate(45deg);
    color: #ffffff; /* Keep white */
  }

  /* Indentation and Depth */
  .mobile-navigation ul ul li {
    margin-left: 1.5rem; /* Consistent indentation for all inner levels */
  }

  .mobile-accordion-item .mobile-accordion-trigger span {
    font-weight: 500;
  }

  .mobile-accordion-content a {
    font-size: 0.95em;
    font-weight: 400;
  }

  .mobile-navigation a {
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }

  .mobile-navigation a:active {
    opacity: 0.7;
    transform: scale(0.98);
  }

  .mobile-navigation italic {
    font-style: italic;
    font-size: 0.9em;
  }
}

/* Hide submenus on desktop by default */
#site-navigation .sub-menu {
  display: none !important;
}

.hamburger-inner,
.hamburger-inner:after,
.hamburger-inner:before {
  width: 35px;
}

/* Search Offers Overlay */
#search-offers-overlay {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 95; /* Above menu but below header */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: white;
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
}

#search-offers-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* .search-active #header-main-bar {
  border-bottom: 1px solid #eee;
} */

/* Category Slider Utilities */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ===== Rich Text (Prose) - Fix for Umbraco content ===== */
.prose {
  color: #374151 !important; /* gray-700 */
  line-height: 1.625;
}

.prose p {
  margin-bottom: 1rem !important;
}

.prose ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
  margin-top: 1rem !important;
  margin-bottom: 1.5rem !important;
  padding-left: 1.5rem !important;
  display: block !important;
}

.prose ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
  margin-top: 1rem !important;
  margin-bottom: 1.5rem !important;
  padding-left: 1.5rem !important;
  display: block !important;
}

.prose li {
  margin-bottom: 0.5rem !important;
  display: list-item !important;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-weight: 700 !important;
  color: #111827 !important; /* gray-900 */
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
  line-height: 1.25;
}

.prose h1 { font-size: 1.875rem !important; }
.prose h2 { font-size: 1.5rem !important; }
.prose h3 { font-size: 1.25rem !important; }
.prose h4 { font-size: 1.125rem !important; }

.prose strong {
  font-weight: 700 !important;
  color: #111827 !important;
}

.prose a {
  color: #e87722 !important; /* primary */
  text-decoration: underline !important;
}

.prose a:hover {
  color: #c9671e !important;
}

/* ===== Home Slider (Swiper) ===== */
.home-hero-swiper .swiper-pagination-bullet {
  background: white;
  opacity: 0.6;
  width: 10px;
  height: 10px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.home-hero-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  background: #e87722; /* Primary Orange */
  width: 28px;
  border-radius: 5px;
}

/* Premium Navigation Buttons - Hidden on Mobile */
.home-hero-swiper .swiper-button-next,
.home-hero-swiper .swiper-button-prev {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .home-hero-swiper .swiper-button-next,
  .home-hero-swiper .swiper-button-prev {
    display: flex;
    width: 54px;
    height: 54px;
  }
}

.home-hero-swiper .swiper-button-next:after,
.home-hero-swiper .swiper-button-prev:after {
  font-size: 16px;
  font-weight: 800;
}

@media (min-width: 768px) {
  .home-hero-swiper .swiper-button-next:after,
  .home-hero-swiper .swiper-button-prev:after {
    font-size: 20px;
  }
}

.home-hero-swiper .swiper-button-next:hover,
.home-hero-swiper .swiper-button-prev:hover {
  background: rgba(232, 119, 34, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: #e87722;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(232, 119, 34, 0.4);
}
