/**
 * INSTALIIO MEGA MENU HEADER — ELEMENTOR ADDON
 * Version: 1.0.3
 * 100% Exact Glassmorphism Pill, Customizable Logo,
 * Smooth 60fps Mobile Drawer & Accordions, Percentage Widths (Strictly NO vw)
 */

:root {
  --kp-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --kp-font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif;
  --kp-primary-blue: #0171FB;
  --kp-primary-accent: #2AA0FA;
  --kp-primary-core: #035BFC;
  --kp-primary-dark: #022ECD;
  --kp-cyan: #0D99FF;
  --kp-purple: #8B5CF6;
  --kp-pink: #F472B6;
  --kp-text-dark: #0F172A;
  --kp-text-muted: #64748B;
  --kp-bg-pill: rgba(255, 255, 255, 0.92);
}

/* Base resets for widget container */
.khatapro-header-container,
.instaliio-header-container {
  font-family: var(--kp-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
  width: 100%;
  position: relative;
  z-index: 99999;
}

.khatapro-header-container *,
.khatapro-header-container *::before,
.khatapro-header-container *::after,
.instaliio-header-container *,
.instaliio-header-container *::before,
.instaliio-header-container *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   1. TOP ANNOUNCEMENT BAR
   ========================================================================== */
.kp-announcement-bar {
  background: linear-gradient(90deg, #0F172A 0%, #1E1B4B 50%, #0F172A 100%);
  color: #FFFFFF;
  font-size: 0.82rem;
  padding: 9px 16px;
  position: relative;
  z-index: 10001;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.kp-announcement-container {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  padding: 0 35px;
}

.kp-announcement-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #38BDF8;
  text-transform: uppercase;
  flex-shrink: 0;
}

.kp-announcement-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 8px #38BDF8;
  animation: kp-pulse-dot 2s infinite ease-in-out;
}

@keyframes kp-pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.kp-announcement-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  text-align: center;
  flex-wrap: wrap;
  justify-content: center;
  line-height: 1.4;
}

.kp-announcement-link {
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
  margin-left: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.kp-announcement-link:hover {
  color: #38BDF8;
}

.kp-announcement-close-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  border-radius: 4px;
}

.kp-announcement-close-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   2. FLOATING NAVBAR WRAPPER & PILL
   ========================================================================== */
.kp-navbar-wrapper {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  pointer-events: none;
  transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

body.kp-no-announcement .kp-navbar-wrapper,
.kp-announcement-bar.is-hidden + .kp-navbar-wrapper {
  top: 16px;
}

/* Elementor editor preview */
.elementor-editor-active .kp-navbar-wrapper {
  position: relative !important;
  top: 0 !important;
  pointer-events: auto !important;
}

.kp-navbar-pill {
  pointer-events: auto;
  width: 100%;
  max-width: 1360px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 18px;
  border: 1.5px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.93)),
    linear-gradient(135deg, #2AA0FA 0%, #0171FB 50%, #818CF8 100%);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 0 25px -5px rgba(1, 113, 251, 0.2);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
}

.kp-navbar-pill.scrolled {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.96)),
    linear-gradient(135deg, #2AA0FA 0%, #0171FB 50%, #818CF8 100%);
  box-shadow: 0 14px 38px -5px rgba(15, 23, 42, 0.12), 0 0 30px -5px rgba(1, 113, 251, 0.25);
}

/* NAVBAR TOP ROW */
.kp-navbar-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  min-height: 56px;
  width: 100%;
}

/* BRAND LOGO */
.kp-nav-brand-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
}

