:root {
    --bg-deep: #05050A;
    --bg-panel: #0D0D16;
    --cyan: #00F3FF;
    --pink: #FF007A;
    --text-main: #E2E8F0;
    --text-muted: #64748B;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* FIX: Locked max-width and overflow to permanently kill horizontal scrolling */
html, body { 
    background-color: var(--bg-deep); 
    color: var(--text-main); 
    font-family: var(--font-body); 
    overflow-x: hidden; 
    width: 100%; 
    max-width: 100vw;
    position: relative;
}

.navbar { position: sticky; top: 0; z-index: 100; background: rgba(5, 5, 10, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--cyan); }
.nav-container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; height: 90px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 2px; color: white; white-space: nowrap; margin-right: 2rem; }
.logo span { color: var(--pink); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 1.2rem; flex-grow: 1; justify-content: center; }
.nav-links a { font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-main); text-decoration: none; transition: all 0.3s; }
.nav-links a:hover { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }

.nav-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; white-space: nowrap; }
.search-bar input { width: 130px; font-size: 0.8rem; padding: 0.4rem 0.8rem; background: transparent; border: 1px solid var(--text-muted); color: white; border-radius: 4px; outline: none; transition: 0.3s; }
.search-bar input:focus { border-color: var(--cyan); }
#auth-btn, .cart-btn, .hamburger-btn { background: transparent; border: none; color: var(--cyan); font-family: var(--font-display); font-weight: bold; font-size: 0.9rem; cursor: pointer; text-transform: uppercase; transition: all 0.3s; }
#auth-btn:hover, .cart-btn:hover { color: var(--pink); text-shadow: 0 0 8px var(--pink); }

.hero { position: relative; padding: 8rem 2rem; text-align: center; border-bottom: 1px solid var(--pink); }
.hero h2 { font-family: var(--font-display); font-size: 4rem; letter-spacing: 2px; margin-bottom: 1rem; line-height: 1.1; }
.text-glitch { color: var(--cyan); position: relative; display: inline-block; }
.hero p { color: var(--text-muted); max-width: 600px; margin: 0 auto 2rem; font-size: 1.2rem; }
.btn-primary { background: transparent; border: 1px solid var(--cyan); color: var(--cyan); padding: 1rem 2rem; font-family: var(--font-display); font-size: 1rem; cursor: pointer; transition: 0.3s; font-weight: bold; }
.btn-primary:hover { background: rgba(0, 243, 255, 0.1); box-shadow: 0 0 20px rgba(0, 243, 255, 0.4); }

.store-layout { max-width: 1400px; margin: 4rem auto; padding: 0 2rem; display: flex; gap: 4rem; }
.sidebar { width: 250px; flex-shrink: 0; }
.filter-group { margin-bottom: 2rem; }
.filter-group h3 { font-family: var(--font-display); color: var(--pink); font-size: 1rem; margin-bottom: 1.5rem; letter-spacing: 1px; }
.filter-list { list-style: none; }
.filter-list li { margin-bottom: 0.8rem; }
.filter-list label { cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; }
.price-slider { width: 100%; margin-bottom: 1rem; }
.price-labels { display: flex; justify-content: space-between; font-family: var(--font-display); color: var(--cyan); font-size: 0.8rem; }

