/* =========================================
   1. VARIABILE & RESET
   ========================================= */
:root {
    --bg-dark: #0f0c29;
    --glass-bg: rgba(30, 30, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shine: rgba(255, 255, 255, 0.05);
    --accent: #00d2ff;
    --accent-grad: linear-gradient(135deg, #00d2ff, #3a7bd5);
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --danger: #ff4757;
    --success: #2ed573;
}

* {
    box-sizing: border-box;
    outline: none;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =========================================
   2. FUNDAL ANIMAT (MESAJE & ORBS)
   ========================================= */
.mesh-bg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -2; background: #050505; overflow: hidden;
}

.orb {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.6;
    animation: floatOrb 15s infinite alternate ease-in-out;
}
.orb-1 { width: 50vw; height: 50vw; background: #4a00e0; top: -10%; left: -10%; }
.orb-2 { width: 40vw; height: 40vw; background: #00d2ff; bottom: -10%; right: -10%; animation-delay: -5s; }

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

.noise {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; opacity: 0.04; pointer-events: none;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
}

/* =========================================
   3. HEADER (STICKY)
   ========================================= */
.glass-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 0;
}

.header-content {
    max-width: 1400px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
}

.logo {
    font-size: 1.8rem; font-weight: 800; letter-spacing: -1px;
    cursor: pointer;
}
.dot { color: var(--accent); }

/* Search Bar */
.search-container {
    flex: 1; max-width: 500px; margin: 0 20px; position: relative;
}
.search-container input {
    width: 100%; padding: 10px 15px 10px 40px;
    border-radius: 30px; border: 1px solid var(--glass-border);
    background: var(--glass-shine); color: #fff; transition: 0.3s;
}
.search-container input:focus { border-color: var(--accent); background: rgba(255,255,255,0.1); }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* User Actions */
.user-actions { display: flex; align-items: center; gap: 20px; }
.action-item { font-size: 1.2rem; cursor: pointer; transition: 0.3s; color: #fff; }
.action-item:hover { color: var(--accent); }
.relative { position: relative; }

.badge {
    position: absolute; top: -8px; right: -8px;
    background: var(--danger); color: white;
    font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; font-weight: bold;
}

/* =========================================
   4. LAYOUT PRINCIPAL (SIDEBAR + SLIDER)
   ========================================= */
/* =========================================
   4. LAYOUT PRINCIPAL (DINAMIC)
   ========================================= */

/* STAREA 1: DEFAULT (HOME) - O singură coloană, totul lat */
.main-layout {
    display: grid; 
    grid-template-columns: 1fr; /* O singură coloană mare */
    gap: 30px;
    max-width: 1400px; margin: 30px auto; padding: 0 20px;
    transition: all 0.3s ease; /* Animație fină la schimbare */
}

/* Sidebar-ul este ASCUNS inițial */
.glass-sidebar {
    display: none; /* Nu ocupă loc */
    background: var(--glass-bg); 
    border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 20px; height: fit-content;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(-20px);
    transition: 0.4s ease;
}

/* STAREA 2: SEARCH ACTIV (Adăugăm clasa asta cu JS) */
.main-layout.search-mode {
    grid-template-columns: 260px 1fr; /* Acum avem loc pentru Sidebar */
}

.main-layout.search-mode .glass-sidebar {
    display: block; /* Apare */
    opacity: 1;
    transform: translateX(0);
}

/* Ascundem Slider-ul în search mode */
.main-layout.search-mode .news-slider {
    display: none;
}

/* Toolbar-ul (sortare) apare doar în search mode sau îl lăsăm mereu? 
   Dacă vrei să apară doar la search, decomentează liniile de jos: */
/* .products-toolbar { display: none; }
.main-layout.search-mode .products-toolbar { display: flex; } 
*/
.glass-sidebar h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 15px; text-transform: uppercase; }

.category-list { list-style: none; }
.category-list li {
    padding: 12px; margin-bottom: 5px; border-radius: 12px;
    cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 10px;
    color: #ccc;
}
.category-list li:hover, .category-list li.active {
    background: rgba(255,255,255,0.1); color: #fff; border: 1px solid var(--glass-border);
}

/* Slider */
.glass-panel {
    border-radius: 20px; overflow: hidden; position: relative; height: 350px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
}
.slider-wrapper { display: flex; height: 100%; transition: transform 0.5s ease; }
.slide {
    min-width: 100%; display: flex; align-items: center; justify-content: space-around;
    padding: 40px;
}
.slide-content h2 { font-size: 3rem; margin-bottom: 10px; background: -webkit-linear-gradient(#fff, #aaa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.cta-btn {
    padding: 10px 25px; background: var(--accent); border: none; border-radius: 20px;
    color: #000; font-weight: bold; cursor: pointer; margin-top: 15px;
}
.slide-image { font-size: 8rem; filter: drop-shadow(0 0 30px rgba(0, 210, 255, 0.3)); }

/* =========================================
   5. PRODUSE (GRID)
   ========================================= */
.products-container { max-width: 1400px; margin: 40px auto; padding: 0 20px 80px; }
.section-title { font-size: 1.8rem; margin-bottom: 25px; border-left: 4px solid var(--accent); padding-left: 15px; }

.products-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px;
}

.product-card {
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 20px; transition: 0.3s;
    display: flex; flex-direction: column; justify-content: space-between;
}
.product-card:hover {
    transform: translateY(-10px); background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-color: var(--accent);
}
.add-btn-small {
    width: 35px; height: 35px; border-radius: 50%; border: none;
    background: #fff; color: #000; cursor: pointer; transition: 0.2s;
}
.add-btn-small:hover { background: var(--accent); transform: scale(1.1); }

/* =========================================
   6. COȘ DE CUMPĂRĂTURI (DRAWER)
   ========================================= */
.cart-drawer {
    position: fixed; top: 0; right: -400px; width: 350px; height: 100vh;
    background: rgba(15, 15, 20, 0.95); backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border); z-index: 2000;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 25px; display: flex; flex-direction: column;
}
.cart-drawer.open { right: 0; }

.cart-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--glass-border); padding-bottom: 20px; margin-bottom: 20px;
}
#cartItems { flex-grow: 1; overflow-y: auto; }

