/* Theme 2 - Modern E-commerce Customer Header Styles */
.ch-body {
    font-family: var(--font-family);
    margin: 0;
    padding-top: 0;
}

/* Header Container */
.ch-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ch-header.scrolled {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Header scroll states */
.ch-header.scroll-hidden {
    transform: translateY(-100%);
}

.ch-header.scroll-search-only .ch-top-header-section,
.ch-header.scroll-search-only .ch-category-nav-section {
    display: none !important;
}

.ch-header.scroll-search-only .ch-main-header-section {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-top: 0;
    padding-top: 16px;
}

.ch-header.scroll-search-only .ch-search-container {
    margin-top: 0;
    padding-top: 0;
}

/* Header Spacer */
.ch-header-spacer {
    height: 180px; /* Adjust based on header height - increased for 3 sections */
}

/* ===== SECTION 1: TOP HEADER ===== */
.ch-top-header-section {
    background: #f7f7f7;
    border-bottom: 1px solid #e5e5e5;
    padding: 8px 0;
    font-size: 13px;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.ch-top-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

.ch-top-left .ch-welcome-text {
    color: #666;
}

.ch-user-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.ch-user-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.ch-top-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 20px;
}

.ch-top-nav-link {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.ch-top-nav-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* Top Dropdown */
.ch-top-dropdown {
    position: relative;
}

.ch-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ch-dropdown-toggle i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.ch-top-dropdown.show .ch-dropdown-toggle i {
    transform: rotate(180deg);
}

.ch-top-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    min-width: 200px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    margin-top: 8px !important;
    background: #fff;
    z-index: 9999 !important;
    display: none !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.ch-top-dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    position: absolute !important;
    z-index: 9999 !important;
}

.ch-top-dropdown-menu .dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ch-top-dropdown-menu .dropdown-item:hover {
    background-color: #f5f5f5;
    color: var(--color-primary);
}

.ch-top-dropdown-menu .dropdown-item i {
    width: 16px;
    text-align: center;
    color: #666;
}

.ch-top-dropdown-menu .dropdown-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    margin: 0 -8px;
}

/* Cart Link in Top Header */
.ch-cart-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    position: relative;
}

.ch-cart-link:hover {
    color: var(--color-secondary);
    text-decoration: none;
}