.product-section { flex-grow: 1; }
.category-pills { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.pill { background: transparent; border: 1px solid var(--text-muted); color: var(--text-muted); padding: 0.5rem 1.5rem; border-radius: 20px; cursor: pointer; font-family: var(--font-display); font-size: 0.8rem; transition: 0.3s; }
.pill:hover, .pill.active { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 10px rgba(0,243,255,0.2); }

.grid-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; font-family: var(--font-display); font-size: 0.9rem; color: var(--cyan); }
.sort-dropdown { background: transparent; border: 1px solid var(--text-muted); color: var(--text-main); padding: 0.5rem; font-family: var(--font-body); outline: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2.5rem; }
.product-card { background: var(--bg-panel); border: 1px solid rgba(255,255,255,0.05); padding: 1rem; transition: 0.3s; }
.product-card:hover { border-color: var(--pink); box-shadow: 0 0 20px rgba(255,0,122,0.15); transform: translateY(-5px); }
.image-container { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; margin-bottom: 1rem; border-radius: 4px; }
.image-container img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.4s ease; position: absolute; top: 0; left: 0; }
.img-hover { opacity: 0; }
.product-card:hover .img-hover { opacity: 1; }
.quick-add { position: absolute; bottom: 0; left: 0; width: 100%; padding: 1rem; transform: translateY(100%); transition: transform 0.3s ease; }
.product-card:hover .quick-add { transform: translateY(0); }
.add-to-cart-btn { width: 100%; background: var(--pink); color: white; border: none; padding: 0.8rem; font-family: var(--font-display); font-weight: bold; cursor: pointer; border-radius: 4px; }
.product-category { color: var(--text-muted); font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; }
.product-title { font-size: 1.1rem; margin: 0.5rem 0; color: white; line-height: 1.3; }
.product-price { font-family: var(--font-display); color: var(--cyan); font-weight: bold; }
.load-more-container { text-align: center; margin-top: 4rem; }
.btn-secondary { background: transparent; border: none; color: var(--text-muted); font-family: var(--font-display); cursor: pointer; }
.btn-secondary:hover { color: white; }

/* FIX: Changed 100vw to 100% to stop scrollbar width rendering bugs */
.drawer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(5, 5, 10, 0.7); backdrop-filter: blur(5px); z-index: 900; opacity: 1; transition: opacity 0.3s ease; }
.drawer-overlay.hidden { opacity: 0; pointer-events: none; }
.side-drawer { position: fixed; top: 0; height: 100vh; width: 100%; max-width: 400px; background: var(--bg-panel); border-left: 1px solid var(--cyan); box-shadow: 0 0 30px rgba(0, 243, 255, 0.1); z-index: 1000; display: flex; flex-direction: column; transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.right-drawer { right: 0; transform: translateX(100%); }
.right-drawer.open { transform: translateX(0); }
.left-drawer { left: 0; transform: translateX(-100%); border-left: none; border-right: 1px solid var(--cyan); }
.left-drawer.open { transform: translateX(0); }
.drawer-header { padding: 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: transparent; color: var(--text-muted); border: none; font-family: var(--font-display); cursor: pointer; font-size: 1.2rem; }
.cart-items { flex-grow: 1; padding: 2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1.5rem; }
.cart-item { display: flex; gap: 1rem; background: var(--bg-deep); padding: 1rem; border: 1px solid rgba(255,255,255,0.05); }
.cart-item img { width: 70px; height: 70px; object-fit: cover; border: 1px solid var(--cyan); }
.cart-item-details { flex-grow: 1; }
.cart-item-title { font-family: var(--font-display); font-size: 0.9rem; margin-bottom: 0.25rem; }
.cart-item-price { color: var(--cyan); font-weight: bold; }
.remove-item-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-family: var(--font-display); font-size: 0.8rem; margin-top: 0.5rem; }
.cart-footer { padding: 2rem; border-top: 1px solid rgba(255,255,255,0.1); background: var(--bg-deep); }
.cart-total { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 1.2rem; font-weight: bold; margin-bottom: 1.5rem; }
.inquiry-textarea { width: 100%; height: 80px; background: var(--bg-deep); color: white; border: 1px solid var(--text-muted); padding: 0.8rem; margin-bottom: 1rem; font-family: var(--font-body); font-size: 0.9rem; resize: none; outline: none; }
button.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* FIX: Changed 100vw to 100% on Modal Overlay */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(5, 5, 10, 0.9); backdrop-filter: blur(15px); display: flex; justify-content: center; align-items: center; z-index: 1000; transition: opacity 0.3s ease; }
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-panel { background: var(--bg-panel); border: 1px solid var(--pink); box-shadow: 0 0 30px rgba(255, 0, 122, 0.2); padding: 3rem; width: 100%; max-width: 450px; position: relative; }
.modal-header h2 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 1.5rem; text-align: center; }
.auth-toggle { display: flex; justify-content: center; gap: 1rem; margin-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 1rem; }
.auth-toggle button { background: transparent; border: none; color: var(--text-muted); font-family: var(--font-display); font-size: 0.9rem; cursor: pointer; }
.auth-toggle button.active { color: var(--cyan); text-shadow: 0 0 10px var(--cyan); }
.auth-form input { width: 100%; background: var(--bg-deep); border: 1px solid var(--text-muted); color: white; padding: 0.8rem; margin-bottom: 1.5rem; font-family: var(--font-body); outline: none; }
.w-full { width: 100%; }

