/* ==========================================================================
   FAB & FRAME ADVANCED ENHANCEMENTS
   Mobile Header, Off-Canvas Drawer, Video Embeds & Social Buying
   ========================================================================== */

/* 1. GLASSMORPHIC & STICKY HEADER */
header, .navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 2. RESPONSIVE MOBILE NAVBAR (<= 768px) */
@media (max-width: 768px) {
  .navbar-container {
    display: grid !important;
    grid-template-columns: 44px 1fr auto !important;
    align-items: center !important;
    padding: 8px 14px !important;
    gap: 8px !important;
    width: 100% !important;
  }

  /* Hamburger Icon on Left */
  .mobile-menu-btn {
    grid-column: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.03) !important;
    border: none !important;
    cursor: pointer !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
  }
  .mobile-menu-btn:active {
    background: rgba(0, 0, 0, 0.08) !important;
    transform: scale(0.94);
  }

  /* Center Logo */
  .navbar-logo-wrapper {
    grid-column: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 0 auto !important;
    max-width: 100% !important;
  }
  .navbar-logo {
    max-height: 44px !important;
    height: 44px !important;
    width: auto !important;
    max-width: 180px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.05));
  }

  /* Right Action Icons */
  .navbar-icons {
    grid-column: 3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
  }

  /* Hide Desktop Admin Pill in Mobile Topbar to prevent clutter */
  .navbar-icons .admin-pill-btn {
    display: none !important;
  }

  .nav-icon-btn, .cart-btn {
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.03) !important;
    color: #1e293b !important;
    transition: all 0.2s ease !important;
  }

  /* Hide the legacy simple dropdown on mobile */
  .mobile-menu-dropdown {
    display: none !important;
  }
}

/* ==========================================================================
   3. MODERN OFF-CANVAS SLIDING DRAWER
   ========================================================================== */

/* Base & Desktop Rule: NEVER display drawer on screens wider than 768px */
#fab-mobile-drawer,
.fab-mobile-drawer,
#fab-drawer-backdrop,
.fab-drawer-backdrop {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Mobile Off-Canvas Sliding Drawer (<= 768px) */
@media (max-width: 768px) {
  #fab-drawer-backdrop,
  .fab-drawer-backdrop {
    display: block !important;
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    z-index: 99998 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
  }
  #fab-drawer-backdrop.active,
  .fab-drawer-backdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  #fab-mobile-drawer,
  .fab-mobile-drawer {
    display: flex !important;
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 310px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #ffffff !important;
    z-index: 99999 !important;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.2) !important;
    flex-direction: column !important;
    transform: translateX(-100%) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow-y: auto !important;
  }
  #fab-mobile-drawer.active,
  .fab-mobile-drawer.active {
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }

  .fab-drawer-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }
  .fab-drawer-close {
    background: #f8fafc !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #64748b !important;
    font-size: 18px !important;
    font-weight: 700 !important;
  }

  .fab-drawer-nav {
    display: flex !important;
    flex-direction: column !important;
    padding: 16px !important;
    gap: 6px !important;
    flex: 1 !important;
  }
  .fab-drawer-item {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    color: #1e293b !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
  }
  .fab-drawer-item:hover, .fab-drawer-item:active {
    background: #f8fafc !important;
    color: var(--color-primary, #af762a) !important;
    transform: translateX(4px) !important;
  }
  .fab-drawer-item i {
    font-size: 16px !important;
    width: 20px !important;
    color: var(--color-primary, #af762a) !important;
  }

  .fab-drawer-section-title {
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #94a3b8 !important;
    font-weight: 700 !important;
    padding: 12px 16px 4px 16px !important;
  }

  .fab-drawer-footer {
    padding: 20px !important;
    border-top: 1px solid #f1f5f9 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    background: #fafafa !important;
  }
}

/* 4. SOCIAL BUY BUTTONS ON PRODUCT PAGE */
.fab-social-buy-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 24px;
  width: 100%;
}

.fab-btn-whatsapp {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 16px 24px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.fab-btn-whatsapp:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4) !important;
  color: #ffffff !important;
}

.fab-btn-instagram {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 15px 24px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(220, 39, 67, 0.25) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.fab-btn-instagram:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(220, 39, 67, 0.35) !important;
  color: #ffffff !important;
}

/* 5. VIDEO EMBED ON PRODUCT PAGE */
.fab-product-video-wrapper {
  margin-top: 24px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #000000;
}
.fab-video-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.fab-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}
.fab-video-container.vertical-reel {
  padding-bottom: 125%; /* 4:5 or 9:16 for Reels & Shorts */
  max-width: 360px;
  margin: 0 auto;
}
.fab-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 6. ADMIN CATEGORIES MANAGER MODAL / UI */
.fab-admin-category-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}
.fab-admin-category-card:hover {
  border-color: var(--color-primary, #af762a);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
