/* Crystal Cleaning - Two-Panel Slide Mobile Menu */

/* Base overlay container */
#cc-mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  pointer-events: none;
}

#cc-mobile-menu-overlay[aria-hidden="false"] {
  display: block;
}

/* Backdrop */
#cc-mobile-menu-overlay .cc-mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 28, 0.55);
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 1;
  pointer-events: auto;
}

#cc-mobile-menu-overlay[aria-hidden="false"] .cc-mobile-menu-backdrop {
  opacity: 1;
}

/* Panel */
#cc-mobile-menu-overlay .cc-mobile-menu-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(-16px);
  opacity: 0;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 20px 40px rgba(16, 24, 40, 0.18);
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s ease;
  z-index: 2;
  height: 100dvh;
  overflow: hidden;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

#cc-mobile-menu-overlay[aria-hidden="false"] .cc-mobile-menu-panel {
  transform: translateY(0);
  opacity: 1;
}

/* Overlay header bar */
.cc-mobile-menu-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.cc-mobile-menu-logo img {
  height: 34px;
  width: auto;
  display: block;
}

.cc-mobile-menu-close {
  appearance: none;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  font-size: 28px;
  line-height: 1;
  padding: 8px 12px;
  margin-left: auto;
  display: block;
  cursor: pointer;
  border-radius: 8px;
}

.cc-mobile-menu-close:hover {
  background: rgba(0,0,0,0.6);
}

/* Overlay footer with Book Now button */
.cc-mobile-menu-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 16px 14px;
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.cc-mobile-book-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: #52ade5;
  color: #ffffff !important;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(82, 173, 229, 0.3);
}

.cc-mobile-book-btn:hover {
  background: #3d9cd6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(82, 173, 229, 0.4);
}

/* Prevent body scroll when open */
html.cc-mobile-open, body.cc-mobile-open {
  overflow: hidden;
}

/* Custom mobile toggle button */
.cc-mobile-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  cursor: pointer;
}

.cc-mobile-toggle .cc-mobile-toggle-bars {
  width: 20px;
  height: 2px;
  background: #52ade5;
  position: relative;
  display: inline-block;
}

.cc-mobile-toggle .cc-mobile-toggle-bars::before,
.cc-mobile-toggle .cc-mobile-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #52ade5;
}

/* White hamburger for homepage (dark mode) */
.page-template-template-homepage .cc-mobile-toggle .cc-mobile-toggle-bars,
.page-template-template-homepage .cc-mobile-toggle .cc-mobile-toggle-bars::before,
.page-template-template-homepage .cc-mobile-toggle .cc-mobile-toggle-bars::after {
  background: #ffffff;
}

.cc-mobile-toggle .cc-mobile-toggle-bars::before {
  top: -6px;
}

.cc-mobile-toggle .cc-mobile-toggle-bars::after {
  top: 6px;
}

.cc-mobile-toggle .cc-mobile-toggle-label {
  font-weight: 600;
  color: #0f172a;
  font-size: 14px;
}

/* Desktop: hide custom toggle and overlay */
@media (min-width: 1121px) {
  .cc-mobile-toggle {
    display: none !important;
  }
  #cc-mobile-menu-overlay {
    display: none !important;
  }
}

/* Mobile-only visibility rules */
@media (max-width: 1120px) {
  /* Hide default GP nav and duplicate toggle */
  .main-navigation {
    display: none !important;
  }
  .main-navigation.toggled {
    display: none !important;
  }
  .main-navigation .menu-toggle {
    display: none !important;
  }

  /* Use custom toggle, hide GP's wrapper to avoid duplicates */
  .cc-mobile-toggle {
    display: inline-flex !important;
  }
  .mobile-menu-control-wrapper {
    display: none !important;
  }
}

/* Container for two-panel layout */
#cc-mobile-menu-overlay .cc-mobile-menu-nav {
  position: relative;
  overflow: hidden;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Hide original WordPress menu structure if panels exist */