/* =========================================
   7. USER DROPDOWN (HEADER)
   ========================================= */
.user-dropdown-container { position: relative; }

.dropdown-menu {
    position: absolute; top: 40px; right: 0; width: 220px;
    background: rgba(20, 20, 30, 0.95); border: 1px solid var(--glass-border);
    border-radius: 15px; padding: 15px;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: 0.3s; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Apare doar la hover dacă userul e logat */
.user-dropdown-container.logged-in:hover .dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.dropdown-header { border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; margin-bottom: 10px; }
.dropdown-links { list-style: none; }
.dropdown-links li a, .logout-li {
    display: block; padding: 8px; color: #ccc; text-decoration: none; border-radius: 8px; cursor: pointer;
}
.dropdown-links li a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.logout-li:hover { background: rgba(255, 71, 87, 0.2); color: var(--danger); }

/* =========================================
   8. PROFIL PAGE & MODAL
   ========================================= */
.profile-container {
    max-width: 1000px; margin: 50px auto; padding: 20px;
    display: grid; grid-template-columns: 320px 1fr; gap: 30px;
}
.profile-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 30px; backdrop-filter: blur(15px);
}
.avatar-circle {
    width: 100px; height: 100px; background: var(--accent-grad);
    border-radius: 50%; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: #fff; box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}
.info-group { margin-bottom: 15px; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; }
.info-label { color: var(--text-muted); font-size: 0.8rem; }
.company-badge {
    background: #ff9f43; color: #000; padding: 4px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: bold; display: inline-block; margin-top: 5px;
}

/* --- MODAL LOGOUT (Reparat: Default Hidden) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
    z-index: 9999;
    display: none; /* SECRETUL: Ascuns default */
    justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

.glass-modal {
    background: #1a1a24; border: 1px solid var(--glass-border);
    padding: 30px; border-radius: 20px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); width: 320px;
}
.modal-actions { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }
.btn-cancel { padding: 10px 20px; background: rgba(255,255,255,0.1); color: #fff; border:none; border-radius:10px; cursor:pointer;}
.btn-confirm { padding: 10px 20px; background: var(--danger); color: #fff; border:none; border-radius:10px; cursor:pointer;}

@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }

/* --- STIL IMAGINI PRODUSE (INDEX) --- */
.product-img {
    width: 100%;
    height: 180px; /* Înălțime fixă */
    object-fit: cover; /* Taie imaginea să se potrivească perfect */
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Dacă e emoji, îl centrăm */
.product-emoji-placeholder {
    font-size: 3rem; 
    text-align: center; 
    margin-bottom: 15px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* --- SEARCH SUGGESTIONS --- */
.suggestions-dropdown {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0 0 15px 15px;
    z-index: 1001; display: none; /* Ascuns default */
    overflow: hidden;
}

.suggestion-item {
    padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; transition: 0.2s; color: #ccc;
}
.suggestion-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* --- MINI CART DROPDOWN (HOVER) --- */
.cart-container-hover {
    position: relative;
    padding-bottom: 10px; margin-bottom: -10px; /* Zonă tampon pt hover */
}

.mini-cart-dropdown {
    position: absolute;
    top: 100%; right: 0;
    width: 300px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    
    /* Ascuns default */
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1001;
    cursor: default; /* Să nu pară totul un buton */
}

/* Afișăm la hover */
.cart-container-hover:hover .mini-cart-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.mini-cart-list {
    max-height: 250px; overflow-y: auto;
    margin-bottom: 10px;
}

.mini-cart-item {
    display: flex; gap: 10px; align-items: center;
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mini-img {
    width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
    background: rgba(255,255,255,0.05);
}

.mini-details { flex: 1; font-size: 0.85rem; }
.mini-name { color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.mini-price { color: var(--accent); font-weight: bold; }

.mini-total {
    display: flex; justify-content: space-between;
    font-weight: bold; color: #fff; margin: 10px 0; padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mini-btn {
    width: 100%; padding: 8px; background: var(--accent);
    color: #000; border: none; border-radius: 8px; font-weight: bold; cursor: pointer;
    text-align: center; display: block; text-decoration: none;
}
.mini-btn:hover { background: #fff; }

/* --- LAYOUT UPDATE --- */
.content-area {
    display: flex; flex-direction: column; gap: 30px;
}

/* --- FILTRE SIDEBAR --- */
.filter-group h3 {
    font-size: 0.9rem; color: var(--accent); margin-bottom: 15px; text-transform: uppercase;
}

.price-inputs {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.glass-input-small {
    width: 100%; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1); padding: 8px;
    border-radius: 8px; color: #fff; text-align: center;
}

.filter-btn {
    width: 100%; padding: 8px; background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1); color: #fff; cursor: pointer;
    border-radius: 8px; transition: 0.3s;
}
.filter-btn:hover { background: var(--accent); color: #000; }

/* Checkbox Custom */
.custom-checkbox {
    display: flex; align-items: center; gap: 10px; cursor: pointer; color: #ccc; font-size: 0.9rem;
}
.custom-checkbox input { display: none; }
.checkmark {
    width: 18px; height: 18px; background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3); border-radius: 4px;
    position: relative; transition: 0.3s;
}
.custom-checkbox input:checked ~ .checkmark {
    background: var(--accent); border-color: var(--accent);
}
.custom-checkbox input:checked ~ .checkmark::after {
    content: '✔'; position: absolute; left: 4px; top: -2px; color: #000; font-size: 12px;
}

/* --- TOOLBAR PRODUSE (SUS) --- */
.products-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 25px; height: auto; margin-bottom: 0;
}

.sort-container {
    display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #aaa;
}

.glass-select {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; padding: 8px 15px; border-radius: 10px; outline: none; cursor: pointer;
}
.glass-select option { background: #1a1a24; color: #fff; }

/* =========================================
   1. HOVER ELEGANT (FĂRĂ MĂRIRE)
   ========================================= */

/* --- PRODUS CARD --- */
.product-card {
    /* ... restul stilurilor vechi ... */
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
}

.product-card:hover {
    /* SCOATEM transform: translateY sau scale */
    transform: none; 
    
    /* ADĂUGĂM Strălucire și Border */
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2); /* Glow fin */
}

/* --- BUTOANE --- */
.filter-btn:hover, .admin-btn:hover, .main-btn:hover, .mini-btn:hover {
    transform: none; /* Fără mărire */
    background: #fff;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

/* --- CATEGORII SIDEBAR (HOVER) --- */
.category-list li:hover {
    transform: none;
    background: rgba(255,255,255,0.15);
    border-left: 4px solid var(--accent); /* Linie colorată în stânga */
}

/* =========================================
   2. SIDEBAR MAI ÎNALT & AERISIT
   ========================================= */

.glass-sidebar {
    padding: 30px; /* Mai mult spațiu interior */
}

.filter-group {
    margin-bottom: 40px; /* Distanță mare între grupuri */
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05); /* Linie fină separatoare */
}
.filter-group:last-child { border-bottom: none; }

.filter-group h3 {
    font-size: 1rem; 
    margin-bottom: 20px; 
    letter-spacing: 1px;
}

/* Listele de filtre mai înalte */
.category-list li, .brand-list li {
    padding: 15px 20px; /* Butoane mai înalte */
    margin-bottom: 12px; /* Spațiu între ele */
    font-size: 1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: 0.2s;
}

/* Lista Branduri (Nouă) */
.brand-list { list-style: none; }
.brand-list li { display: flex; justify-content: space-between; }
.brand-count { color: #666; font-size: 0.8rem; }

/* Input-uri de preț mai mari */
.price-inputs input {
    padding: 12px;
    font-size: 1rem;
}
.filter-btn {
    padding: 12px;
    margin-top: 15px;
    font-size: 1rem;
    font-weight: bold;
}

/* =========================================
   9. MOBILE
   ========================================= */
@media (max-width: 900px) {
    .products-toolbar { flex-direction: column; gap: 15px; text-align: center; }
    .main-layout { grid-template-columns: 1fr; }
    .glass-sidebar { display: none; } /* Pe mobil ascundem sidebarul momentan */
    .search-container { display: none; }
    .profile-container { grid-template-columns: 1fr; }
    .slide-content h2 { font-size: 2rem; }
}