/* =========================================
   BISWASBD.COM - Mega Menu Styles
   ========================================= */

/* Module Colors */
:root {
    --shop: #1769e0;
    --agri: #168447;
    --organic: #159957;
    --blood: #d62839;
    --zakat: #087f5b;
    --video: #7c3aed;
    --support: #e67e22;
}

/* =========================================
   CATEGORY NAV (Main Navigation)
   ========================================= */
.main-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 900;
}

.nav-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-item {
    position: relative;
}

.nav-button {
    border: none;
    background: transparent;
    padding: 15px 17px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    font-family: inherit;
    font-size: 14px;
    transition: color 0.2s;
    color: #344054;
}

.nav-button:hover,
.nav-item.active .nav-button {
    color: inherit;
}

/* Multi-color Nav */
.nav-shop { color: var(--shop); }
.nav-agri { color: var(--agri); }
.nav-organic { color: var(--organic); }
.nav-blood { color: var(--blood); }
.nav-zakat { color: var(--zakat); }
.nav-video { color: var(--video); }
.nav-support { color: var(--support); }

/* =========================================
   MEGA MENU WRAPPER
   ========================================= */
.mega-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    width: min(1200px, 92vw);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 18px 45px rgba(16, 24, 40, 0.14);
    padding: 22px;
    display: none;
    z-index: 950;
}

.nav-item:hover .mega-wrapper {
    display: block;
}

.mega-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light, #f3f4f6);
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.mega-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.mega-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
    border-color: var(--primary, #16a34a);
}

.mega-card-icon {
    font-size: 25px;
    margin-bottom: 6px;
}

.mega-card-title {
    font-weight: 800;
    font-size: 14px;
    color: var(--dark, #1f2937);
}

.mega-card-count {
    color: var(--gray, #6b7280);
    font-size: 12px;
    margin-top: 4px;
}

/* =========================================
   MOBILE CATEGORY PANEL
   ========================================= */
.mobile-category-panel {
    display: none;
    max-width: 700px;
    margin: 20px auto;
    padding: 0 16px;
}

.mobile-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.mobile-top {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-button {
    border: none;
    background: #f1f4f8;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 19px;
    font-family: inherit;
    transition: background 0.2s;
}

.back-button:hover {
    background: #e5e7eb;
}

.mobile-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark, #1f2937);
}

.breadcrumb {
    padding: 10px 16px;
    color: var(--gray, #6b7280);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    white-space: nowrap;
}

.category-list {
    padding: 8px;
}

.category-item {
    width: 100%;
    border: none;
    background: #fff;
    border-bottom: 1px solid #f0f2f5;
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item:hover {
    background: #f8faff;
}

.category-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f2f6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--dark, #1f2937);
}

.category-sub {
    color: var(--gray, #6b7280);
    font-size: 12px;
    margin-top: 3px;
}

.category-arrow {
    color: #98a2b3;
    font-size: 20px;
    flex-shrink: 0;
}

/* =========================================
   MODULE CARDS
   ========================================= */
.modules {
    max-width: 1500px;
    margin: 30px auto;
    padding: 0 24px;
}

.section-title {
    font-size: 25px;
    margin-bottom: 18px;
    font-weight: 800;
    color: var(--dark, #1f2937);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
}

.module-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(16, 24, 40, 0.08);
}

.module-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.module-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--dark, #1f2937);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1100px) {
    .module-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .mega-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .main-nav {
        display: none;
    }

    .mobile-category-panel {
        display: block;
    }

    .modules {
        padding: 0 14px;
        margin-top: 25px;
    }

    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .module-card {
        padding: 16px 8px;
    }
}

@media (min-width: 768px) {
    .mobile-category-panel {
        display: none !important;
    }
}

@media (max-width: 500px) {
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}