/* Advanced Features - Navbar, Sliders, Gallery */

/* Navbar Dropdowns */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown .nav-link::after {
  content: '▼';
  font-size: 0.625rem;
  margin-left: 0.5rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.nav-dropdown:hover .nav-link::after {
  opacity: 1;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-elevated);
  min-width: 220px;
  border: 1px solid var(--border-light);
  border-radius: 0;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 1000;
  margin-top: var(--spacing-sm);
}

/* Transparent hover bridge: fills the 8px gap between the nav link and the
   menu so moving the cursor down doesn't cross a dead zone and close it. */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--spacing-sm));
  left: 0;
  right: 0;
  height: var(--spacing-sm);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.2s;
  border-bottom: 1px solid var(--border-light);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: var(--bg-light);
  color: var(--accent-blue);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--spacing-sm);
  color: var(--text);
  flex-shrink: 0;
}

@media (max-width: 1120px) {
  .menu-toggle {
    display: block;
  }

  .logo img {
    width: 7.5rem;
  }

  .nav-desktop {
    display: none;
  }

  .nav-desktop.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    gap: 0;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: var(--spacing-md) var(--spacing-lg) !important;
    width: 100%;
    border-bottom: 1px solid var(--border-light);
  }

  .dropdown-menu {
    position: static;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: none;
    border: none;
    margin: 0;
    min-width: 0;
    background: var(--bg-elevated);
  }

  /* Expanded submenu options read as regular full-width nav rows,
     identical to the top-level links. */
  .dropdown-item {
    display: block;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 0.875rem;
    color: var(--text-light);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
  }

  .dropdown-item:hover {
    background: var(--bg-elevated);
    color: var(--primary);
  }

  .nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    max-height: 500px;
  }
}

/* Before/After Slider */
.before-after-slider {
  padding: var(--spacing-4xl) var(--spacing-lg);
  background-color: var(--bg-light);
}

.slider-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  gap: var(--spacing-2xl);
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

@media (max-width: 768px) {
  .slider-content {
    grid-template-columns: 1fr;
  }
}

.slider-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-3xl);
  background-color: var(--bg-light);
  aspect-ratio: 4 / 3;
  max-height: 380px;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}

.slider-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Stop the browser's native image-drag ghost (white flicker) while dragging */
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.slider-image.before {
  z-index: 1;
}

.slider-image.after {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: white;
  z-index: 3;
  transform: translateX(-2px);
  cursor: ew-resize;
}

/* Simple round knob with a small dot in the center */
.slider-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1.6rem;
  height: 1.6rem;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--primary);
}

.slider-text h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: var(--spacing-md);
  color: var(--text);
}

.slider-text p {
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-md);
}

.slider-button {
  display: inline-block;
  margin-top: var(--spacing-lg);
}

/* Gallery */
.gallery {
  padding: var(--spacing-4xl) var(--spacing-lg);
}

.gallery-content {
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-header {
  text-align: center;
  margin-bottom: var(--spacing-3xl);
}

.gallery-header h2 {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
  color: var(--text);
}

.gallery-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-light);
  line-height: var(--line-height-relaxed);
  font-size: 0.9375rem;
}

.gallery-grid {
  display: grid;
  gap: var(--spacing-2xl) var(--spacing-xl);
  grid-template-columns: repeat(2, 1fr);
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-lg);
  background: var(--bg-light);
  aspect-ratio: 4 / 3;
  max-height: 220px;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.gallery-item-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Stop the browser's native image-drag ghost (white flicker) while dragging */
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-item-before {
  z-index: 1;
}

.gallery-item-after {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}

.gallery-divider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: white;
  z-index: 3;
  transform: translateX(-1px);
}

.gallery-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 1.6rem;
  height: 1.6rem;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.2s, transform 0.3s;
}

.gallery-toggle::after {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--primary);
}

.gallery-item:hover .gallery-toggle {
  opacity: 1;
}

/* FAQ */
.faq {
  padding: var(--spacing-4xl) var(--spacing-lg);
  background-color: var(--bg-light);
}

.faq-content {
  max-width: 800px;
  margin: 0 auto;
}

.faq-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.faq-header h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: var(--spacing-md);
  color: var(--text);
}

.faq-item {
  margin-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--spacing-lg);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: var(--spacing-md);
  background-color: var(--bg-elevated);
  border-radius: var(--radius-lg);
  transition: background-color 0.2s;
  user-select: none;
}

.faq-question:hover {
  background-color: var(--bg-light);
}

.faq-question h3 {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.faq-toggle {
  font-size: 1.5rem;
  transition: transform 0.3s;
  color: var(--accent-blue);
}

.faq-item.active .faq-toggle {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s;
  color: var(--text-light);
  line-height: var(--line-height-relaxed);
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: var(--spacing-lg) var(--spacing-md);
}

/* Responsive improvements */
@media (max-width: 1024px) {
  .slider-content {
    grid-template-columns: 1fr;
  }

  .gallery-header h2 {
    font-size: 2rem;
  }
}
