.fancybox__content {
    padding: 0;
}

html {
    height: 100%;
}

body {
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    font-size: 16px;
    color: #FFFFFF;
    background-color: #000000;
}

/* Sidebar Styles */

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ebe2d8;
    /* Match sidebar/branding color */
    z-index: 10000;
    /* Highest z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loader-logo {
    max-width: 200px;
    height: auto;
    animation: logoFade 1.5s ease-in-out infinite alternate;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(141, 110, 63, 0.2);
    /* Brand color light */
    border-radius: 50%;
    border-top: 3px solid #8D6E3F;
    /* Brand color dark */
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes logoFade {
    0% {
        opacity: 0.7;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1.0);
    }
}

.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background-color: #ebe2d8;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.sidebar.closed {
    transform: translateX(-100%);
}

/* Internal Close Button */
.close-sidebar-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: #E0DED5;
    color: #5E5E5E;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-sidebar-btn:hover {
    background-color: #8D6E3F;
    color: white;
}

/* External Open Button (Visible when closed) */
.open-sidebar-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 999;
    /* Below sidebar but above pano */
    width: 40px;
    height: 40px;
    background-color: #8D6E3F;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Show open button when sidebar is closed */
.sidebar.closed~.open-sidebar-btn {
    opacity: 1;
    pointer-events: auto;
}


.logo-area {
    background-color: #ebe2d8;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    flex-shrink: 0;
}

.logo-icon i {
    font-size: 40px;
    margin-bottom: 15px;
}

.logo-text {
    font-size: 18px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: visible;
    /* Changed from overflow-y: auto; */
    position: relative;
    /* Added */
    flex-grow: 1;
}

.nav-menu li {
    /* display: flex; justify-content: space-between; align-items: center; */
    border-bottom: 1px solid #E0DED5;
    color: #5E5E5E;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    /* Added for absolute positioning of submenu */
}

.menu-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    transition: all 0.2s ease;
}

.nav-menu li:hover>.menu-item-content,
.nav-menu li.open>.menu-item-content {
    background-color: #ECE9E2;
}

.nav-menu li.active>.menu-item-content {
    background-color: #8D6E3F;
    color: white;
}

.nav-menu li .menu-text {
    text-transform: uppercase;
}

.nav-menu li .menu-icon {
    width: 20px;
    text-align: center;
}

.nav-menu li .menu-icon i {
    font-size: 16px;
}

/* Submenu Flyout Styles */
.submenu {
    background-color: #FFFFFF;
    /* Changed */
    list-style: none;
    padding: 0;
    display: none;

    /* Positioning */
    position: absolute;
    left: 100%;
    /* Right of the sidebar */
    top: 0;
    width: 300px;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    /* Removed border-top */
}

/* Show submenu on hover (Desktop) AND when open (Mobile/Click) */
.nav-menu li.has-submenu:hover .submenu,
.nav-menu li.has-submenu.open .submenu {
    display: block;
}

.nav-menu li.has-submenu .dropdown-icon {
    transition: transform 0.3s;
    font-size: 12px;
    margin-right: 10px;
}

/* Rotate chevron on hover and when open */
.nav-menu li.has-submenu:hover .dropdown-icon,
.nav-menu li.has-submenu.open .dropdown-icon {
    transform: rotate(-90deg);
    /* Rotate to point to submenu */
}

@media (max-width: 768px) {
    .nav-menu {
        overflow-y: auto;
        /* Enable scrolling for the menu part */
        max-height: calc(100dvh - 150px - 80px);
        /* Use dvh for better mobile support */
        /* Subtract logo area and social icons estim */
    }

    .submenu {
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        background-color: #f9f9f9;
        border-top: 1px solid #ddd;
    }

    /* Ensure grid still works but relative */
    #utilities-submenu {
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
    }
}

.submenu li {
    border-bottom: 1px solid #EEEEEE;
    /* Changed */
    background-color: #FFFFFF;
    /* Added */
}

.submenu li .menu-item-content {
    padding: 15px 20px;
    /* Changed */
    font-size: 14px;
    /* Changed */
    color: #5E5E5E;
    /* Added */
}

.submenu li:hover .menu-item-content {
    background-color: #F5F5F5;
    /* Added */
}

/* Specific style for Legacy 2PN (Active state in design) */
.submenu li.feature-item .menu-item-content {
    background-color: #8D6E3F;
    color: white;
}

.submenu li.feature-item .menu-icon i {
    color: white;
}


