/**
 * Navbar Switch - Frontend Styles
 *
 * IMPORTANT: This CSS is intentionally minimal to avoid interfering
 * with Elementor's native responsive styles and CSS variables.
 */

/* ========================
   Wrapper Base
   ======================== */
.navbar-switch-wrapper {
    width: 100%;
}

/* Position Classes */
.navbar-switch-wrapper.position-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.navbar-switch-wrapper.position-sticky {
    position: sticky;
    top: 0;
}

.navbar-switch-wrapper.position-absolute {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.navbar-switch-wrapper.position-relative {
    position: relative;
}

/* ========================
   States Container
   ======================== */
/*
 * Both states are positioned in a grid cell to prevent height jumps.
 * The inactive state is hidden but still occupies space calculation.
 */
.navbar-switch-wrapper {
    display: grid;
    align-items: start; /* Align to top to prevent vertical centering issues */
}

.navbar-switch-state {
    grid-area: 1 / 1 / 2 / 2; /* Both states occupy the same grid cell */
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition-property: opacity, visibility, transform;
    align-self: start; /* Force alignment to top */
}

.navbar-switch-state.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Ensure content inside states aligns properly */
.navbar-switch-content {
    width: 100%;
}

/* Normalize Elementor templates inside states */
.navbar-switch-state .elementor {
    margin: 0;
}

.navbar-switch-state .elementor-location-header::before,
.navbar-switch-state .elementor-location-header::after {
    display: none; /* Remove any pseudo-elements that might add space */
}

/* ========================
   Transitions
   ======================== */
.navbar-switch-wrapper.transition-fade .navbar-switch-state {
    transition-property: opacity, visibility;
}

.navbar-switch-wrapper.transition-slide-down .navbar-switch-state {
    transform: translateY(-100%);
    transition-property: opacity, visibility, transform;
}

.navbar-switch-wrapper.transition-slide-down .navbar-switch-state.is-active {
    transform: translateY(0);
}

.navbar-switch-wrapper.transition-slide-up .navbar-switch-state {
    transform: translateY(100%);
    transition-property: opacity, visibility, transform;
}

.navbar-switch-wrapper.transition-slide-up .navbar-switch-state.is-active {
    transform: translateY(0);
}

.navbar-switch-wrapper.transition-scale .navbar-switch-state {
    transform: scale(0.95);
    transition-property: opacity, visibility, transform;
}

.navbar-switch-wrapper.transition-scale .navbar-switch-state.is-active {
    transform: scale(1);
}

.navbar-switch-wrapper.transition-none .navbar-switch-state {
    transition: none;
}

/* ========================
   Placeholder (Editor Only)
   ======================== */
.navbar-switch-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
    border: 2px dashed #c0c4c8;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6d7882;
}

.navbar-switch-placeholder i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #93003c;
}

.navbar-switch-placeholder p {
    margin: 0;
    font-size: 14px;
}

.navbar-switch-template-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    color: #2e7d32;
}

.navbar-switch-template-preview i {
    font-size: 24px;
    margin-bottom: 8px;
}

.navbar-switch-template-preview p {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
}

/* ========================
   Widget Container Fix
   ======================== */
.elementor-widget-navbar-switch {
    width: 100%;
}

.elementor-widget-navbar-switch > .elementor-widget-container {
    width: 100%;
}

/* Ensure mega-menu dropdowns are not clipped by the navbar-switch */
.navbar-switch-wrapper,
.navbar-switch-state,
.navbar-switch-state .elementor,
.navbar-switch-state .e-con {
    overflow: visible !important;
}

/*
 * Prevent horizontal overflow from fixed/absolute positioning
 * This is safer than using 100vw which includes scrollbar width
 */
.navbar-switch-wrapper.position-fixed,
.navbar-switch-wrapper.position-absolute {
    overflow-x: hidden;
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 767px) {
    .navbar-switch-placeholder,
    .navbar-switch-template-preview {
        min-height: 60px;
        padding: 15px;
    }

    .navbar-switch-placeholder i,
    .navbar-switch-template-preview i {
        font-size: 24px;
    }
}
