/**
 * Nav Bar Pro - Premium Enhancements CSS
 * الأنماط الإضافية للأيقونة الوسطى البارزة والقوائم المنبثقة
 * @version 2.0.0
 */

/* ═══════════════════════════════════════════════════════════
   ⭐ CENTER FAB (Floating Action Button) - iOS/Android Style
   ═══════════════════════════════════════════════════════════ */
body .nbp-nav-item.center-fab {
    flex: 0 0 var(--nbp-fab-size) !important;
    width: var(--nbp-fab-size);
    height: var(--nbp-fab-size);
    border-radius: 50% !important;
    padding: 0 !important;
    position: relative;
    margin: -20px 0 0 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4),
                0 4px 12px rgba(118, 75, 162, 0.3);
    border: 4px solid #fff;
    transition: all var(--nbp-transition-normal) var(--nbp-spring);
    z-index: 10;
}

body .nbp-nav-item.center-fab:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5),
                0 6px 16px rgba(118, 75, 162, 0.4);
    filter: brightness(1.1);
}

body .nbp-nav-item.center-fab:active {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

body .nbp-nav-item.center-fab .icon-wrapper {
    width: var(--nbp-fab-icon-size);
    height: var(--nbp-fab-icon-size);
    margin: 0;
    background: none !important;
}

body .nbp-nav-item.center-fab .icon-wrapper i {
    font-size: var(--nbp-fab-icon-size);
    color: #fff !important;
}

body .nbp-nav-item.center-fab:hover .icon-wrapper i {
    transform: rotate(90deg);
    filter: brightness(1.1);
}

body .nbp-nav-item.center-fab .label {
    display: none !important;
}

/* Pulse Animation for FAB */
body .nbp-nav-item.center-fab::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.6);
    transform: translate(-50%, -50%);
    animation: fab-pulse 2s infinite;
    pointer-events: none;
}

@keyframes fab-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   📋 SUBMENU / DROPDOWN - Premium Design
   ═══════════════════════════════════════════════════════════ */
.nbp-nav-item.has-submenu {
    position: relative;
}

.nbp-nav-item.has-submenu::after {
    content: '⋯';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
    line-height: 1;
    opacity: 0.4;
}

.nbp-submenu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 200px;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: var(--nbp-blur-medium);
    backdrop-filter: var(--nbp-blur-medium);
    border-radius: 16px;
    box-shadow: var(--nbp-shadow-xl);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--nbp-transition-normal);
    border: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.nbp-nav-item.has-submenu:hover .nbp-submenu,
.nbp-nav-item.has-submenu.active .nbp-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Submenu Arrow */
.nbp-submenu::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    border-color: rgba(255, 255, 255, 0.98) transparent transparent transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.nbp-submenu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    border-radius: 12px;
    transition: all var(--nbp-transition-fast);
    cursor: pointer;
}

.nbp-submenu-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    transform: translateX(4px);
}

.nbp-submenu-item i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nbp-submenu-item span {
    font-size: 14px;
    font-weight: 500;
}

.nbp-submenu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════
   🛒 Enhanced Cart Dropdown
   ═══════════════════════════════════════════════════════════ */
.nbp-cart-dropdown {
    background: rgba(255, 255, 255, 0.98) !important;
    -webkit-backdrop-filter: var(--nbp-blur-medium);
    backdrop-filter: var(--nbp-blur-medium);
    border-radius: 20px !important;
    box-shadow: var(--nbp-shadow-xl) !important;
    width: 320px !important;
    max-height: 480px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--nbp-transition-normal);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.nbp-cart-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block !important;
}

.nbp-cart-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nbp-cart-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--nbp-transition-fast);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nbp-cart-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.nbp-cart-contents {
    padding: 16px;
    max-height: 320px;
    overflow-y: auto;
}

