/**
 * SSRINI HANDCRAFTS — 1:1 JURI JEWELRY MOBILE NAVIGATION & RESPONSIVE ENGINE
 * Modeled exactly after https://www.jurijewelry.com/rivulet mobile experience:
 * Minimal floating pill navbar with "Menu" / "Cart" text controls and full-screen editorial overlay.
 */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --juri-bg: #F3F7FA;
  --juri-dark: #2A2A2A;
  --juri-light: #939393;
  --juri-accent: #E082A8;
  --gold-primary: #C5A059;
}

/* ==========================================================================
   1. GLOBAL MOBILE STABILIZATION & IOS SAFARI FIXES
   ========================================================================== */
@media screen and (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    -webkit-text-size-adjust: 100%;
  }

  input, select, textarea, button {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   2. 1:1 JURI FLOATING PILL NAVBAR ON MOBILE (<= 860px)
   ========================================================================== */
@media screen and (min-width: 861px) {
  .juri-mobile-pill-bar,
  .juri-fullscreen-menu {
    display: none !important;
  }
}

.ssrini-mobile-burger-btn,
.ssrini-mobile-drawer,
.nav-menu-open-mobile {
  display: none !important;
}

@media screen and (max-width: 860px) {
  #main-navbar,
  .navbar {
    position: fixed !important;
    top: max(16px, env(safe-area-inset-top)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 32px) !important;
    max-width: 440px !important;
    height: 48px !important;
    min-height: 48px !important;
    background-color: rgba(243, 247, 250, 0.94) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(42, 42, 42, 0.08) !important;
    border-radius: 40px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06) !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    z-index: 10001 !important;
    box-sizing: border-box !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.loading #main-navbar,
  body.loading .navbar {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Inner container full width and clean alignment */
  #main-navbar .nav-container,
  .navbar .nav-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide raw desktop elements on mobile */
  #main-navbar > :not(.juri-mobile-pill-bar):not(.nav-container),
  .navbar > :not(.juri-mobile-pill-bar):not(.nav-container),
  #main-navbar .nav-container > :not(.juri-mobile-pill-bar),
  .navbar .nav-container > :not(.juri-mobile-pill-bar),
  #main-navbar .nav-menu,
  .navbar .nav-menu,
  #main-navbar .brand,
  .navbar .brand,
  .nav-actions {
    display: none !important;
  }

  /* Juri Mobile Pill Controls Bar */
  .juri-mobile-pill-bar {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Left: Juri "Menu" Button with Underline Selector */
  .juri-nav-btn-wrapper {
    position: relative;
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--juri-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
  }

  .juri-nav-btn-wrapper a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 2px 0;
    display: inline-block;
  }

  .juri-nav-btn-wrapper .selector {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 1.5px;
    background-color: var(--gold-primary);
    transition: width 0.3s ease;
  }

  .juri-nav-btn-wrapper.active .selector,
  .juri-nav-btn-wrapper:hover .selector {
    width: 100%;
  }

  /* Center: Brand Emblem */
  .juri-nav-center-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }

  .juri-nav-center-brand img {
    height: 24px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* Right: Juri "Cart (0)" Button with Underline Selector */
  .juri-nav-btn-wrapper.cart-wrapper a {
    color: var(--juri-dark);
    font-weight: 600;
  }
}

/* ==========================================================================
   3. 1:1 JURI FULL-SCREEN EDITORIAL MENU OVERLAY (.nav-menu-open-mobile)
   ========================================================================== */
.juri-fullscreen-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(243, 247, 250, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: max(100px, env(safe-area-inset-top) + 80px) 24px max(35px, env(safe-area-inset-bottom) + 20px) 24px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.juri-fullscreen-menu.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Center Large Editorial Typography Stack */
.juri-fullscreen-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  width: 100%;
  margin: auto 0;
}

.juri-fullscreen-link {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.1;
  color: #2A2A2A;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.juri-fullscreen-link:hover,
.juri-fullscreen-link.active {
  opacity: 0.6;
  transform: scale(1.03);
}

/* Collections Dropdown Wrapper */
.juri-collections-accordion {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.juri-collections-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.juri-collections-arrow {
  width: 12px;
  height: 12px;
  stroke: #2A2A2A;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.juri-collections-accordion.is-expanded .juri-collections-arrow {
  transform: rotate(180deg);
}

.juri-collections-sublist {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  width: 100%;
}

.juri-collections-accordion.is-expanded .juri-collections-sublist {
  display: flex;
  animation: juriSublistFade 0.3s ease forwards;
}

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

.juri-subcollection-link {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 17px;
  color: #777777;
  text-decoration: none;
  transition: color 0.25s ease;
  letter-spacing: 0.04em;
}

.juri-subcollection-link:hover {
  color: #111111;
}

/* Bottom Bar Contact Row */
.juri-fullscreen-bottom {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: #939393;
  padding: 0 10px;
}

.juri-fullscreen-bottom a {
  color: #939393;
  text-decoration: none;
  transition: color 0.25s ease;
}

.juri-fullscreen-bottom a:hover {
  color: #111111;
}

/* Body lock when menu is active */
body.juri-menu-open {
  overflow: hidden !important;
  touch-action: none !important;
}
