/* Mobile Sidebar Redesign */

@media (max-width: 767px) {
    /* Mobile sidebar container */
    .topMenu {
        position: fixed;
        width: 85%;
        max-width: 320px;
        z-index: 999999999;
        height: 100%;
        top: 0;
        left: 0;
        background: #f1e9df;
        padding: 0;
        display: none;
        overflow-y: auto;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        border-radius: 0;
    }

    /* Mobile sidebar header */
    .mobile-sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem 1.5rem 1rem 1.5rem;
        border-bottom: 1px solid rgba(153, 113, 51, 0.1);
        background: #f1e9df;
    }

    .mobile-sidebar-title {
        color: #997133;
        font-size: 2.6rem;
        font-weight: 600;
        margin: 0;
    }

    .mobile-sidebar-close {
        background: #997133;
        color: white;
        border: none;
        width: 4rem;
        height: 4rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 1.8rem;
        font-weight: bold;
    }

    .mobile-sidebar-close:hover {
        background: #8b6f47;
        transform: scale(1.05);
    }

    .topMenu.showMenu {
        display: block;
    }

    /* Menu list container */
    .menuList {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        padding: 16px;
        margin: 0;
    }

    .menuList li {
        width: 100%;
        margin-bottom: 0;
    }

    /* Menu item wrapper */
    .menuWrap {
        background: transparent;
        border-radius: 0;
        margin-bottom: 0;
        box-shadow: none;
        transition: all 0.3s ease;
        border: none;
        position: relative;
        height: auto;
    }

    /* Ensure all menu items have the same styling */
    .menuList li .menuWrap,
    .menuList li.active .menuWrap,
    .menuList li .itmActive .menuWrap {
        background: transparent;
        border: none;
        height: auto;
    }

    .menuWrap:hover {
        transform: none;
        box-shadow: none;
        border: none;
    }

    /* Menu item links - Rounded buttons like in the image */
    .menuList li a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        background-color: #fff;
        color: #8b6f47;
        text-decoration: none;
        font-weight: 500;
        font-size: 14px;
        border: none;
        border-radius: 12px;
        transition: all 0.3s ease;
        cursor: pointer;
        position: relative;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
        min-height: auto;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .menuList li a:hover {
        background-color: #f0ebe4;
        color: #6b5139;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    /* Menu icons */
    .menuIcon {
        width: 20px;
        height: 20px;
        margin-right: 4px;
        opacity: 0.8;
        flex-shrink: 0;
    }

    .menuIcon svg {
        width: 20px;
        height: 20px;
        fill: currentColor;
    }

    .menuIcon svg path {
        fill: currentColor !important;
    }

    /* Menu text */
    .menuList li a span {
        flex: 1;
        font-size: 14px;
        font-weight: 500;
        color: inherit;
        text-align: left;
        min-width: 0;
        overflow: visible;
        white-space: normal;
        word-wrap: break-word;
        justify-content: flex-start;
        padding-right: 0;
        line-height: 1.4;
        display: block;
        width: 100%;
    }

    /* Dropdown arrow - pointing down when collapsed */
    .sidebar-item-caret {
        position: absolute;
        right: 16px;
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid #8b6f47;
        transition: transform 0.3s ease;
        top: 50%;
        transform: translateY(-50%);
    }

    .menuList li div.active .sidebar-item-caret {
        transform: translateY(-50%) rotate(180deg);
    }

    /* Active state */
    .menuList li.active .menuWrap,
    .menuList li .itmActive .menuWrap {
        background: transparent;
        border: none;
        height: auto;
        box-shadow: none;
    }

    .menuList li.active a,
    .menuList li .itmActive a {
        color: #6b5139;
        background-color: #f0ebe4;
    }

    .menuList li.active .sidebar-item-caret,
    .menuList li .itmActive .sidebar-item-caret {
        border-top-color: #6b5139;
    }

    /* Submenu styling */
    .menuSubList {
        max-height: 0;
        overflow: hidden;
        background-color: transparent;
        transition: max-height 0.3s ease;
        margin: 0;
        padding: 0;
    }

    .menuList .active .menuSubList {
        max-height: 1000px;
        padding: 4px 0 4px 0;
    }

    /* Submenu container */
    .menuSubListContainer {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* Submenu items - Category headers */
    .menuSubList h1 {
        color: #997133;
        font-size: 12px;
        font-weight: 600;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 0;
        border-bottom: none;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left;
        justify-content: flex-start;
    }

    .menuSubList h1 svg {
        width: 16px;
        height: 16px;
        display: block;
        visibility: visible;
        opacity: 1;
    }

    .menuSubList h1 svg path {
        fill: #997133 !important;
    }

    /* Submenu items - Individual services */
    .menuSubList a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        color: #8b6f47;
        text-decoration: none;
        font-size: 13px;
        border: none;
        border-radius: 12px;
        transition: all 0.3s ease;
        gap: 4px;
        background: #fff;
        margin: 0;
        min-height: auto;
        height: auto;
        margin-left: 0;
        width: 100%;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        text-align: left;
        justify-content: flex-start;
    }

    .menuSubList a:hover {
        background-color: #f0ebe4;
        color: #6b5139;
        transform: translateX(4px);
    }

    .menuSubList a svg {
        width: 20px;
        height: 20px;
        margin-right: 4px;
        opacity: 0.7;
        flex-shrink: 0;
        margin-top: 0;
        margin-left: 0;
    }

    .menuSubList a svg path {
        fill: currentColor !important;
    }

    .menuSubList a:last-child {
        border-bottom: none;
    }

    .menuSubList a span {
        flex: 1;
        font-size: 13px;
        font-weight: 400;
        text-align: left;
        justify-content: flex-start;
        overflow: visible;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.4;
        padding-right: 10px;
        display: block;
        width: 100%;
    }

    /* List column menu */
    .listColMenu {
        background: transparent;
        border-radius: 0;
        padding: 0;
        margin-bottom: 0;
    }

    .listColMenu h1 {
        color: #997133;
        font-size: 12px;
        font-weight: 600;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 4px;
        border-bottom: none;
        padding: 0;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left;
        justify-content: flex-start;
    }

    .listColMenu h1 svg {
        width: 16px;
        height: 16px;
        display: block;
        visibility: visible;
        opacity: 1;
    }

    .listColMenu h1 svg path {
        fill: #997133 !important;
    }

    /* Submenu footer */
    .menuSubFooter {
        border-top: 1px solid rgba(153, 113, 51, 0.1);
        padding: 1rem 0 0 0;
        margin-top: 1rem;
    }

    .menuSubFooter a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        color: #997133;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        border-radius: 12px;
        transition: all 0.3s ease;
        gap: 12px;
        background: #fff;
        border: none;
        margin: 0;
        width: 100%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        text-align: left;
        justify-content: flex-start;
    }

    .menuSubFooter a:hover {
        background: #f0ebe4;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .menuSubFooter a svg {
        width: 18px;
        height: 18px;
    }

    .menuSubFooter a svg path {
        fill: #997133 !important;
    }

    .menuSubFooter a span {
        flex: 1;
        color: #997133;
        text-align: left;
        justify-content: flex-start;
        display: block;
        width: 100%;
    }

    .menuSubFooter .rotateItm {
        margin-left: auto;
    }

    /* Mobile menu button */
    .menuMobileButton {
        z-index: 1040;
        position: fixed;
        left: 2rem;
        top: 1rem;
        background: #997133;
        color: #997133;
        padding: 1.8rem;
        width: 6rem;
        height: 6rem;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 12px rgba(153, 113, 51, 0.3);
        transition: all 0.3s ease;
        border: none;
        cursor: pointer;
    }

    .menuMobileButton:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(153, 113, 51, 0.4);
    }

    .menuMobileButton i {
        font-size: 2.5rem;
        color: white;
    }

    /* Menu overlay */
    .menuOverlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999999998;
        backdrop-filter: blur(2px);
    }

    .menuOverlay.showMenu {
        display: block;
    }

    /* Hide toggle button */
    .hide-toggle {
        display: none !important;
    }

    /* Responsive adjustments */
    @media (max-width: 480px) {
        .topMenu {
            width: 90%;
        }

        .mobile-sidebar-header {
            padding: 1.2rem 1rem 0.8rem 1rem;
        }

        .menuList {
            padding: 12px;
        }

        .menuList li a {
            padding: 10px 12px;
            font-size: 13px;
        }

        .menuIcon {
            width: 18px;
            height: 18px;
        }

        .menuIcon svg {
            width: 18px;
            height: 18px;
        }

        .menuSubList {
            padding: 4px 0 12px 0;
        }

        .menuSubList a {
            padding: 8px 10px;
            font-size: 12px;
            margin-left: 12px;
            width: calc(100% - 12px);
        }

        .menuSubList h1 {
            font-size: 11px;
            margin: 12px 0 6px 0;
        }

        .menuSubFooter a {
            padding: 10px 12px;
            font-size: 13px;
        }

        .menuMobileButton {
            width: 5.5rem;
            height: 5.5rem;
            padding: 1.6rem;
            left: 1.5rem;
        }

        .menuMobileButton i {
            font-size: 2.2rem;
        }
    }

    /* Animation for menu items */
    @keyframes slideInLeft {
        from {
            transform: translateX(-20px);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .menuList li {
        animation: slideInLeft 0.3s ease-out;
    }

    .menuList li:nth-child(1) { animation-delay: 0.1s; }
    .menuList li:nth-child(2) { animation-delay: 0.2s; }
    .menuList li:nth-child(3) { animation-delay: 0.3s; }
    .menuList li:nth-child(4) { animation-delay: 0.4s; }
    .menuList li:nth-child(5) { animation-delay: 0.5s; }
    .menuList li:nth-child(6) { animation-delay: 0.6s; }
    .menuList li:nth-child(7) { animation-delay: 0.7s; }
    .menuList li:nth-child(8) { animation-delay: 0.8s; }

    /* Focus states for accessibility */
    .menuList li a:focus,
    .menuSubList a:focus,
    .menuSubFooter a:focus {
        outline: 2px solid rgba(153, 113, 51, 0.5);
        outline-offset: 2px;
    }

    /* Loading state */
    .menuWrap.loading {
        opacity: 0.7;
        pointer-events: none;
    }

    /* RTL support */
    html[dir="rtl"] .menuList li a {
        text-align: right;
    }

    html[dir="rtl"] .menuSubList a:hover {
        transform: translateX(-4px);
    }

    html[dir="rtl"] .menuSubFooter a:hover {
        transform: translateX(-4px);
    }

    html[dir="rtl"] .sidebar-item-caret {
        margin-left: 0;
        margin-right: auto;
    }
} 