/**
 * Frontend Public Stylesheet - Easy Mobile Bar Menu
 */

/* Hide theme's default mobile drawer and overlay to avoid conflicts */
body #dcMobileDrawer,
body #dcOverlay {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 1. OVERLAY MASK */
.embm-overlay {
    position: fixed;
    inset: 0;
    background: var(--embm-overlay-bg);
    z-index: calc(var(--embm-z-index) - 1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.embm-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 2. DRAWER CONTAINER */
.embm-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--embm-width);
    max-width: 85%;
    background: var(--embm-drawer-bg);
    z-index: var(--embm-z-index);
    transform: translateX(-100%);
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.embm-drawer.is-active {
    transform: translateX(0);
}

.embm-drawer-inner {
    height: 100%;
    overflow-y: auto;
    padding: 30px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* 3. CLOSE BUTTON */
.embm-close-btn {
    position: absolute;
    top: 20px;
    left: 100%;
    margin-left: 20px;
    background: transparent;
    border: none;
    font-size: 38px;
    font-weight: 300;
    line-height: 1;
    color: #ffffff; /* White close button on the dark overlay */
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Hide by default when drawer is closed */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.embm-drawer.is-active .embm-close-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.embm-close-btn:hover,
.embm-close-btn:focus {
    color: #333333;
    transform: scale(1.1);
    outline: none;
}

/* 4. USER GREETING CARD */

.embm-greeting-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--embm-greeting-bg);
    border-radius: var(--embm-border-radius);
    padding: 16px 20px;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(242, 122, 26, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.embm-greeting-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(186, 119, 97, 0.35);
}

.embm-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    color: var(--embm-greeting-text);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.embm-avatar svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.embm-user-info {
    display: flex;
    flex-direction: column;
    color: var(--embm-greeting-text);
    overflow: hidden;
}

.embm-user-hello {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.embm-user-action {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 3px;
    text-decoration: none;
    letter-spacing: 0.2px;
}

/* 5. SECTIONS GENERAL */
.embm-section {
    display: flex;
    flex-direction: column;
}

.embm-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #444444;
    margin: 0 0 14px 0;
    padding-bottom: 6px;
    position: relative;
}

.embm-section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 3px;
    background: #ba7761; /* Brand color highlight */
    border-radius: 2px;
}

.embm-card-box {
    border: 1px solid #eaeaea;
    border-radius: var(--embm-border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

/* 6. CATEGORIES ACCORDION LIST */
.embm-categories-box {
    background: var(--embm-cats-bg);
}

.embm-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.embm-category-item {
    border-bottom: 1px solid #f2f2f2;
}

.embm-category-item:last-child {
    border-bottom: none;
}

.embm-category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.embm-category-link {
    flex: 1;
    padding: 13px 20px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--embm-cats-text);
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.embm-category-link:hover,
.embm-category-link:focus {
    color: #ba7761;
    background-color: rgba(186, 119, 97, 0.03);
}

.embm-accordion-toggle {
    background: transparent;
    border: none;
    padding: 0 20px;
    height: 47px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--embm-cats-chevron);
    font-size: 11px;
    transition: transform 0.25s ease, color 0.2s ease;
    outline: none;
}

.embm-accordion-toggle:hover {
    color: #ba7761;
}

/* Rotate Chevron on Open Accordion */
.embm-category-item.is-open > .embm-category-row > .embm-accordion-toggle {
    transform: rotate(90deg);
}

/* Subcategory List Box styling */
.embm-subcategory-wrapper {
    background: #fcfcfc;
    border-top: 1px solid #f8f8f8;
}

.embm-category-list.depth-2 .embm-category-link {
    padding-left: 36px;
    font-size: 13.5px;
    color: #555555;
    font-weight: 400;
}

.embm-category-list.depth-2 .embm-category-item {
    border-bottom-color: #f7f7f7;
}

/* 7. QUICK LINKS LIST */
.embm-qlinks-box {
    background: var(--embm-qlinks-bg);
}

.embm-qlinks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.embm-qlink-item {
    border-bottom: 1px solid #f2f2f2;
}

.embm-qlink-item:last-child {
    border-bottom: none;
}

.embm-qlink-anchor {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    text-decoration: none !important;
    color: var(--embm-qlinks-text);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.embm-qlink-anchor:hover,
.embm-qlink-anchor:focus {
    color: #ba7761;
    background-color: rgba(186, 119, 97, 0.03);
}

.embm-qlink-icon {
    font-size: 16px;
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ba7761;
    flex-shrink: 0;
}

/* Error fallback */
.embm-error {
    padding: 15px 20px;
    margin: 0;
    font-size: 13px;
    color: #cc1818;
}