.kp-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.kp-custom-logo-img {
  width: auto;
  max-height: 36px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.kp-brand-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(180deg, #2AA0FA 0%, #0171FB 50%, #022ECD 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(1, 113, 251, 0.35);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.kp-nav-brand:hover .kp-brand-logo-icon,
.kp-nav-brand:hover .kp-custom-logo-img {
  transform: scale(1.04);
}

.kp-brand-title {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0F172A;
  white-space: nowrap;
}

.kp-brand-title span {
  color: #0171FB;
}

.kp-nav-brand-divider {
  width: 1px;
  height: 22px;
  background: rgba(15, 23, 42, 0.12);
  margin-left: 20px;
  flex-shrink: 0;
}

/* CENTER NAV MENU (DESKTOP) */
.kp-nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 4px;
}

.kp-nav-item {
  position: relative;
}

.kp-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.91rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.kp-nav-chevron {
  transition: transform 0.25s ease;
}

.kp-nav-item.has-mega:hover .kp-nav-chevron,
.kp-nav-item.has-mega.active .kp-nav-chevron {
  transform: rotate(180deg);
}

.kp-nav-item:hover .kp-nav-link,
.kp-nav-item.active .kp-nav-link {
  background: rgba(1, 113, 251, 0.08);
  color: #0171FB;
}

/* RIGHT ACTIONS */
.kp-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.kp-lang-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
  background: rgba(15, 23, 42, 0.04);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.kp-lang-pill:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #0F172A;
}

.kp-btn-nav-secondary {
  padding: 7px 18px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 600;
  color: #0F172A;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.16);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.kp-btn-nav-secondary:hover {
  background: #F8FAFC;
  border-color: rgba(15, 23, 42, 0.3);
  transform: translateY(-1px);
}

.kp-btn-nav-primary {
  padding: 7px 18px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #2AA0FA 0%, #0171FB 55%, #0146EB 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(1, 113, 251, 0.35);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.kp-btn-nav-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(1, 113, 251, 0.5);
  color: #FFFFFF !important;
}

/* ==========================================================================
   3. MOBILE TOGGLE (HAMBURGER BUTTON)
   ========================================================================== */
.kp-btn-mobile-toggle {
  display: none;
  background: rgba(15, 23, 42, 0.05);
  border: none;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #0F172A;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}

.kp-btn-mobile-toggle:hover,
.kp-btn-mobile-toggle:active {
  background: rgba(1, 113, 251, 0.12);
  color: #0171FB;
}

.kp-btn-mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.25s ease;
  position: relative;
}

.kp-btn-mobile-toggle span::before,
.kp-btn-mobile-toggle span::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.25s ease;
}

.kp-btn-mobile-toggle span::before {
  top: -6px;
  left: 0;
}

.kp-btn-mobile-toggle span::after {
  top: 6px;
  left: 0;
}

.kp-btn-mobile-toggle.active {
  background: rgba(1, 113, 251, 0.12);
  color: #0171FB;
}

.kp-btn-mobile-toggle.active span {
  background: transparent;
}

.kp-btn-mobile-toggle.active span::before {
  top: 0;
  transform: rotate(45deg);
}

.kp-btn-mobile-toggle.active span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ==========================================================================
   4. DESKTOP MEGA DROPDOWN (PERCENTAGE & SITE CONTAINER, NO VW)
   ========================================================================== */
.kp-navbar-mega-dropdown {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease, visibility 0.28s;
  overflow: hidden;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.kp-navbar-pill.is-expanded .kp-navbar-mega-dropdown,
.kp-navbar-pill:hover:has(.has-mega:hover) .kp-navbar-mega-dropdown {
  max-height: 750px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  overflow-y: auto;
}

.kp-mega-pane {
  display: none;
  position: relative;
  width: 100%;
  max-width: 100%;
}

.kp-mega-pane.active {
  display: block;
  animation: kpMegaPaneFade 0.25s ease forwards;
}

@keyframes kpMegaPaneFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* DYNAMIC ELEMENTOR DRAG & DROP TEMPLATE CONTAINER */
.kp-mega-elementor-template-wrap {
  width: 100%;
  max-width: 100%;
  position: relative;
  padding: 18px 24px;
}

.kp-mega-elementor-template-wrap .elementor {
  width: 100%;
  max-width: 100%;
}

.kp-mega-elementor-template-wrap .e-con,
.kp-mega-elementor-template-wrap .elementor-container {
  max-width: 100%;
}

/* TEMPLATE PLACEHOLDER */
.kp-mega-template-placeholder {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(1, 113, 251, 0.04);
  border: 1.5px dashed rgba(1, 113, 251, 0.35);
  border-radius: 14px;
  padding: 24px 30px;
  margin: 10px;
  color: #1E293B;
}

.kp-mtp-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.kp-mtp-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #0171FB;
  margin-bottom: 4px;
}

