/* ==========================================================================
   ANTIGRAVITY — Premium Norwegian Home & DIY Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
    --ag-font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --ag-font-heading: 'Outfit', system-ui, -apple-system, sans-serif;

    /* Color Tokens (Light) */
    --ag-primary: #0f172a;
    --ag-primary-hover: #1e293b;
    --ag-accent: #f97316; /* Energetic Nordic Retail Orange */
    --ag-accent-hover: #ea580c;
    --ag-accent-light: #fff7ed;
    --ag-secondary: #0284c7; /* Scandinavian Sea Blue */
    --ag-success: #10b981;
    --ag-warning: #f59e0b;
    --ag-danger: #ef4444;

    --ag-bg-body: #f8fafc;
    --ag-bg-surface: #ffffff;
    --ag-bg-muted: #f1f5f9;
    --ag-border: #e2e8f0;
    --ag-border-light: #f1f5f9;
    --ag-text: #0f172a;
    --ag-text-muted: #64748b;
    --ag-text-light: #94a3b8;

    --ag-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --ag-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --ag-shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.08);
    --ag-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
    --ag-radius: 12px;
    --ag-radius-sm: 8px;
    --ag-radius-lg: 18px;
    --ag-transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Tokens */
[data-bs-theme="dark"] {
    --ag-primary: #f8fafc;
    --ag-primary-hover: #e2e8f0;
    --ag-bg-body: #090d16;
    --ag-bg-surface: #111827;
    --ag-bg-muted: #1f2937;
    --ag-border: #374151;
    --ag-border-light: #1f2937;
    --ag-text: #f9fafb;
    --ag-text-muted: #9ca3af;
    --ag-text-light: #6b7280;
    --ag-shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Global resets & typography */
body {
    font-family: var(--ag-font-sans);
    background-color: var(--ag-bg-body);
    color: var(--ag-text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: var(--ag-font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ag-text);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--ag-transition);
}

/* Header & Top Bar */
.ag-top-bar {
    background: #0b1329;
    color: #e2e8f0;
    font-size: 0.82rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ag-top-bar a {
    color: #cbd5e1;
}
.ag-top-bar a:hover {
    color: #ffffff;
}

.ag-header-main {
    background: var(--ag-bg-surface);
    border-bottom: 1px solid var(--ag-border);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--ag-shadow-sm);
    transition: var(--ag-transition);
}

.ag-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}
.ag-logo-img {
    height: 46px;
    width: auto;
    max-width: 195px;
    object-fit: contain;
    display: block;
    transition: transform var(--ag-transition);
}
.ag-logo:hover .ag-logo-img {
    transform: scale(1.03);
}

/* Light / Dark Mode logo toggle */
.ag-logo-light {
    display: block;
}
.ag-logo-dark {
    display: none;
}
[data-bs-theme="dark"] .ag-logo-light {
    display: none;
}
[data-bs-theme="dark"] .ag-logo-dark {
    display: block;
}

.ag-footer-logo-img {
    height: 52px;
    width: auto;
    max-width: 260px;
    object-fit: contain;
    display: block;
    transition: opacity var(--ag-transition);
}
.ag-footer-logo-img:hover {
    opacity: 0.95;
}

/* Search Bar with live autocomplete */
.ag-search-container {
    position: relative;
    max-width: 600px;
    width: 100%;
}
.ag-search-input {
    border-radius: 50px;
    padding: 12px 20px 12px 46px;
    border: 2px solid var(--ag-border);
    background-color: var(--ag-bg-muted);
    font-size: 0.95rem;
    transition: var(--ag-transition);
}
.ag-search-input:focus {
    background-color: var(--ag-bg-surface);
    border-color: var(--ag-secondary);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}
.ag-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ag-text-muted);
    pointer-events: none;
    font-size: 1.1rem;
}

/* Autocomplete Dropdown */
.ag-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ag-bg-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius);
    margin-top: 8px;
    box-shadow: var(--ag-shadow-lg);
    z-index: 1050;
    max-height: 480px;
    overflow-y: auto;
    display: none;
}
.ag-search-results.active {
    display: block;
}
.ag-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ag-border-light);
    transition: var(--ag-transition);
}
.ag-search-item:hover {
    background: var(--ag-bg-muted);
}
.ag-search-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--ag-border);
}

/* Header Actions */
.ag-header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 50px;
    border: 1px solid transparent;
    color: var(--ag-text);
    font-weight: 600;
    font-size: 0.88rem;
    position: relative;
    transition: var(--ag-transition);
}
.ag-header-btn:hover {
    background: var(--ag-bg-muted);
    border-color: var(--ag-border);
}
.ag-badge-count {
    position: absolute;
    top: 2px;
    right: 4px;
    background: var(--ag-accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mega Menu Bar */
.ag-navbar-categories {
    background: var(--ag-bg-surface);
    border-bottom: 1px solid var(--ag-border);
    padding: 0;
}
.ag-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ag-text);
    border-bottom: 3px solid transparent;
    transition: var(--ag-transition);
}
.ag-nav-link:hover, .ag-nav-link.active {
    color: var(--ag-accent);
    border-bottom-color: var(--ag-accent);
}
.ag-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--ag-bg-surface);
    border-bottom: 2px solid var(--ag-accent);
    box-shadow: var(--ag-shadow-lg);
    padding: 30px;
    display: none;
    z-index: 1040;
}
.dropdown-mega:hover .ag-mega-menu {
    display: block;
}

