/* Medical Header Styles */
.medical-header-wrapper {
    width: 100%;
    position: relative;
    z-index: 1000;
}

/* Promotion Banner */
.promotion-banner {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
    padding: 8px 0;
    position: relative;
    overflow: hidden;
}

.promotion-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.promotion-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.promotion-main {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.promotion-code-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.promotion-label {
    font-size: 14px;
    font-weight: bold;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
}

.promotion-desc {
    font-size: 12px;
    font-weight: 600;
}

.promotion-note {
    font-size: 10px;
    opacity: 0.9;
}

.promotion-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.promotion-date {
    background: #FF6B6B;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.promotion-btn {
    background: #FFE66D;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.promotion-btn:hover {
    background: #FFD93D;
    transform: translateY(-2px);
}

.promotion-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.promotion-close:hover {
    opacity: 1;
}

/* Header Top */
.header-top {
    background: #2E86AB;
    color: white;
    padding: 8px 0;
    font-size: 13px;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.header-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: #FFE66D;
    color: #FFE66D;
    transform: translateY(-1px);
}

.separator {
    opacity: 0.7;
}

.hotline a {
    color: #FFE66D;
    font-weight: bold;
    text-decoration: none;
}

/* Header Main */
.header-main {
    background: #4472C4;
    padding: 15px 0;
}

.header-main-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    max-height: 60px;
    width: auto;
}

.logo-placeholder {
    width: 120px;
    height: 60px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: bold;
    color: #4472C4;
}

.menu-categories {
    flex-shrink: 0;
    position: relative;
}

.categories-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.categories-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.categories-btn span {
    white-space: nowrap;
}

/* Categories Dropdown - High specificity to override Bricks */
body .brxe-div .medical-header-wrapper .menu-categories .categories-dropdown,
.medical-header-wrapper .menu-categories .categories-dropdown,
.categories-dropdown {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    left: 0 !important;
    right: auto !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    min-width: 280px !important;
    max-width: 350px !important;
    width: auto !important;
    height: auto !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 999999 !important;
    border: 1px solid #e5e7eb !important;
    overflow: visible !important;
    display: block !important;
    pointer-events: auto !important;
}

/* Active state with high specificity */
body .brxe-div .medical-header-wrapper .menu-categories .categories-dropdown.active,
.medical-header-wrapper .menu-categories .categories-dropdown.active,
.categories-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.categories-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.categories-list {
    padding: 15px 0;
    max-height: 400px;
    overflow-y: auto;
}

.categories-list::-webkit-scrollbar {
    width: 4px;
}

.categories-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.categories-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.categories-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-menu li {
    margin: 0;
}

.categories-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.categories-menu a:hover {
    background: #f8f9fa;
    color: #4472C4;
    border-left-color: #4472C4;
    padding-left: 25px;
}

.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-form {
    display: flex;
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: #4472C4;
    box-shadow: 0 4px 25px rgba(68, 114, 196, 0.2);
    transform: translateY(-1px);
}

.search-input {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: #333;
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

.search-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
    border: none;
    color: white;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: linear-gradient(135deg, #FF5252 0%, #FF4444 100%);
    transform: scale(1.05);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    position: relative;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-icon:hover {
    color: #FFE66D;
}

.header-icon i {
    font-size: 18px;
}

.icon-count, .cart-count {
    background: #FF6B6B;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    position: absolute;
    top: -8px;
    right: -8px;
}

.cart-icon {
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.3);
}

.cart-text {
    font-size: 14px;
    font-weight: 500;
}

/* Navigation */
.header-navigation {
    background: #1E5F8B;
    padding: 0;
}

.main-navigation {
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #FFE66D;
}

.nav-item.has-submenu .nav-link i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-item.has-submenu:hover .nav-link i {
    transform: rotate(180deg);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Authentication Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal.show {
    display: flex;
    opacity: 1;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.auth-modal.show .auth-modal-content {
    transform: scale(1);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #4472C4 0%, #2E86AB 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.auth-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.auth-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.auth-modal-body {
    padding: 30px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #4472C4;
}

.auth-submit-btn {
    background: linear-gradient(135deg, #4472C4 0%, #2E86AB 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(68, 114, 196, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.auth-switch p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.auth-switch a {
    color: #4472C4;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-greeting {
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.logout-btn {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: translateY(-1px);
}

/* Categories Loading Skeleton */
.categories-loading {
    padding: 15px 20px;
}

.skeleton-item {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-item:nth-child(1) { width: 80%; }
.skeleton-item:nth-child(2) { width: 65%; }
.skeleton-item:nth-child(3) { width: 90%; }
.skeleton-item:nth-child(4) { width: 70%; }
.skeleton-item:nth-child(5) { width: 85%; }

@keyframes loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Modal Open Body */
body.modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .promotion-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .promotion-left {
        flex-direction: column;
        gap: 10px;
    }

    .header-main-content {
        flex-wrap: wrap;
        gap: 15px;
    }

    .header-search {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .nav-menu {
        flex-wrap: wrap;
    }

    .nav-link {
        padding: 12px 15px;
        font-size: 14px;
    }

    .header-icons {
        gap: 15px;
    }

    .cart-text {
        display: none;
    }

    .categories-dropdown {
        left: -10px;
        right: -10px;
        min-width: auto;
        max-width: none;
    }

    .auth-modal-content {
        width: 95%;
        margin: 20px;
    }

    .auth-modal-body {
        padding: 20px;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .user-greeting {
        display: none;
    }
}