.nbp-cart-item {
    display: flex !important;
    align-items: center;
    padding: 12px !important;
    margin-bottom: 8px;
    border-radius: 12px !important;
    background: rgba(102, 126, 234, 0.04) !important;
    border: none !important;
    transition: all var(--nbp-transition-fast);
}

.nbp-cart-item:hover {
    background: rgba(102, 126, 234, 0.08) !important;
    transform: translateX(4px);
}

.nbp-item-image {
    width: 56px !important;
    height: 56px !important;
    margin-left: 12px !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nbp-item-details h6 {
    font-weight: 600 !important;
    line-height: 1.3;
}

.nbp-item-qty {
    font-size: 13px !important;
    color: #667eea !important;
    font-weight: 600;
}

.nbp-remove-item {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%) !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--nbp-transition-fast);
}

.nbp-remove-item:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.nbp-cart-total {
    padding: 16px 20px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    font-size: 16px !important;
    font-weight: 700;
    background: rgba(102, 126, 234, 0.04);
}

.nbp-cart-actions {
    padding: 16px 20px 20px;
    gap: 10px !important;
}

.nbp-btn {
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700;
    transition: all var(--nbp-transition-fast);
}

.nbp-btn-outline {
    border: 2px solid #667eea !important;
    color: #667eea !important;
    background: #fff !important;
}

.nbp-btn-outline:hover {
    background: rgba(102, 126, 234, 0.08) !important;
    transform: translateY(-2px);
}

.nbp-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nbp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Empty Cart State */
.nbp-cart-empty {
    padding: 40px 20px;
    text-align: center;
}

.nbp-cart-empty i {
    font-size: 64px;
    color: rgba(102, 126, 234, 0.2);
    margin-bottom: 16px;
}

.nbp-cart-empty p {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   🔔 Enhanced Badge
   ═══════════════════════════════════════════════════════════ */
.nbp-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%) !important;
    padding: 3px 7px !important;
    border-radius: 12px !important;
    min-width: 20px !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    animation: badge-bounce 2s infinite !important;
    border: 2px solid #fff;
}

@keyframes badge-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* ═══════════════════════════════════════════════════════════
   📱 Responsive Design
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --nbp-fab-size: 56px;
        --nbp-fab-icon-size: 28px;
    }
    
    body .nbp-nav-item.center-fab {
        margin: -16px 0 0 0;
    }
    
    .nbp-cart-dropdown {
        width: 280px !important;
    }
    
    .nbp-submenu {
        min-width: 180px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ✨ Enhanced Item Interactions
   ═══════════════════════════════════════════════════════════ */
body .nbp-nav-item {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body .nbp-nav-item:hover {
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-2px);
}

body .nbp-nav-item.active {
    background: rgba(102, 126, 234, 0.12);
}

/* Ripple Effect */
body .nbp-nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
    pointer-events: none;
    z-index: 0;
}

body .nbp-nav-item:active::before {
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   🌙 Dark Mode Support
   ═══════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    body .nbp-nav.glass-effect {
        background: rgba(30, 30, 30, 0.85) !important;
    }
    
    .nbp-submenu,
    .nbp-cart-dropdown {
        background: rgba(40, 40, 40, 0.98) !important;
    }
    
    .nbp-submenu-item,
    .nbp-cart-item {
        color: #fff !important;
    }
    
    .nbp-item-details h6 {
        color: #fff !important;
    }
    
    body .nbp-nav-item.center-fab {
        border-color: #1a1a1a;
    }
}

/* ═══════════════════════════════════════════════════════════
   🎨 Smooth Rendering
   ═══════════════════════════════════════════════════════════ */

/* Fix: Prevent bar expansion and icon scaling on click */
body .nbp-nav-item,
body .nbp-nav-item .icon-wrapper,
body .nbp-nav-item .label {
    will-change: filter, background-color, color;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

body .nbp-nav-item:active,
body .nbp-nav-item:focus {
    outline: none;
    transform: none !important;
}

body .nbp-nav-item .icon-wrapper,
body .nbp-nav-item .label {
    flex-shrink: 0;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
