:root {
    --primary: #0f172a;
    /* Deep navy */
    --accent: #2563eb;
    /* Bright blue */
    --accent-light: #dbeafe;
    --secondary: #64748b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-blur: blur(16px);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    background-image: radial-gradient(at 0% 0%, hsla(217, 100%, 97%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 100%, 98%, 1) 0, transparent 50%);
    color: var(--text);
    min-height: 100vh;
}

header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.search-container {
    flex-grow: 1;
    max-width: 400px;
    position: relative;
}

#live-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

#live-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-radius: 1rem;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-hover);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f1f5f9;
}

.search-result-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.search-result-item .info {
    flex-grow: 1;
}

.search-result-item .name {
    font-size: 0.875rem;
    font-weight: 600;
}

.search-result-item .price {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
}

.logo {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--accent);
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

nav a:hover {
    color: var(--primary);
    background: var(--accent-light);
}

.nav-category-bar {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.cat-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.4rem;
    border-radius: 2rem;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.cat-item:hover {
    color: var(--accent);
    background: white;
    border-color: var(--border);
}

.cat-item.active {
    background: var(--primary);
    color: white;
}

/* Dropdown Menu CSS */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 1001;
    border-radius: 8px;
    border: 1px solid var(--border);
    top: 100%;
    left: 0;
    margin-top: 0;
    padding: 0.5rem 0;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

.dropdown-content a {
    color: var(--text);
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: #f8fafc;
    color: var(--accent);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .cat-item {
    color: var(--accent);
    background: white;
    border-color: var(--border);
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.hero-section {
    padding: 4rem 0;
    text-align: center;
    background: transparent;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin: 0;
    color: var(--primary);
}

.hero-section p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 1rem auto 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.product-image-wrapper {
    position: relative;
    padding-top: 75%;
    /* 4:3 Aspect Ratio */
    background: #f1f5f9;
    overflow: hidden;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-cat {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    line-height: 1.4;
    color: var(--primary);
}

.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.product-price-box {
    display: flex;
    flex-direction: column;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--primary);
    margin: 0;
}

.btn {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
    margin-left: 0.5rem;
}

.balance-card {
    background: #f1f5f9;
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    display: flex;
    flex-direction: column;
}

.balance-card small {
    font-size: 0.6rem;
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
}

.balance-card span {
    font-size: 0.875rem;
    font-weight: 800;
}

#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    padding: 0.75rem;
    border-radius: 1.5rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--primary);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Top Bar Styles */
.top-nav-bar {
    background: var(--primary);
    color: white;
    padding: 8px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
}
.top-nav-bar .contact-info { display: flex; gap: 20px; }
.top-nav-bar .site-links { display: flex; gap: 15px; }
.top-nav-bar a { color: white; text-decoration: none; opacity: 0.9; transition: opacity 0.2s; }
.top-nav-bar a:hover { opacity: 1; }

@media (max-width: 768px) {
    .top-nav-bar .site-links { display: none; }
    .top-nav-bar { justify-content: center; }
}

/* Footer Styles */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 4rem 5% 2rem;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-col h4 { color: white; margin-bottom: 1.5rem; font-family: 'Outfit', sans-serif; font-size: 1.1rem; }
.footer-col p { line-height: 1.6; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col ul li a { color: inherit; text-decoration: none; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--accent); }

.footer-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 1rem; }
.footer-contact-item svg { width: 20px; color: var(--accent); flex-shrink: 0; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
}

@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 576px) {
    .footer-grid { grid-template-columns: 1fr; }
}