.kp-mtp-content p {
  font-size: 0.84rem;
  color: #64748B;
  line-height: 1.45;
  margin: 0;
}

/* 3-COLUMN MODERN LUXURY GRID (BUILT-IN PRESETS) */
.kp-mega-menu-grid-3col {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.1fr;
  gap: 28px;
  padding: 24px 32px 22px;
  align-items: start;
  width: 100%;
}

.kp-mega-col-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94A3B8;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}

/* FEATURED CARD */
.kp-mega-featured-card {
  display: block;
  background: linear-gradient(135deg, #2AA0FA 0%, #0171FB 50%, #0146EB 100%);
  border-radius: 16px;
  padding: 16px 18px;
  color: #FFFFFF !important;
  text-decoration: none;
  margin-bottom: 14px;
  box-shadow: 0 10px 25px -5px rgba(1, 113, 251, 0.35);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.kp-mega-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -4px rgba(1, 113, 251, 0.45);
}

.kp-mfc-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kp-mfc-badge {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  text-transform: uppercase;
}

.kp-mfc-arrow {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  transition: transform 0.2s ease;
}

.kp-mega-featured-card:hover .kp-mfc-arrow {
  transform: translateX(4px);
}

.kp-mfc-title {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 4px;
  color: #FFFFFF !important;
}

.kp-mfc-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
}

/* PRODUCTS / LINKS LIST */
.kp-mega-products-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kp-mega-products-list-spaced {
  gap: 8px;
  margin-top: 10px;
}

.kp-mega-item-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.kp-mega-item-link:hover {
  background: #F8FAFC;
  transform: translateX(3px);
}

.kp-mil-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 2px;
  display: block;
}

.kp-mil-desc {
  font-size: 0.74rem;
  color: #64748B;
  line-height: 1.35;
  display: block;
}

.kp-mega-item-link:hover .kp-mil-title {
  color: #0171FB;
}