.hidden { display: none !important; }
.mobile-only { display: none; }

@media (max-width: 1100px) {
    .hide-on-laptop { display: none; }
    .nav-links { gap: 0.8rem; }
}

@media (max-width: 768px) {
    .desktop-only { display: none; }
    .mobile-only { display: block; }
    
    /* FIX: Properly scale Navbar to prevent pushing width out of bounds */
    .nav-container { padding: 0 0.75rem; height: 70px; gap: 0.5rem; }
    .nav-actions { display: flex !important; gap: 0.4rem; align-items: center; }
    
    /* Shrink the logo text so it wraps naturally without overflowing */
    .logo { font-size: 0.7rem; margin-right: 0; letter-spacing: 0.5px; white-space: normal; line-height: 1.2; }
    
    /* Scale down the action buttons */
    #auth-btn, .cart-btn { font-size: 0.7rem; padding: 0.4rem; }
    .hamburger-btn { font-size: 1.2rem; padding: 0.25rem; min-width: auto; }
    
    .hero { padding: 6rem 1.5rem; }
    .hero h2 { font-size: 2.2rem; }
    
    .store-layout { flex-direction: column; margin-top: 2rem; padding: 0 1rem; gap: 2rem; }
    .sidebar { width: 100%; }
    
    /* FIX: Make Category Pills Swipeable Horizontally on Mobile */
    .category-pills { 
        flex-wrap: nowrap; 
        overflow-x: auto; 
        padding-bottom: 8px; 
        -webkit-overflow-scrolling: touch; 
        scrollbar-width: none; 
        justify-content: flex-start;
        gap: 0.5rem;
    }
    .category-pills::-webkit-scrollbar { display: none; }
    .pill { flex-shrink: 0; white-space: nowrap; padding: 0.4rem 0.8rem; font-size: 0.7rem; }
    
    /* Force grid header to stack vertically */
    .grid-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .sort-dropdown { width: 100%; }
    
    /* Tighten product grid spacing on small devices */
    .grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .product-card { padding: 0.5rem; display: flex; flex-direction: column; justify-content: space-between; }
    
    /* Allow long titles to break instead of expanding the card */
    .product-title { font-size: 0.85rem; margin: 0.25rem 0; line-height: 1.2; word-wrap: break-word; }
    .product-category { font-size: 0.65rem; }
    .product-price { font-size: 0.9rem; }
    
    /* FIX: Force 'Add to Cart' button to always show since there is no hover on mobile */
    .quick-add { 
        transform: translateY(0); 
        background: rgba(13, 13, 22, 0.85); 
        padding: 0.4rem; 
    }
    .add-to-cart-btn { font-size: 0.7rem; padding: 0.6rem 0.25rem; }
    
    /* Ensure modal panels fit on thin screens */
    .modal-panel { padding: 1.5rem; width: 92%; }
    .modal-header h2 { font-size: 1.5rem; }
}