.social-icons {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    /* Space for close button */
    flex-shrink: 0;
}

.social-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #C4B9A9;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #8D6E3F;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.social-btn:hover {
    background-color: #8D6E3F;
    color: white;
    border-color: #8D6E3F;
}

.pano-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Utilities Overlay Styles */
.utilities-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.utilities-overlay.active {
    opacity: 1;
    visibility: visible;
}

.utilities-container {
    width: 90%;
    max-width: 1000px;
    background-color: transparent;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.utilities-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.close-utilities-btn {
    width: 40px;
    height: 40px;
    background-color: #8D6E3F;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.close-utilities-btn:hover {
    background-color: white;
    color: #8D6E3F;
}

.utilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.utility-item {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.utility-item:hover {
    transform: translateY(-5px);
}

.utility-thumb {
    width: 100%;
    padding-bottom: 66.67%;
    /* 3:2 Aspect Ratio */
    position: relative;
    overflow: hidden;
}

.utility-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.utility-item:hover .utility-thumb img {
    transform: scale(1.1);
}

.utility-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.utility-item:hover .utility-overlay {
    opacity: 1;
}

.utility-overlay i {
    color: white;
    font-size: 30px;
}

.utility-name {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 16px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .utilities-grid {
        grid-template-columns: 1fr;
    }
}

/* Utilities Submenu Grid Styles */
#utilities-submenu {
    display: none;
    /* Hidden by default, overrides .submenu if needed, but important for grid switch */
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    background-color: #f5f5f5;
}

/* Desktop: Make utilities menu a full-height scrollable panel */
@media (min-width: 769px) {
    #utilities-submenu {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 300px;
        /* Sidebar width */
        width: 320px;
        /* Wider panel for grid */
        overflow-y: auto;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
        border-left: 1px solid #ddd;
        z-index: 1001;
        /* Ensure specific grid layout provided here persists */
        grid-template-columns: 1fr 1fr;
        align-content: start;
        /* Don't stretch items to fill height */
    }
}

/* Override the default 'display: block' on hover/open for this specific submenu */
.nav-menu li.has-submenu:hover #utilities-submenu,
.nav-menu li.has-submenu.open #utilities-submenu {
    display: grid;
}

#utilities-submenu li {
    border: none;
    background: transparent;
    padding: 0;
}

.utilities-grid-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.utilities-grid-item:hover {
    transform: translateY(-3px);
}

.utilities-grid-thumb {
    width: 100%;
    aspect-ratio: 3/2;
    overflow: hidden;
}

.utilities-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.utilities-grid-item:hover .utilities-grid-thumb img {
    transform: scale(1.1);
}

.utilities-grid-name {
    padding: 8px 5px;
    font-size: 11px;
    text-align: center;
    font-weight: 600;
    color: #5E5E5E;
    text-transform: uppercase;
    line-height: 1.2;
}

/* HTML Control Bar Styles */
.control-bar-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    /* Default desktop: right anchored */
    width: auto;
    /* Auto width based on content */
    min-width: 280px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    z-index: 1002;
    display: flex;
    justify-content: space-evenly;
    /* Even spacing */
    align-items: center;
    padding: 0 10px;
    gap: 10px;
}

.control-btn {
    width: 30px;
    height: 30px;
    cursor: pointer;
    opacity: 0.7;
    /* Increased base opacity */
    transition: opacity 0.2s;
    background-repeat: no-repeat;
    background-size: cover;
    /* Removed absolute positioning */
    position: relative;
    top: auto;
    transform: none;
}

.control-btn:hover {
    opacity: 1;
}

/* Remove absolute 'left' positioning for buttons since we use Flexbox now */
.cb-prev,
.cb-next,
.cb-sound,
.cb-auto,
.cb-fs,
.cb-help,
.cb-share {
    left: auto;
}

.control-btn img {
    width: 100%;
    height: 100%;
}


/* Responsive Styles */
@media (max-width: 768px) {

    /* Mobile Sidebar */
    .sidebar {
        width: 85%;
        /* Take up most of the screen but leave a peek */
        max-width: 320px;
    }

    /* Mobile Control Bar */
    .control-bar-overlay {
        right: 50%;
        transform: translateX(50%);
        /* Center horizontally */
        bottom: 20px;
        width: 90%;
        max-width: 400px;
        min-width: auto;
        padding: 0 5px;
        gap: 5px;
    }

    .utilities-grid {
        grid-template-columns: 1fr;
    }
}