/* =========================================
   Desktop Header Main Layout (Noon Clone)
   ========================================= */

.janalight-desktop-header {
    font-family: inherit;
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
}

/* Admin Bar Fix */
.admin-bar .janalight-desktop-header {
    margin-top: 32px;
}

/* Hide Custom Desktop Header on Mobile */
@media (max-width: 1024px) {
    .janalight-desktop-header {
        display: none !important;
    }
}

/* Hide Woodmart Default Header forcefully on desktop only */
@media (min-width: 1025px) {
    .whb-header {
        display: none !important;
    }
}

.jdh-main-header {
    background-color: var(--jdh-bg, #fee000);
    padding: 10px 0;
}

.jdh-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* =========================================
   Start Group (Logo & Location)
   ========================================= */
.jdh-start-group {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.jdh-logo img {
    height: 60px !important;
    width: auto;
    max-width: 250px;
    display: block;
}

.jdh-delivery-location {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.jdh-delivery-location:hover {
    background-color: rgba(0,0,0,0.05);
}

.jdh-dl-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.jdh-dl-label {
    font-size: 11px;
    color: #ffffff;
    opacity: 0.8;
}

.jdh-dl-city {
    font-size: 13px;
    color: #ffffff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =========================================
   Center Group (Search Bar)
   ========================================= */
.jdh-center-group {
    flex-grow: 1;
    max-width: 800px;
}

.jdh-search-form {
    display: flex;
    width: 100%;
    background: #ffffff !important;
    border-radius: 6px;
    overflow: hidden;
    height: 45px;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
    align-items: center;
}

.jdh-search-cat-wrapper {
    position: relative;
    height: 100%;
    background: #f7f7fa;
    display: flex;
    align-items: center;
}

.jdh-search-form .jdh-search-cat-select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    border: none !important;
    padding: 0 12px 0 28px !important;
    margin: 0 !important;
    height: 100% !important;
    color: #404553 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    outline: none !important;
    cursor: pointer !important;
    min-width: 115px !important;
    max-width: 150px !important;
    box-shadow: none !important;
}

.jdh-search-cat-wrapper::after {
    content: "▼";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #a8b0c1;
    pointer-events: none;
}

.jdh-search-divider {
    width: 1px;
    height: 60%;
    background-color: #e2e5f1;
}

.jdh-search-form .jdh-search-input {
    flex-grow: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 15px !important;
    font-size: 15px !important;
    color: #333333 !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: 100% !important;
}

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

.jdh-search-form .jdh-search-btn {
    background: #f7f7fa !important;
    border: none !important;
    padding: 0 15px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* =========================================
   End Group (Actions)
   ========================================= */
.jdh-end-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.jdh-action-divider {
    width: 1px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.1);
}

.jdh-action-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    text-decoration: none !important;
    color: #ffffff !important;
    transition: opacity 0.2s;
}

.jdh-action-item:hover {
    opacity: 0.7;
}

.jdh-action-text {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #ffffff;
    transition: color 0.2s;
    line-height: 1;
}

.jdh-action-icon {
    display: flex;
    position: relative;
}

.jdh-cart-count, .jdh-wishlist-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #3866df; /* Noon blue */
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
    min-width: 18px;
    text-align: center;
    border: 2px solid #ed6c03; /* Matches header background */
}

/* =========================================
   Bottom Nav (Categories)
   ========================================= */
.jdh-bottom-nav {
    background-color: #fff;
    border-bottom: 1px solid #e2e5f1;
    padding: 0;
}

.jdh-bottom-nav .jdh-container {
    height: 45px;
    justify-content: flex-start;
    gap: 0;
}

.jdh-departments-menu {
    border-left: 1px solid #e2e5f1;
    padding-left: 20px;
    margin-left: 20px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.jdh-dept-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #404553;
    cursor: pointer;
    height: 100%;
}

.jdh-dept-dropdown {
    position: absolute;
    top: 100%;
    right: 0; /* RTL alignment */
    width: 320px;
    background-color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 9999;
    padding-bottom: 10px;
}

.jdh-departments-menu:hover .jdh-dept-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.jdh-dept-search {
    padding: 15px;
    border-bottom: 1px solid #e2e5f1;
}

.jdh-dept-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e5f1;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.jdh-dept-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 10px 15px;
    max-height: 350px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.jdh-dept-dropdown ul li a {
    display: block;
    padding: 8px 12px;
    color: #404553;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    background-color: #f7f7fa;
    transition: background-color 0.2s, color 0.2s;
    text-align: center;
}

.jdh-dept-dropdown ul li a:hover {
    background-color: #ebf0fe;
    color: #3866df;
}

.jdh-dept-loadmore {
    text-align: center;
    padding: 10px 15px 0;
}

.jdh-dept-loadmore button {
    width: 100%;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #3866df;
    color: #3866df;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.jdh-dept-loadmore button:hover {
    background-color: #3866df;
    color: #fff;
}

/* Children indicator */
.jdh-dept-dropdown ul li.cat-parent > a::after {
    content: "←";
    float: left;
    color: #a8b0c1;
}

.jdh-main-menu {
    flex: 1;
    display: flex;
    justify-content: center; /* Center the main menu */
}

.jdh-main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.jdh-main-menu ul li a {
    color: #404553;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
    padding: 10px 0;
}

.jdh-main-menu ul li a::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 3px;
    background-color: #3866df;
    transition: width 0.3s ease;
}