/* RIGHT VISUAL PREVIEW FRAME */
.kp-mega-visual-frame {
  background: #F8FAFC;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kp-mvf-preview {
  height: 140px;
  background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 60%, #035BFC 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.kp-mvf-preview-usecases {
  background: linear-gradient(135deg, #022ECD 0%, #0171FB 50%, #2AA0FA 100%);
}

.kp-mvf-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.kp-mvf-chip-title {
  font-size: 8px;
  font-weight: 800;
  color: #38BDF8;
  letter-spacing: 0.04em;
}

.kp-mvf-chip-sub {
  font-size: 7px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.kp-mvf-badge-center {
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  color: #0F172A;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kp-mvf-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}

.kp-mvf-footer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0F172A;
  text-decoration: none;
  background: #FFFFFF;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
}

.kp-mvf-footer-link:hover {
  background: #F1F5F9;
  color: #0171FB;
}

/* BOTTOM FEATURED BANNER */
.kp-mega-bottom-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding: 12px 32px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.kp-mega-bottom-banner:hover {
  background: #F1F5F9;
}

.kp-mbb-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kp-mbb-pill {
  font-size: 9px;
  font-weight: 800;
  background: rgba(1, 113, 251, 0.12);
  color: #0171FB;
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

.kp-mbb-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0F172A;
}

.kp-mbb-desc {
  font-size: 0.78rem;
  color: #64748B;
}

.kp-mbb-right {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0171FB;
}

/* ==========================================================================
   5. MOBILE MENU DRAWER & ACCORDIONS (100% RESPONSIVE & SMOOTH)
   ========================================================================== */
body.kp-menu-open {
  overflow: hidden !important;
}

.kp-mobile-menu-drawer {
  display: none;
  overflow: hidden;
  opacity: 0;
  padding: 0 14px;
  flex-direction: column;
  gap: 8px;
  background: #FFFFFF;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  transition: opacity 0.25s ease, padding 0.25s ease;
  width: 100%;
  box-sizing: border-box;
}

.kp-mobile-menu-drawer.active {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: 100% !important;
  opacity: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  padding: 6px 6px max(4px, env(safe-area-inset-bottom, 28px)) !important;
}

/* Mobile Accordion Container */
.kp-mobile-mega-accordion {
  border-radius: 14px;
  background: #F8FAFC;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0 !important;
  width: 100% !important;
  min-height: auto !important;
  box-sizing: border-box !important;
}

.kp-mobile-mega-accordion.open {
  background: #FFFFFF;
  border-color: rgba(1, 113, 251, 0.25);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.kp-mobile-mega-head {
  width: 100% !important;
  min-height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 13px 15px !important;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0F172A;
  transition: background 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.kp-mobile-mega-head:hover,
.kp-mobile-mega-head:active {
  background: rgba(1, 113, 251, 0.04);
}

.kp-mobile-mega-accordion.open .kp-mobile-mega-head {
  color: #0171FB;
}

.kp-mobile-mega-head-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.kp-mobile-mega-chevron {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #64748B;
  flex-shrink: 0 !important;
}

.kp-mobile-mega-accordion.open .kp-mobile-mega-chevron {
  transform: rotate(180deg);
  color: #0171FB;
}

/* Smooth Accordion Body */
.kp-mobile-mega-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 12px;
  border-top: 1px solid transparent;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding 0.25s ease;
}

.kp-mobile-mega-accordion.open .kp-mobile-mega-body {
  max-height: 4000px;
  opacity: 1;
  padding: 8px 12px 14px;
  border-top-color: rgba(15, 23, 42, 0.06);
}

.kp-mobile-template-wrap {
  width: 100%;
  padding: 6px 0;
  box-sizing: border-box;
}

.kp-mobile-template-wrap,
.kp-mobile-template-wrap * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Force embedded mega templates, cards, and grids to stack 100% cleanly in 1 column on mobile drawer */
.kp-mobile-menu-drawer .in-mega-grid,
.kp-mobile-menu-drawer .in-uc-grid,
.kp-mobile-menu-drawer .kp-mega-menu-grid-3col,
.kp-mobile-menu-drawer .ip-cards-grid,
.kp-mobile-menu-drawer .in-pricing-grid,
.kp-mobile-menu-drawer [class*="grid"] {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  padding: 6px 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.kp-mobile-menu-drawer .in-uc-col,
.kp-mobile-menu-drawer .in-mega-col,
.kp-mobile-menu-drawer .in-pricing-card,
.kp-mobile-menu-drawer .in-card-pro,
.kp-mobile-menu-drawer .in-card-enterprise,
.kp-mobile-menu-drawer .kp-mega-col,
.kp-mobile-menu-drawer [class*="col"] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  grid-column: span 1 !important;
  box-sizing: border-box !important;
}

.kp-mobile-menu-drawer .in-uc-featured-card,
.kp-mobile-menu-drawer .in-featured-card,
.kp-mobile-menu-drawer .kp-mega-featured-card {
  width: 100% !important;
  min-height: auto !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

.kp-mobile-menu-drawer .in-uc-stats-card,
.kp-mobile-menu-drawer .in-showcase-card,
.kp-mobile-menu-drawer .kp-mega-visual-frame {
  width: 100% !important;
  box-sizing: border-box !important;
}

.kp-mobile-menu-drawer .kp-mega-bottom-banner,
.kp-mobile-menu-drawer .in-mega-bottom-strip,
.kp-mobile-menu-drawer .in-uc-bottom-strip,
.kp-mobile-menu-drawer .in-social-proof-bar {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.kp-mobile-menu-drawer .in-proof-right {
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.kp-mobile-mega-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kp-mobile-mega-item {
  display: flex;
  flex-direction: column;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  background: transparent;
  transition: background 0.15s ease;
}

.kp-mobile-mega-item:hover,
.kp-mobile-mega-item:active {
  background: #F1F5F9;
}

.kp-mmi-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 2px;
}

.kp-mmi-desc {
  font-size: 0.73rem;
  color: #64748B;
  line-height: 1.35;
}

/* Direct Links */
.kp-mobile-direct-links {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.kp-mobile-direct-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 44px !important;
  padding: 11px 14px !important;
  border-radius: 12px;
  color: #1E293B;
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.kp-mobile-direct-link:hover,
.kp-mobile-direct-link:active {
  background: #F1F5F9;
  color: #0171FB;
}

/* Mobile Actions & Buttons */
.kp-mobile-menu-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 9px;
  padding-top: 14px;
  padding-bottom: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin-top: 8px;
  flex-shrink: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.kp-mobile-lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 9999px;
  background: #F1F5F9;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
}

.kp-mobile-lang-btn:hover {
  background: #E2E8F0;
}

.kp-btn-mobile-demo {
  width: 100%;
  padding: 12px 16px;
  border-radius: 9999px;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  border: 1px solid rgba(15, 23, 42, 0.18);
  display: block;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.kp-btn-mobile-demo:hover,
.kp-btn-mobile-demo:active {
  background: #F8FAFC;
  transform: translateY(-1px);
}

.kp-btn-mobile-signin {
  width: 100%;
  padding: 12px 16px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2AA0FA 0%, #0171FB 55%, #0146EB 100%);
  color: #FFFFFF !important;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  display: block;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(1, 113, 251, 0.35);
  transition: all 0.2s ease;
}

.kp-btn-mobile-signin:hover,
.kp-btn-mobile-signin:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(1, 113, 251, 0.45);
}

/* ==========================================================================
   6. RTL / URDU SUPPORT
   ========================================================================== */
html[dir="rtl"] .khatapro-header-container,
html[dir="rtl"] .instaliio-header-container {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .kp-announcement-link {
  margin-left: 0;
  margin-right: 4px;
}

html[dir="rtl"] .kp-announcement-close-btn {
  right: auto;
  left: 8px;
}

html[dir="rtl"] .kp-mega-featured-card:hover .kp-mfc-arrow {
  transform: translateX(-4px);
}

html[dir="rtl"] .kp-mega-item-link:hover {
  transform: translateX(-3px);
}

html[dir="rtl"] .kp-mvf-chip {
  left: auto;
  right: 10px;
}

html[dir="rtl"] .kp-mobile-mega-head {
  text-align: right;
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINTS (TESTED ON ALL SIZES)
   ========================================================================== */
@media (max-width: 1024px) {
  .kp-btn-mobile-toggle {
    display: flex;
  }

  .kp-btn-desktop-only,
  .kp-nav-menu,
  .kp-navbar-mega-dropdown,
  .kp-nav-brand-divider {
    display: none !important;
  }

  .kp-navbar-pill {
    padding: 0 !important;
    border-radius: 9999px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .kp-navbar-pill.is-open {
    border-radius: 20px;
    max-height: calc(100dvh - 30px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25), 0 0 30px rgba(1, 113, 251, 0.2);
  }

  .kp-navbar-top-row {
    padding: 6px 12px;
    min-height: 48px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  }

  .kp-navbar-wrapper {
    top: 45px;
    padding: 0 12px;
  }

  body.kp-no-announcement .kp-navbar-wrapper,
  .kp-announcement-bar.is-hidden + .kp-navbar-wrapper {
    top: 12px;
  }

  body.kp-no-announcement .kp-navbar-pill.is-open,
  .kp-announcement-bar.is-hidden + .kp-navbar-wrapper .kp-navbar-pill.is-open {
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 640px) {
  .kp-announcement-tag {
    display: none;
  }

  .kp-announcement-container {
    padding: 0 25px;
    font-size: 0.76rem;
  }

  .kp-navbar-wrapper {
    padding: 0 8px;
  }

  .kp-brand-title {
    font-size: 1.1rem;
  }

  .kp-brand-logo-icon {
    width: 28px;
    height: 28px;
  }

  .kp-navbar-pill {
    padding: 0 !important;
  }

  .kp-navbar-top-row {
    padding: 5px 8px;
  }
}

@media (max-width: 380px) {
  .kp-brand-title {
    font-size: 0.98rem;
  }

  .kp-lang-pill {
    padding: 5px 8px;
    font-size: 0.78rem;
  }
}