.ch-cart-link .cart-count {
    background: var(--color-danger);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== SECTION 2: MAIN HEADER (LOGO & SEARCH) ===== */
.ch-main-header-section {
    background: #fff;
    padding: 16px 0;
    border-bottom: 1px solid #e5e5e5;
}

/* Logo Styles */
.ch-logo-container {
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.ch-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.ch-brand-link:hover {
    transform: scale(1.02);
}

.ch-logo-img {
    max-height: 50px;
    width: auto;
    max-width: 150px;
}

.ch-logo-text .ch-shop-name {
    color: var(--color-primary);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.ch-logo-text .ch-shop-tagline {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

/* Search Container */
.ch-search-container {
    padding: 0 15px;
}

.ch-search-wrapper {
    display: flex;
    border: 2px solid var(--color-secondary);
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Category Dropdown in Search */
.ch-search-category {
    position: relative;
    background: #f7f7f7;
    border-right: 1px solid #e5e5e5;
    min-width: 140px;
}

.ch-category-select {
    appearance: none;
    border: none;
    background: transparent;
    padding: 12px 35px 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    width: 100%;
    outline: none;
}

.ch-category-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 12px;
    pointer-events: none;
}

/* Search Input */
.ch-search-input-wrapper {
    flex: 1;
}

.ch-search-input {
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    width: 100%;
    outline: none;
    background: transparent;
}

.ch-search-input::placeholder {
    color: #999;
}

/* Search Button */
.ch-search-btn {
    background: var(--color-primary);
    border: none;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ch-search-btn:hover {
    background: var(--color-primary);
    opacity: 0.3;
}

.ch-search-text {
    font-size: 14px;
}

/* Advanced Search Link */
.ch-advanced-search {
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ch-advanced-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.ch-advanced-link:hover {
    text-decoration: underline;
    color: var(--color-primary);
}

/* ===== SECTION 3: CATEGORY NAVIGATION ===== */
.ch-category-nav-section {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 0;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.ch-category-nav {
    padding: 0 15px;
}

/* Mobile Menu Toggle */
.ch-mobile-menu-toggle {
    background: none;
    border: 1px solid #e5e5e5;
    padding: 8px 16px;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    cursor: pointer;
}

.ch-mobile-menu-toggle:hover {
    background: #f5f5f5;
}

/* Category Navigation List */
.ch-category-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

/* Ensure category nav is always visible on desktop */
@media (min-width: 992px) {
    #chCategoryNav {
        display: block !important;
    }
}

.ch-category-nav-item {
    position: relative;
}

.ch-category-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 4px;
    white-space: nowrap;
}

.ch-category-nav-link:hover {
    background: #f5f5f5;
    color: var(--color-primary);
    text-decoration: none;
}

.ch-category-nav-link i {
    font-size: 12px;
}

/* Category Dropdown */
.ch-dropdown .ch-category-nav-link {
    position: relative;
}

.ch-dropdown .ch-category-nav-link i {
    margin-left: 4px;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.ch-dropdown.show .ch-category-nav-link i {
    transform: rotate(180deg);
}

.ch-category-dropdown {
    min-width: 220px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    margin-top: 8px;
    background: #fff;
}

.ch-category-dropdown .dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
}

.ch-category-dropdown .dropdown-item:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* ===== MEGA MENU STYLES ===== */
.ch-mega-dropdown {
    position: relative;
}

.ch-mega-menu {
    position: absolute;
    top: 100%;
    left: -200px;
    width: 1200px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
}

.ch-mega-dropdown:hover .ch-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ch-mega-content {
    display: flex;
    min-height: 350px;
}

.ch-mega-left {
    flex: 0 0 400px;
    padding: 24px;
    background: #fff;
    border-radius: 8px 0 0 8px;
}

.ch-mega-columns {
    display: flex;
    gap: 40px;
}

.ch-mega-column {
    flex: 1;
}

.ch-mega-right {
    flex: 1;
    position: relative;
    border-radius: 0 8px 8px 0;
    overflow: hidden;
}

.ch-mega-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ch-mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ch-mega-list li {
    margin-bottom: 8px;
}

.ch-mega-link {
    display: block;
    padding: 8px 0;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.ch-mega-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.ch-mega-view-more {
    font-weight: 600;
    color: var(--color-primary) !important;
    border-top: 1px solid #e5e5e5;
    margin-top: 8px;
    padding-top: 12px !important;
}

.ch-mega-view-more:hover {
    transition-duration: 0.6s;
    text-decoration: underline;
    transform-origin: center;
    transform: scale(1.05);
}

.ch-mega-cta {
    position: relative;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    min-height: 300px;
}

.ch-mega-cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    border-radius: 0 8px 8px 0;
}

.ch-mega-cta-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    color: white;
}

.ch-mega-cta-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.ch-mega-cta-subtitle {
    font-size: 14px;
    margin: 0 0 16px 0;
    opacity: 0.9;
    line-height: 1.4;
}

.ch-mega-cta-btn {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ch-mega-cta-btn:hover {
    background: var(--color-secondary);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.ch-mega-cta-tagline {
    position: absolute;
    bottom: 16px;
    right: 24px;
    z-index: 3;
}

.ch-mega-cta-tagline span {
    color: white;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

/* Special Items (like Book Appointment) */
.ch-category-nav-item.ch-special .ch-category-nav-link {
    background: linear-gradient(135deg, #3665f3, #4c84ff);
    color: white;
    border-radius: 20px;
    margin-left: 16px;
    font-weight: 600;
}

.ch-category-nav-item.ch-special .ch-category-nav-link:hover {
    background: linear-gradient(135deg, #2952d9, #3665f3);
    color: white;
    transform: translateY(-1px);
}

/* ===== MOBILE HIDE CLASS ===== */
.ch-hide-mobile {
    display: inline !important;
}

@media (max-width: 767px) {
    .ch-hide-mobile {
        display: none !important;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet Styles */
@media (max-width: 991px) {
    .ch-header-spacer {
        height: 200px;
    }

    .ch-main-header-section .row {
        flex-direction: column;
        gap: 16px;
    }

    .ch-logo-container {
        justify-content: center;
        text-align: center;
    }

    .ch-search-container {
        order: 2;
    }

    .ch-advanced-search {
        order: 3;
        justify-content: center;
    }

    .ch-category-nav-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .ch-category-nav-item {
        width: 100%;
    }

    .ch-category-nav-link {
        justify-content: center;
        width: 100%;
        text-align: center;
    }

    .ch-category-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: #f9f9f9;
        margin: 0;
        padding: 0;
    }

    .ch-category-dropdown .dropdown-item {
        padding-left: 32px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .ch-header-spacer {
        height: 180px;
    }

    .ch-top-header-content {
        flex-direction: row;
        gap: 8px;
        text-align: left;
    }

    .ch-top-nav-list {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 12px;
    }

    /* Mobile dropdown positioning fix */
    .ch-top-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 180px;
        max-width: 90vw;
        margin-top: 4px;
    }

    /* Keep main header section in row layout */
    .ch-main-header-section .row {
        flex-direction: row;
        gap: 8px;
    }

    /* Adjust logo container for mobile - make it more compact */
    .ch-main-header-section .col-lg-2 {
        flex: 0 0 auto;
        max-width: none;
        width: auto;
        min-width: 120px;
    }

    /* Adjust search container for mobile - give it more space */
    .ch-main-header-section .col-lg-8 {
        flex: 2;
        max-width: none;
        width: auto;
    }

    /* Hide advanced search column completely */
    .ch-main-header-section .col-lg-2:last-child {
        display: none;
    }

    .ch-logo-container {
        justify-content: flex-start;
        text-align: left;
        padding: 0 8px 0 15px;
    }

    .ch-search-container {
        padding: 0 15px 0 8px;
        order: unset;
    }

    .ch-search-wrapper {
        border-radius: 20px;
        flex-direction: row;
    }

    .ch-search-input-wrapper {
        flex: 1;
    }

    .ch-search-btn {
        border-radius: 0 18px 18px 0;
        justify-content: center;
        padding: 10px 16px;
    }

    .ch-logo-img {
        max-height: 35px;
    }

    .ch-logo-text .ch-shop-name {
        font-size: 18px;
        line-height: 1.1;
    }

    .ch-search-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .ch-category-nav-item.ch-special .ch-category-nav-link {
        margin-left: 0;
        border-radius: 4px;
    }
}

/* Extra Small Mobile */
@media (max-width: 575px) {
    .ch-header-spacer {
        height: 240px;
    }

    .ch-top-nav-list {
        font-size: 12px;
        gap: 8px;
    }

    .ch-search-input {
        font-size: 14px;
    }

    .ch-category-select {
        font-size: 13px;
        padding: 10px 30px 10px 12px;
    }

    .ch-search-btn {
        padding: 10px 16px;
    }

    .ch-search-text {
        display: none;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    animation: fadeInDown 0.2s ease;
}

/* ===== ACCESSIBILITY ===== */
.ch-category-nav-link:focus,
.ch-top-nav-link:focus,
.ch-search-btn:focus,
.ch-search-input:focus,
.ch-category-select:focus {
    outline: 2px solid #3665f3;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .ch-header {
        position: static;
        box-shadow: none;
        border-bottom: 1px solid #000;
    }
    
    .ch-header-spacer {
        display: none;
    }
}
