/* Mobile Menu Styles - Enhanced Layout and Sizing */

/* Typography */
.mobile-logo,
.mobile-nav-link,
.mobile-search-input {
    font-family: Cairo, sans-serif;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.mobile-menu-btn:hover {
    background: rgba(227, 6, 19, 0.1);
}

.mobile-menu-btn .menu-bar {
    width: 25px;
    height: 3px;
    background: #111;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-btn.active .menu-bar:first-child {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .menu-bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .menu-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar - Fixed Layout */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 999;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    right: 0;
}

/* Mobile Sidebar Header */
.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #e30613;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mobile-logo {
    font-size: 1.2rem;
    font-weight: 600;
}

.mobile-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Sidebar Content - Flexible Layout */
.mobile-sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Mobile Navigation */
.mobile-nav {
    flex-shrink: 0;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 25px;
    color: #111;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 56px;
    box-sizing: border-box;
}

.mobile-nav-link:hover {
    background: #f8f9fa;
    color: #e30613;
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    color: #e30613;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mobile-nav-link span {
    flex: 1;
}

/* Mobile Search Section */
.mobile-search-section {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.mobile-search-section h3 {
    margin: 0 0 15px;
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    font-family: Cairo, sans-serif;
}

.search-input-wrapper {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    margin: 0;
    padding: 0;
}

.search-input-wrapper:focus-within {
    border-color: #e30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.mobile-search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-size: 1rem;
    background: #fff;
    color: #111;
    width: 100%;
    margin: 0;
    text-align: right;
    direction: rtl;
}

.mobile-search-input::placeholder {
    color: #999;
}

.mobile-search-submit {
    background: #e30613;
    color: #fff;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mobile-search-submit:hover {
    background: #b8050f;
}

/* Mobile Social Section - Fixed at Bottom */
.mobile-social-section {
    padding: 20px 25px;
    margin-top: auto;
    flex-shrink: 0;
}

.mobile-social-section h3 {
    margin: 0 0 15px;
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    font-family: Cairo, sans-serif;
}

.mobile-social-links {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.mobile-social-link {
    background: #e30613;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.mobile-social-link:hover {
    background: #b8050f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.3);
}

/* Responsive Behavior */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
    }

    .nav-menu,
    .search-form {
        display: none !important;
    }
}

@media (max-width: 400px) {
    .mobile-sidebar {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }

    .mobile-sidebar.active {
        right: 0;
    }

    .mobile-sidebar-header {
        padding: 15px 20px;
    }

    .mobile-nav-link {
        padding: 14px 20px;
    }

    .mobile-search-section,
    .mobile-social-section {
        padding: 15px 20px;
    }
}

/* Body lock when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Scrollbar styling for mobile sidebar */
.mobile-sidebar::-webkit-scrollbar {
    width: 6px;
}

.mobile-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mobile-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.mobile-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}