html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

/* --- Mobile Menu Toggler --- */
.custom-mobile-toggler {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 50%;
    /* Rounded Circle */
    padding: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1060;
    position: relative;
    margin-right: 15px;
    flex-shrink: 0;
}

.custom-mobile-toggler:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.custom-mobile-toggler:focus {
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.3);
    outline: none;
}

.custom-mobile-toggler .navbar-toggler-icon {
    background-image: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 0;
}

.custom-mobile-toggler i {
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Mobile Offcanvas Menu (Premium Design) --- */
@media (max-width: 991px) {
    #offcanvasNavbar {
        width: 85%;
        max-width: 360px;
        border: none;
        border-top-left-radius: 25px;
        border-bottom-left-radius: 25px;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
        background-color: #f4f6f9;
        /* Contrast background */
    }

    /* Header */
    .offcanvas-header {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        padding: 25px;
        color: #fff;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .offcanvas-title {
        font-weight: 800;
        font-size: 1.4rem;
        letter-spacing: 0.5px;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    /* Close Button */
    .offcanvas-header .btn-close {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(5px);
        width: 38px;
        height: 38px;
        border-radius: 50%;
        opacity: 1;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .offcanvas-header .btn-close:hover {
        background: rgba(255, 255, 255, 0.35);
        transform: rotate(90deg);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }

    .offcanvas-header .btn-close::before {
        content: "\eb99";
        /* RemixIcon Close Line */
        font-family: 'remixicon';
        font-size: 1.4rem;
        color: #fff;
    }

    /* Body */
    .offcanvas-body {
        padding: 20px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
    }

    /* Nav Links (Cards) */
    .offcanvas-body .nav-item {
        margin-bottom: 12px;
    }

    .offcanvas-body .nav-link {
        background: #fff;
        border-radius: 15px;
        /* Softer corners */
        padding: 18px 20px;
        color: #444 !important;
        font-weight: 700;
        font-size: 1.05rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
        /* Softer shadow */
        border: 1px solid transparent;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
        overflow: hidden;
    }

    .offcanvas-body .nav-link:hover,
    .offcanvas-body .nav-link:active,
    .offcanvas-body .nav-link.active {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
        color: var(--primary-color) !important;
    }

    /* Left Border Indicator */
    .offcanvas-body .nav-link.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        background: var(--primary-color);
    }

    /* Dropdown Arrow */
    .offcanvas-body .dropdown-toggle::after {
        font-size: 1.1em;
        margin-left: auto;
        transition: transform 0.3s;
        opacity: 0.4;
        border: none;
        content: "\ea4e";
        /* RemixIcon arrow down */
        font-family: 'remixicon';
        vertical-align: middle;
    }

    .offcanvas-body .nav-link:hover .dropdown-toggle::after {
        opacity: 0.8;
        color: var(--primary-color);
    }

    .offcanvas-body .nav-link[aria-expanded="true"].dropdown-toggle::after {
        transform: rotate(180deg);
        color: var(--primary-color);
        opacity: 1;
    }

    /* Dropdown Menu (Clean Inset) */
    .offcanvas-body .dropdown-menu {
        border: none;
        background: transparent;
        margin-top: 5px;
        padding: 5px 0 5px 15px;
        /* Indent content */
        box-shadow: none;
        position: static !important;
        /* Force static flow */
        transform: none !important;
        width: 100%;
    }

    /* Separate Cards for Dropdown Items */
    .offcanvas-body .dropdown-item {
        background: transparent;
        /* Transparent to blend */
        margin-bottom: 4px;
        border-radius: 10px;
        padding: 12px 15px;
        font-weight: 500;
        color: #666;
        border: none;
        transition: all 0.2s;
        position: relative;
        white-space: normal;
        line-height: 1.4;
        display: flex;
        align-items: center;
    }

    .offcanvas-body .dropdown-item::before {
        content: '';
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: #ddd;
        margin-right: 10px;
        transition: background-color 0.2s;
    }

    .offcanvas-body .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.5);
        color: var(--primary-color);
        padding-left: 20px;
        transform: none;
    }

    .offcanvas-body .dropdown-item:hover::before {
        background-color: var(--primary-color);
    }

    .offcanvas-body .dropdown-item:active {
        background: rgba(255, 255, 255, 0.8);
    }
}

/* --- Force Hide Legacy Mobile Menu (Prevention) --- */
.mobile-menu,
.mobile-cart {
    display: none !important;
}

/* --- Mobile App Footer (Premium Glass Design) --- */
@media (max-width: 767px) {
    body {
        padding-bottom: 90px !important;
        /* Prevent content occlusion */
    }

    .mobile-app-footer {
        position: fixed;
        bottom: 20px;
        left: 15px;
        right: 15px;
        z-index: 1050;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 20px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.5);
        transition: transform 0.3s ease;
        padding: 10px 5px;
    }

    .mobile-nav-container {
        display: flex;
        justify-content: space-around;
        align-items: flex-end;
        /* Align bottom */
        height: 100%;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #888;
        position: relative;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        flex: 1;
        padding: 5px 0;
    }

    .mobile-nav-item .icon-wrapper {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        transition: all 0.3s ease;
        position: relative;
        z-index: 2;
        background: transparent;
        /* Inactive background */
        color: var(--secondary-color);
        /* Fallback */
    }

    /* Gradient Icon for Inactive State */
    .mobile-nav-item .icon-wrapper i {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        transition: all 0.3s ease;
    }

    .mobile-nav-item .nav-label {
        font-size: 10px;
        font-weight: 600;
        margin-top: 4px;
        color: var(--secondary-color);
        /* Darker gray/black for better contrast */
        transition: all 0.3s ease;
    }

    /* Active State */
    .mobile-nav-item.active .icon-wrapper,
    .mobile-nav-item:hover .icon-wrapper {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        transform: translateY(-8px);
        /* Float up */
        box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.3);
    }

    /* Active Icon should be White (fill), not gradient text */
    .mobile-nav-item.active .icon-wrapper i,
    .mobile-nav-item:hover .icon-wrapper i {
        background: none;
        -webkit-text-fill-color: #fff;
        color: #fff;
    }

    .mobile-nav-item.active .nav-label,
    .mobile-nav-item:hover .nav-label {
        color: var(--primary-color);
        font-weight: 700;
        opacity: 1;
    }

    /* Ripple / Glow effect for active item */
    .mobile-nav-item.active::after {
        content: '';
        position: absolute;
        bottom: -5px;
        width: 4px;
        height: 4px;
        background: var(--primary-color);
        border-radius: 50%;
        opacity: 1;
    }
}