/* ========================================
   FULL-SCREEN OVERLAY SIDE MENU
   Namespace: cbSideOverlay*
   z-index: 15000 (above mobile bottom nav 10000)
   ======================================== */

/* Overlay Container */
.cbSideOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15000;
    visibility: hidden;
    transition: visibility 0s linear 0.3s; /* Delay hiding until animations complete */
}

.cbSideOverlay.active {
    pointer-events: auto !important;
    visibility: visible !important;
    transition-delay: 0s; /* Show immediately when opening */
}

/* Backdrop */
.cbSideOverlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    transition-delay: 0.15s;
    z-index: 1;
}

.cbSideOverlay.active .cbSideOverlay-backdrop {
    opacity: 1;
    transition-delay: 0s; /* No delay when opening */
}

/* Overlay Panel */
.cbSideOverlay-panel {
    position: absolute;
    top: 0;
    left: 0;
    /*width: 85%;
    max-width: 400px;*/
    width: 100%;
    height: 100%;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.cbSideOverlay.active .cbSideOverlay-panel {
    transform: translateX(0);
}

/* Header with Close Button */
.cbSideOverlay-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    padding: 0.25rem 1.25rem 0 1.25rem;
    z-index: 10;
}

.cbSideOverlay-closeBtn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #1e3a8a;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.cbSideOverlay-closeBtn:hover {
    background: #f3f4f6;
    color: #1e40af;
}

/* Content Container */
.cbSideOverlay-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem;
}

/* ========================================
   AUTHENTICATED USER CONTENT
   ======================================== */

/* Profile Card */
.cbSideOverlay-profileCard {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #ffc056 0%, #ffb12d 100%);
    color: #0a093c;
    border-radius: 12px;
    margin: 0.25em 1.25rem 1.25rem 1.25rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cbSideOverlay-profileAvatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: #1E9E54;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.cbSideOverlay-profileAvatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cbSideOverlay-profileAvatar span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e40af;
}

.cbSideOverlay-profileInfo {
    flex: 1;
    min-width: 0;
}

.cbSideOverlay-profileInfo h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.cbSideOverlay-basketBtn {
    position: relative;
    background: white;
    color: #041560;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cbSideOverlay-basketBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cbSideOverlay-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FF3636;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.35rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cbSideOverlay-badge.hidden {
    display: none !important;
}

/* Quick Actions Grid */
.cbSideOverlay-quickActions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0 1.25rem;
    margin-bottom: 1.5rem;
}

.cbSideOverlay-quickBtn {
    background: #f8fafc;
    border: 1px solid #c2c8cf;
    border-radius: 24px;
    padding: 0.75rem 1.1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0a093c;
    transition: all 0.2s;
    min-height: auto;
    text-align: start;
}

    .cbSideOverlay-quickBtn i {
        font-size: 1.5rem;
        flex-shrink: 0;
        color: #041560;
    }

.cbSideOverlay-quickBtn span {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    line-height: 1.2;
    flex: 1;
}

.cbSideOverlay-quickBtn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ========================================
   NON-AUTHENTICATED USER CONTENT
   ======================================== */

/* Action Card */
.cbSideOverlay-actionCard {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding: 1.5rem 1.25rem;
    margin: 1rem 1.25rem;
    /*background: linear-gradient(135deg, #ffc056 0%, #ffb12d 100%);*/
    border-radius: 14px;
    /*border: 1px solid #e2e8f0;*/
}

.cbSideOverlay-authBtn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
}

.cbSideOverlay-authBtn span {
    flex: 1;
    text-align: left;
}

