/* ==========================================================================
   Anveshan Farm Design System - Header Category Bar & Dropdowns
   ========================================================================== */

.compact-category-section {
    width: 100%;
    background: #ffffff !important;
    border-bottom: 1px solid #E6ECE8 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
    position: relative;
    z-index: 1030;
    overflow: visible !important;
}

.compact-category-wrapper {
    width: 100%;
    padding: 5px 16px !important;
    position: relative;
    overflow: visible !important;
}

.compact-category-carousel {
    width: 100%;
}

.compact-category-carousel .owl-stage {
    display: flex;
    align-items: center;
}

.compact-category-carousel .owl-item {
    width: auto !important;
}

.compact-category-slide {
    width: auto;
}

.compact-category-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 38px !important;
    padding: 4px 12px 4px 5px !important;
    border-radius: 24px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #112A24 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer;
}

.compact-category-item:hover,
.compact-category-item.active {
    background: #EAF4F0 !important;
    border-color: rgba(0, 88, 75, 0.18) !important;
    color: #00584B !important;
    text-decoration: none !important;
}

.compact-category-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #F4F7F5 !important;
    border: 1.5px solid #E0EAE3 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.22s ease !important;
}

.compact-category-item:hover .compact-category-icon,
.compact-category-item.active .compact-category-icon {
    border-color: #00584B !important;
    transform: scale(1.08) !important;
    box-shadow: 0 3px 8px rgba(0, 88, 75, 0.18) !important;
}

.compact-category-icon img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.compact-all-icon {
    background: #EAF4F0 !important;
    color: #00584B !important;
    font-size: 15px;
}

.compact-category-name {
    display: block;
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.4px !important;
    line-height: 1.2 !important;
    color: #112A24 !important;
    text-transform: uppercase !important;
    transition: color 0.2s ease !important;
}

.compact-category-item:hover .compact-category-name,
.compact-category-item.active .compact-category-name {
    color: #00584B !important;
}

.compact-category-carousel .owl-nav,
.compact-category-carousel .owl-dots {
    display: none !important;
}

/* Mega Dropdowns for each Category */
.compact-category-dropdowns-container {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 99999;
}

.compact-category-dropdown {
    position: absolute;
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    background: #ffffff !important;
    border: 1px solid #DCE6E0 !important;
    border-radius: 12px !important;
    box-shadow: 0 14px 36px rgba(0, 48, 40, 0.12) !important;
    z-index: 99999;
    pointer-events: none;
    min-width: 320px;
    max-width: 95vw;
    box-sizing: border-box;
}

.compact-category-dropdown::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 18px;
    background: transparent;
    pointer-events: auto;
}

.compact-category-dropdown.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto !important;
}

.compact-category-dropdown-inner {
    padding: 16px 20px;
    max-height: 480px;
    overflow-y: auto;
}

.compact-category-dropdown-inner::-webkit-scrollbar {
    width: 5px;
}

.compact-category-dropdown-inner::-webkit-scrollbar-thumb {
    background: #C4D4CC;
    border-radius: 4px;
}

.compact-category-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #EAEFEA;
    padding-bottom: 11px;
    margin-bottom: 14px;
}

.compact-category-dropdown-title-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #00584B !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.compact-category-dropdown-title-link:hover {
    color: #00453A !important;
    text-decoration: none;
}

.compact-dropdown-cat-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #E0EAE3;
}

.compact-category-dropdown-view-all {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #00584B !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.15s ease;
}

.compact-category-dropdown-view-all:hover {
    color: #00453A !important;
    text-decoration: underline !important;
}

.compact-category-dropdown-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 26px;
}

.compact-category-col {
    min-width: 140px;
    max-width: 240px;
    flex: 1 1 160px;
}

.compact-subcategory-title {
    display: block;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #112A24 !important;
    text-decoration: none !important;
    margin-bottom: 8px;
    line-height: 1.3;
    transition: color 0.15s ease;
}

.compact-subcategory-title:hover {
    color: #00584B !important;
    text-decoration: none;
}

.compact-subsubcategory-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 2px;
}

.compact-subsubcategory-link {
    font-size: 12px !important;
    color: #4A6356 !important;
    text-decoration: none !important;
    line-height: 1.45;
    transition: all 0.15s ease;
}

.compact-subsubcategory-link:hover {
    color: #00584B !important;
    text-decoration: none !important;
    transform: translateX(3px);
    font-weight: 600 !important;
}

/* Responsive - Desktop */
@media (min-width: 1200px) {
    .compact-category-wrapper {
        padding: 6px 18px !important;
    }

    .compact-category-item {
        gap: 8px !important;
        margin-right: 10px;
    }

    .compact-category-name {
        font-size: 12px !important;
        max-width: 160px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .compact-category-wrapper {
        padding: 5px 10px !important;
    }

    .compact-category-item {
        gap: 7px !important;
        margin-right: 6px;
    }

    .compact-category-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    .compact-category-name {
        font-size: 11.5px !important;
        max-width: 125px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .compact-category-wrapper {
        padding: 4px 6px !important;
    }

    .compact-category-item {
        gap: 6px !important;
        margin-right: 4px;
        min-height: 32px !important;
        padding: 3px 8px 3px 4px !important;
    }

    .compact-category-icon {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
    }

    .compact-category-name {
        font-size: 11px !important;
        max-width: 105px !important;
    }
}
