:root {
    --bg-main: #121212;
    --bg-sidebar: #1e1e1e;
    --bg-card: #2a2a2a;
    --accent: #713497;
    --accent-hover: #5a2979;
    --text: #ffffff;
    --text-muted: #aaaaaa;
}

body {
    margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg-main); color: var(--text);
    display: flex; height: 100vh; overflow: hidden;
}

/* --- FLOATING CART --- */
.floating-cart-btn {
    position: fixed; top: 20px; right: 30px;
    background: var(--accent); color: white;
    padding: 12px 25px; border-radius: 30px; border: none;
    font-weight: bold; font-size: 15px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6); z-index: 5000;
    transition: transform 0.2s, background 0.2s;
}
.floating-cart-btn:hover { background: var(--accent-hover); transform: scale(1.05); }

/* --- SIDEBAR & MOBILE HEADER --- */
.mobile-header { display: none; background: var(--bg-sidebar); padding: 15px; border-bottom: 1px solid #333; }
#mobile-menu-btn {
    background: var(--accent); color: white; border: none;
    padding: 10px 18px; border-radius: 6px; font-weight: bold; font-size: 16px;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.sidebar { width: 300px; background: var(--bg-sidebar); display: flex; flex-direction: column; border-right: 1px solid #333; transition: transform 0.3s ease; z-index: 1000;}
.logo-container { padding: 20px; text-align: center; border-bottom: 1px solid #333; }
.logo-container img { max-width: 80%; }
.sidebar-actions { padding: 20px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid #333; }
.action-btn { background: var(--accent); color: var(--text); border: none; padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.2s; }
.action-btn:hover { background: var(--accent-hover); }
.home-action { background: #333; }
.home-action:hover { background: #444; }
#search-bar { padding: 10px; border-radius: 6px; border: 1px solid #444; background: #222; color: white; }

/* Treeview */
.tree-view { flex: 1; overflow-y: auto; padding: 10px 0; }
.tree-list { list-style: none; padding-left: 0; margin: 0; }
.tree-list .tree-list { padding-left: 15px; border-left: 1px solid #333; margin-left: 10px; }
.tree-item-wrapper { padding: 6px 15px; cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none; color: #ccc;}
.tree-item-wrapper:hover { background: rgba(255,255,255,0.05); color: white; }
.tree-item-wrapper.active-node { color: var(--accent); font-weight: bold; }
.tree-toggle { width: 15px; text-align: center; font-size: 10px; color: #888; }
.tree-children { display: none; }
li.expanded > .tree-children { display: block; }

/* Contact Section & Copyright */
.contact-info { padding: 20px; font-size: 13px; color: var(--text-muted); border-top: 1px solid #333; }
.contact-info p { margin: 5px 0; }
.copyright-text { margin-top: 15px !important; font-size: 11px; color: #777; }

/* --- MAIN GRID --- */
.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.breadcrumb { padding: 20px 30px; font-size: 18px; font-weight: bold; border-bottom: 1px solid #333; background: var(--bg-main); position: sticky; top: 0; z-index: 10;}
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; padding: 30px; }

.card { background: var(--bg-card); border-radius: 8px; overflow: hidden; border: 1px solid #333; transition: transform 0.2s; display: flex; flex-direction: column;}
.card:hover { transform: translateY(-3px); }
.card.folder, .card.back-card { cursor: pointer; padding: 30px 10px; text-align: center; justify-content: center; }
.card.back-card { background: #222; }
.folder-icon { font-size: 40px; margin-bottom: 10px; display: block; }

.card-img-wrapper { height: 200px; background: #111; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 5px;}
.card-img-wrapper img { max-width: 100%; max-height: 100%; object-fit: contain; }

.card-info { padding: 15px; text-align: center; }
.card-filename { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- LIGHTBOX --- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 9999; display: none; grid-template-rows: 70px 1fr 50px; }
.lightbox.active { display: grid !important; }

/* Lightbox Topbar with Centered Text */
.lightbox-topbar { 
    grid-row: 1; 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    padding: 0 20px; 
    background: rgba(0,0,0,0.8); 
    position: relative; 
}
.lb-filename { 
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px; 
    font-weight: bold; 
    text-align: center;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 50%; 
}
.lb-actions { display: flex; align-items: center; gap: 15px; }
.close-btn { background: none; border: none; color: white; font-size: 40px; cursor: pointer; line-height: 1; }

.lightbox-image-area { grid-row: 2; position: relative; width: 100%; height: 100%; overflow: hidden; }
.lightbox-image-area img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; display: block; }

.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: white; border: none; padding: 15px 20px; font-size: 24px; cursor: pointer; border-radius: 4px; z-index: 10;}
.nav-arrow:hover { background: rgba(0,0,0,0.8); }
.nav-arrow.left { left: 20px; } .nav-arrow.right { right: 20px; }

/* --- MODALS & CART --- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 10000; display: none; justify-content: center; align-items: center; }
.modal.active { display: flex; }
.modal-content { background: var(--bg-sidebar); padding: 30px; border-radius: 10px; width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; position: relative; border: 1px solid #444;}
.close-modal { position: absolute; top: 20px; right: 20px; font-size: 30px; cursor: pointer; line-height: 1; }
.cart-list { margin: 20px 0; border-top: 1px solid #444; border-bottom: 1px solid #444; max-height: 200px; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid #333; cursor: pointer;}
.cart-item:hover { background: #333; }
.remove-item { color: #e74c3c; background: none; border: none; cursor: pointer; font-size: 18px; }

.checkout-form { display: flex; flex-direction: column; gap: 12px; }
.checkout-form input, .checkout-form select { padding: 12px; border-radius: 6px; border: 1px solid #444; background: #222; color: white; }
.order-btn { padding: 15px; background: var(--accent); color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 16px; margin-top: 10px;}
.order-btn:hover { background: var(--accent-hover); }

/* Bank Info */
.bank-details { background: #111; padding: 15px; border-radius: 6px; margin-top: 15px; border: 1px solid #333;}
.copy-btn { background: var(--accent); color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 12px;}
.copy-btn:hover { background: var(--accent-hover); }

.hover-preview { position: fixed; max-width: 250px; border: 2px solid white; border-radius: 6px; z-index: 10001; display: none; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,0.8); }

/* --- MOBILE --- */
@media (max-width: 768px) {
    body { flex-direction: column; }
    .floating-cart-btn { top: 12px; right: 15px; padding: 10px 15px; font-size: 13px; }
    .mobile-header { display: flex; }
    .sidebar { position: fixed; top: 0; bottom: 0; left: -300px; z-index: 5000; }
    .sidebar.open { left: 0; }
    .grid-container { grid-template-columns: repeat(2, 1fr); padding: 15px; gap: 10px;}
    .card-img-wrapper { height: 130px; }
    .nav-arrow.left { left: 5px; padding: 10px 15px;} .nav-arrow.right { right: 5px; padding: 10px 15px;}
    .lightbox { grid-template-rows: 60px 1fr 50px; }
    .lb-filename { max-width: 40%; font-size: 14px; }
}