.jdh-main-menu ul li a:hover {
    color: #3866df;
}

.jdh-main-menu ul li a:hover::after {
    width: 100%;
}

/* =========================================
   Delivery Modal
   ========================================= */
.jdh-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.jdh-modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    animation: jdhModalPop 0.2s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes jdhModalPop {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.jdh-modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e5f1;
}

.jdh-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #404553;
}

.jdh-modal-close {
    font-size: 24px;
    color: #a8b0c1;
    cursor: pointer;
    line-height: 1;
}

.jdh-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.jdh-modal-desc {
    font-size: 14px;
    color: #7e859b;
    margin-bottom: 15px;
}

.jdh-city-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.jdh-city-list li {
    padding: 12px 15px;
    background-color: #f7f7fa;
    border: 1px solid #e2e5f1;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #404553;
    transition: all 0.2s;
    text-align: center;
}



.jdh-city-list li:hover {
    border-color: #3866df;
    color: #3866df;
}

.jdh-city-list li.active {
    background-color: #ebf0fe;
    border-color: #3866df;
    color: #3866df;
}

/* RTL Specific fixes if theme enforces LTR base */
body.rtl .jdh-departments-menu, html[dir="rtl"] .jdh-departments-menu {
    border-left: none;
    border-right: 1px solid #e2e5f1;
    padding-left: 0;
    padding-right: 20px;
    margin-left: 0;
    margin-right: 20px;
}

body.rtl .jdh-search-form .jdh-search-input, html[dir="rtl"] .jdh-search-form .jdh-search-input {
    border-radius: 0 6px 6px 0 !important;
}

body.rtl .jdh-search-form .jdh-search-btn, html[dir="rtl"] .jdh-search-form .jdh-search-btn {
    border-radius: 6px 0 0 6px !important;
}

body.rtl .jdh-search-form .jdh-search-cat-select, html[dir="rtl"] .jdh-search-form .jdh-search-cat-select {
    padding: 0 12px 0 28px !important;
}

body.rtl .jdh-search-cat-wrapper::after, html[dir="rtl"] .jdh-search-cat-wrapper::after {
    right: auto !important;
    left: 10px !important;
}

/* Hide Desktop Header on Mobile and Tablet */
@media (max-width: 1024px) {
    .janalight-desktop-header {
        display: none !important;
    }
}