#cc-mobile-menu-overlay .cc-mobile-menu-nav:has(.cc-mobile-menu-panels) > ul,
#cc-mobile-menu-overlay .cc-mobile-menu-nav:has(.cc-mobile-menu-panels) > #menu-menu-2 {
  display: none !important;
}

/* Hide submenus in original structure */
#cc-mobile-menu-overlay .sub-menu {
  display: none !important;
}

.cc-mobile-menu-panels {
  display: flex;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 200%;
  flex: 1;
}

.cc-mobile-menu-panels.show-submenu {
  transform: translateX(-50%);
}

/* Main panel and submenu panel */
.cc-menu-panel {
  width: 50%;
  flex-shrink: 0;
  padding: 8px 0;
  height: 100%;
  overflow-y: auto;
}

.cc-main-panel {
  padding-right: 8px;
}

.cc-submenu-panel {
  padding-left: 8px;
  border-left: 1px solid rgba(0,0,0,0.06);
}

/* Back button in submenu panel */
.cc-submenu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 8px;
}

.cc-back-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.cc-back-btn:hover {
  background: transparent;
}

.cc-back-arrow {
  display: block;
  width: 10px;
  height: 10px;
  border-left: 2.5px solid #52ade5;
  border-bottom: 2.5px solid #52ade5;
  transform: rotate(45deg);
}

.cc-submenu-title {
  font-weight: 700;
  font-size: 16px;
  color: #0f172a;
}

/* Menu lists */
.cc-mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0 12px;
}

.cc-mobile-menu-list > li {
  opacity: 0;
  animation: ccFadeIn 0.24s ease forwards;
}

.cc-mobile-menu-list > li:nth-child(1) { animation-delay: 0.04s; }
.cc-mobile-menu-list > li:nth-child(2) { animation-delay: 0.08s; }
.cc-mobile-menu-list > li:nth-child(3) { animation-delay: 0.12s; }
.cc-mobile-menu-list > li:nth-child(4) { animation-delay: 0.16s; }
.cc-mobile-menu-list > li:nth-child(5) { animation-delay: 0.20s; }
.cc-mobile-menu-list > li:nth-child(6) { animation-delay: 0.24s; }
.cc-mobile-menu-list > li:nth-child(7) { animation-delay: 0.28s; }
.cc-mobile-menu-list > li:nth-child(8) { animation-delay: 0.32s; }

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

/* Menu item wrapper for parent items with submenu */
.cc-menu-item-wrapper {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.cc-mobile-menu-list > li:last-child .cc-menu-item-wrapper {
  border-bottom: 0;
}

/* Menu item links */
.cc-menu-item-link {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  background: transparent;
  flex: 1;
  min-height: 48px;
}

/* Parent link with submenu (3/4 width) */
.cc-menu-item-link.cc-has-submenu {
  flex: 3;
}

.cc-menu-item-link:hover {
  background-color: transparent;
}

/* Regular links without wrapper */
.cc-mobile-menu-list > li > .cc-menu-item-link {
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.cc-mobile-menu-list > li:last-child > .cc-menu-item-link {
  border-bottom: 0;
}

/* Arrow button for opening submenu (1/4 width) */
.cc-submenu-arrow-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 60px;
  transition: background-color 0.2s ease;
  border-left: 1px solid rgba(0,0,0,0.06);
}

.cc-submenu-arrow-btn:hover {
  background-color: transparent;
}

.cc-submenu-arrow-btn:active {
  background-color: transparent;
}

/* Arrow for parent items */
.cc-menu-arrow {
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2.5px solid #52ade5;
  border-bottom: 2.5px solid #52ade5;
  transform: rotate(-45deg);
  flex-shrink: 0;
}

/* Submenu list items */
.cc-submenu-items {
  list-style: none;
  margin: 0;
  padding: 0 12px;
}

.cc-submenu-items li {
  margin: 0;
}

.cc-submenu-items a {
  display: block;
  padding: 12px 12px;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}

.cc-submenu-items li:last-child a {
  border-bottom: 0;
}

.cc-submenu-items a:hover {
  background-color: transparent;
  padding-left: 16px;
}