/* Modern Product Card */
.ag-product-card {
    background: var(--ag-bg-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius);
    padding: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--ag-shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.ag-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ag-shadow-md);
    border-color: #cbd5e1;
}
.ag-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ag-badge-campaign {
    background: var(--ag-accent);
    color: #fff;
}
.ag-badge-new {
    background: var(--ag-secondary);
    color: #fff;
}
.ag-badge-bestseller {
    background: #0f172a;
    color: #fff;
}
.ag-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ag-bg-surface);
    border: 1px solid var(--ag-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ag-text-muted);
    cursor: pointer;
    box-shadow: var(--ag-shadow-sm);
    transition: var(--ag-transition);
}
.ag-wishlist-btn:hover, .ag-wishlist-btn.active {
    color: var(--ag-danger);
    background: #fff;
}

.ag-product-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 85%;
    overflow: hidden;
    border-radius: var(--ag-radius-sm);
    margin-bottom: 12px;
    background: var(--ag-bg-muted);
}
.ag-product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.ag-product-card:hover .ag-product-img {
    transform: scale(1.05);
}

.ag-product-brand {
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ag-text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.ag-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.ag-price-block {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--ag-border);
}
.ag-current-price {
    font-family: var(--ag-font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ag-text);
}
.ag-campaign-price {
    color: var(--ag-accent);
}
.ag-previous-price {
    font-size: 0.85rem;
    color: var(--ag-text-muted);
    text-decoration: line-through;
    margin-right: 6px;
}
.ag-unit-tag {
    font-size: 0.8rem;
    color: var(--ag-text-muted);
    font-weight: normal;
}
.ag-vat-label {
    font-size: 0.72rem;
    color: var(--ag-text-muted);
    display: block;
}

.ag-stock-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 6px;
}
.ag-dot-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--ag-success);
}
.ag-dot-amber {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--ag-warning);
}

.ag-add-cart-btn {
    border-radius: var(--ag-radius-sm);
    font-weight: 700;
    padding: 10px 14px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    background: #0f172a;
    color: #fff;
    border: none;
    transition: var(--ag-transition);
}
.ag-add-cart-btn:hover {
    background: var(--ag-accent);
    color: #fff;
    transform: translateY(-1px);
}

/* Category Cards */
.ag-cat-card {
    background: var(--ag-bg-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius);
    padding: 16px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ag-shadow-card);
    transition: var(--ag-transition);
}
.ag-cat-card:hover {
    transform: translateY(-4px);
    border-color: var(--ag-secondary);
    box-shadow: var(--ag-shadow-md);
}
.ag-cat-thumb {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid var(--ag-border);
}
.ag-cat-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.ag-cat-count {
    font-size: 0.78rem;
    color: var(--ag-text-muted);
}

/* Services Bar */
.ag-services-bar {
    background: var(--ag-bg-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius);
    padding: 24px;
    box-shadow: var(--ag-shadow-sm);
}
.ag-service-item {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ag-service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--ag-bg-muted);
    color: var(--ag-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Calculators Box */
.ag-calc-card {
    background: var(--ag-bg-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius);
    padding: 24px;
    box-shadow: var(--ag-shadow-sm);
}
.ag-calc-result-box {
    background: var(--ag-accent-light);
    border: 1px solid #fed7aa;
    border-radius: var(--ag-radius-sm);
    padding: 16px;
    margin-top: 20px;
}

/* Free Shipping Bar */
.ag-free-shipping-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--ag-radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.ag-free-shipping-progress {
    height: 8px;
    border-radius: 4px;
    background: #dcfce7;
    overflow: hidden;
    margin-top: 8px;
}
.ag-free-shipping-bar {
    background: var(--ag-success);
    height: 100%;
    transition: width 0.4s ease;
}

/* Mobile Bottom Navigation */
.ag-mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: var(--ag-bg-surface);
    border-top: 1px solid var(--ag-border);
    z-index: 1030;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}
.ag-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ag-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    gap: 3px;
    position: relative;
}
.ag-bottom-nav-item.active, .ag-bottom-nav-item:hover {
    color: var(--ag-accent);
}
.ag-bottom-nav-item i {
    font-size: 1.25rem;
}

@media (max-width: 991.98px) {
    .ag-mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 65px;
    }
    .ag-navbar-categories {
        display: none;
    }
}

/* Footer */
.ag-footer {
    background: #090f1d;
    color: #cbd5e1;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ag-footer h5 {
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 20px;
}
.ag-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ag-footer li {
    margin-bottom: 10px;
}
.ag-footer a {
    color: #94a3b8;
    font-size: 0.9rem;
}
.ag-footer a:hover {
    color: #ffffff;
}
