/* css/style.css */
:root {
    --bg-color: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #fbbf24;
    --success: #10b981;
    --border: rgba(255, 255, 255, 0.1);
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --container-width: 1200px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
button { cursor: pointer; border: none; font-family: inherit; }

/* --- LIQUID GLASS NAVBAR --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
}

.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--text-main); object-fit: cover; }
.nav-brand { font-size: 1.25rem; font-weight: 700; color: #fff; letter-spacing: -0.5px; }

.nav-dropdown { position: relative; display: inline-block; }

/* The invisible bridge that prevents hover from breaking */
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-dropbtn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.nav-dropbtn:hover { background: rgba(255, 255, 255, 0.1); }

.nav-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px); /* Gap applied here instead of margin */
    background: var(--bg-card);
    min-width: 140px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    overflow: hidden;
    z-index: 101; /* Ensure it stays above content */
}

/* Allow mouse hover OR the new JS click class to keep it open */
.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown-content.show { display: block; }

.nav-dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.nav-dropdown-content a:hover { background: var(--bg-card-hover); }

/* --- LAYOUT --- */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
header { padding: 40px 0; margin-bottom: 40px; }
.header-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
h1 { font-size: 2.5rem; font-weight: 800; background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -1px; }
.subtitle { color: var(--text-muted); margin-top: 10px; font-size: 1.1rem; }

/* --- FILTERS --- */
.controls { display: flex; gap: 15px; align-items: center; }
.toggle-btn { background: var(--bg-card); color: var(--text-muted); padding: 10px 20px; border-radius: 50px; font-weight: 600; border: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.toggle-btn.active { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }
.toggle-btn:hover { transform: translateY(-2px); }

/* --- GRID SYSTEM --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin-bottom: 60px; }

/* --- CARDS --- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 25px; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; display: flex; flex-direction: column; cursor: pointer; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); border-color: var(--text-muted); background: var(--bg-card-hover); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.card-title { font-size: 1.25rem; font-weight: 700; }
.card-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }
.chip.os { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.chip.eu { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.product-list-preview { margin-top: auto; display: flex; gap: 8px; padding-top: 15px; border-top: 1px solid var(--border); }
.logo-box { width: 40px; height: 40px; border-radius: 8px; background: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 4px; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.logo-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-primary); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: bold; color: white; text-transform: uppercase; flex-shrink: 0; }

/* --- OVERLAY / MODAL --- */
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px); z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; padding: 20px; }
.overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--bg-card); width: 100%; max-width: 800px; max-height: 90vh; border-radius: 24px; border: 1px solid var(--border); overflow-y: auto; transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
.overlay.active .modal { transform: scale(1); }
.modal-header { padding: 30px; background: linear-gradient(to right, var(--bg-card), #162032); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.breadcrumb { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; display: block; }
.close-btn { background: rgba(255, 255, 255, 0.1); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; transition: 0.2s; }
.close-btn:hover { background: rgba(255, 255, 255, 0.2); }
.modal-content { padding: 30px; }
.product-detail-header { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; }
.product-logo-lg-box { width: 80px; height: 80px; border-radius: 16px; background: white; display: flex; align-items: center; justify-content: center; padding: 8px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); }
.product-logo-lg-box img { width: 100%; height: 100%; object-fit: contain; }
.product-logo-lg-fallback { width: 80px; height: 80px; border-radius: 20px; background: var(--accent-primary); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: white; font-weight: bold; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); }
.flag-icon { margin-right: 6px; }
.big-tech-alt { margin-top: 20px; padding: 15px; background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.2); border-radius: 12px; color: #fbbf24; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; }
.pricing-section { margin-top: 30px; padding: 20px; background: rgba(255, 255, 255, 0.03); border-radius: 12px; border: 1px solid var(--border); }
.btn-primary { display: inline-block; background: var(--accent-primary); color: white; padding: 12px 24px; border-radius: 8px; font-weight: 600; margin-top: 20px; text-align: center; width: 100%; }
.btn-primary:hover { background: #2563eb; }
.back-nav { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; color: var(--accent-primary); font-weight: 600; cursor: pointer; }

/* --- FOOTER --- */
.modern-footer { margin-top: 60px; padding: 40px 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); }
.footer-links { display: flex; justify-content: center; gap: 30px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-links a { font-weight: 600; color: var(--text-main); }
.footer-links a:hover { color: var(--accent-primary); }

@media (max-width: 768px) {
    .navbar { padding: 15px 20px; }
    h1 { font-size: 1.8rem; }
    .modal-content { padding: 20px; }
    .product-detail-header { flex-direction: column; align-items: flex-start; }
}