/**
 * Search panel overlay — desktop dropdown + mobile fullscreen.
 */

.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.search-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.search-panel {
  position: fixed;
  z-index: 1250;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.search-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-panel__inner {
  background: rgb(10, 13, 16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.search-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-panel__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #f2f2f2);
  margin: 0;
}

.search-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #f2f2f2);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-panel__close:hover {
  background: rgba(245, 173, 17, 0.2);
  color: var(--color-primary, #f5ad11);
}

.search-panel__form {
  display: flex;
  align-items: stretch;
  padding: 1rem;
  gap: 0;
}

.search-panel__input-wrap {
  display: flex;
  flex: 1;
  align-items: center;
  background: #0a0d10;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.search-panel__input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-primary, #f2f2f2);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  min-width: 0;
}

.search-panel__input::placeholder {
  color: rgba(242, 242, 242, 0.45);
}

.search-panel__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  border: none;
  border-left: 1.5px solid rgba(99, 99, 99, 0.25);
  background: rgba(99, 99, 99, 0.12);
  color: var(--text-primary, #f2f2f2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.search-panel__submit:hover {
  background: rgba(245, 173, 17, 0.15);
  color: var(--color-primary, #f5ad11);
}

.search-panel__submit .icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
}

/* Desktop: anchored near header search icon */
@media (min-width: 1025px) {
  .search-panel {
    top: calc(var(--header-height, 70px) + 8px);
    left: 1.5rem;
    width: min(420px, calc(100vw - 2rem));
    transform: translateY(-8px);
  }

  .search-panel.is-open {
    transform: translateY(0);
  }

  .left_side_header.search-panel-open .btn_search_header {
    color: var(--color-primary, #f5ad11);
  }
}

/* Mobile: fullscreen from top */
@media (max-width: 1024px) {
  .search-backdrop {
    z-index: 2100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .search-panel {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 2200;
    transform: translateY(-100%);
  }

  .search-panel.is-open {
    transform: translateY(0);
  }

  .search-panel__inner {
    border-radius: 0 0 20px 20px;
    border-top: none;
    background: #0b0e0f;
    border-color: rgba(255, 255, 255, 0.08);
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }

  .search-panel__header {
    padding: 1rem 1.25rem 0.5rem;
  }

  .search-panel__close {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.35rem;
    border-radius: 50%;
  }

  .search-panel__title {
    font-size: 1.05rem;
  }

  .search-panel__form {
    padding: 0.75rem 1.25rem 1.5rem;
  }

  body.search-panel-body-lock {
    overflow: hidden;
  }

  /* Force hide header search & subscribe buttons on mobile (bypasses Twig cache) */
  .left_side_header .left_btn_header:has(.link_pricing),
  .left_side_header .btn_search_header {
    display: none !important;
  }

  /* Green Subscription Button at the bottom of mobile hamburger menu */
  .mobile_menu_footer_btn {
    margin-top: auto;
    padding: 1.5rem 0 1rem;
    width: 100%;
    box-sizing: border-box;
  }

  .btn_menu_pricing_mobile {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: #22c55e !important; /* Premium Green */
    color: #fff !important;
    padding: 14px 20px !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-align: center !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .btn_menu_pricing_mobile:hover {
    background: #16a34a !important; /* Darker green on hover */
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4) !important;
  }

  .btn_menu_pricing_mobile i {
    font-size: 1.15rem !important;
    color: #fff !important;
  }
}

/* Hide legacy inline search in header */
.left_side_header .search_box_header_home {
  display: none !important;
}

.left_side_header.search-active .left_btn_header:not(.btn_search_header) {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