.cbSideOverlay-authBtn i {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.cbSideOverlay-loginBtn {
    /*background: #1e40af;
    color: white;
    border: 2px solid #1e40af;*/
    background: white;
    color: #474CBF;
    border: 2px solid #474CBF;
}

    .cbSideOverlay-loginBtn:hover {
        background: #3F44A8;
        border-color: #3F44A8;
        color: white;
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(30, 64, 175, 0.3);
    }

.cbSideOverlay-registerBtn {
    background: white;
    /*color: #1e40af;
    border: 2px solid #1e40af;*/
    color: #C95917;
    border: 2px solid #C95917;
}

    .cbSideOverlay-registerBtn:hover {
        background: #B44F14;
        border-color: #B44F14;
        color: white;
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(30, 64, 175, 0.2);
    }

/* ========================================
   SECTIONS
   ======================================== */

.cbSideOverlay-section {
    padding: 0 1.25rem;
    margin-bottom: 1.5rem;
}

.cbSideOverlay-sectionTitle {
    font-size: 1.3rem;
    font-weight: 600;
    color: #32353e;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem 0;
    padding: 1rem 1.5rem;
    background-color: #f5f6fa;
    text-align: left;
    border-radius: 14px;
}

.cbSideOverlay-navItem {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.35rem 1rem;
    color: #1f2937;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    justify-self: start;
    text-align: start;
}

.cbSideOverlay-navItem i {
    font-size: 1.4rem;
    color: #041560;
    width: 24px;
    text-align: center;
}

.cbSideOverlay-navItem:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.cbSideOverlay-navItem.cbSideOverlay-secondNavItems
{
    font-weight: 500;
}

/* ========================================
   NAVIGATION ACCORDIONS
   ======================================== */

.cbSideOverlay-navAccordion {
    margin-bottom: 0.5rem;
}

.cbSideOverlay-accordionParent {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.cbSideOverlay-accordionParent:hover {
    background: #f3f4f6;
}

.cbSideOverlay-accordionArrow {
    margin-left: auto;
    font-size: 0.875rem;
    color: #6b7280;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.cbSideOverlay-accordionParent.active .cbSideOverlay-accordionArrow {
    transform: rotate(180deg);
}

.cbSideOverlay-accordionContent {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    background: #f1fbff;
    border-radius: 14px;
    margin-top: 0;
}

.cbSideOverlay-accordionContent.active {
    max-height: 500px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.cbSideOverlay-navSubItem {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem 0.75rem 3.5rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0.5rem;
}

.cbSideOverlay-navSubItem:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: translateX(4px);
}

/* Language Selector */
.cbSideOverlay-languageSelector {
    position: relative;
}

.cbSideOverlay-langBtn {
    width: 100%;
    background: white;
    cursor: pointer;
}

.cbSideOverlay-langChevron {
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 1rem;
    color: #6b7280;
}

.cbSideOverlay-langBtn.active .cbSideOverlay-langChevron {
    transform: rotate(180deg);
}

.cbSideOverlay-langDropdown {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.cbSideOverlay-langDropdown.active {
    max-height: 300px;
}

.cbSideOverlay-langDropdown form {
    margin: 0;
}

.cbSideOverlay-langOption {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.3rem;
    font-weight: 600;
    color: #4b5563;
}

.cbSideOverlay-langOption:hover {
    background: #e5e7eb;
}

.cbSideOverlay-langOption.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 800;
}

/* ========================================
   FOOTER (FIXED BOTTOM)
   ======================================== */

.cbSideOverlay-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cbSideOverlay-footerActions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.cbSideOverlay-footerItem {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: #ebebed;
    color: #32353e;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1.25rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    text-align: center;
    flex: 1;
}

.cbSideOverlay-footerItem i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.cbSideOverlay-footerItem span {
    font-size: 0.75rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.cbSideOverlay-footerItem:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.cbSideOverlay-logoutForm {
    margin: 0;
    flex: 1;
}

.cbSideOverlay-logoutBtn {
    background-color: #fecccd;
    width: 100%;
    color: #be0909;
}

.cbSideOverlay-logoutBtn:hover {
    background: #fee2e2;
    color: #991b1b;
}

.cbSideOverlay-version {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: #9ca3af;
    font-size: 1.3rem;
    font-style: italic;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
    display: none !important;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (min-width: 768px) {
    .cbSideOverlay-panel {
        width: 380px;
    }
}

/* Prevent body scroll when overlay is active */
body.cbSideOverlay-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

.cbSideOverlay-panel::-webkit-scrollbar {
    width: 6px;
}

.cbSideOverlay-panel::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.cbSideOverlay-panel::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.cbSideOverlay-panel::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
