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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    color: #1a1a2e;
    min-height: 100vh;
    line-height: 1.5;
}

/* HEADER */
.site-header {
    background: linear-gradient(135deg, #2d5a3d 0%, #1a3a25 100%);
    padding: 8px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position:sticky;
    top: 0;
    z-index: 100;
}

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

.cart-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.cart-link:hover {
    background: rgba(255,255,255,0.25);
}

.site-logo {
    height: 90px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.05);
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* LAYOUT */
.container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    max-width: 1500px;
    margin: 32px auto;
    padding: 0 24px;
}

/* SIDEBAR */
.sidebar {
    background: #ffffff;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    height: fit-content;
    position: sticky;
    top: 130px;
}

.sidebar h3 {
    margin: 20px 0 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.sidebar h3:first-child {
    margin-top: 0;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.checkbox:hover {
    background: #f1f5f9;
}

.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2d5a3d;
    cursor: pointer;
}

.sidebar select,
.sidebar input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.sidebar select:focus,
.sidebar input[type="text"]:focus {
    outline: none;
    border-color: #2d5a3d;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(45, 90, 61, 0.1);
}

.brand-dropdown {
    position: relative;
}

.brand-dropdown #brand-search {
    width: 100%;
}

.brand-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.brand-list.open {
    display: block;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2d5a3d 0%, #1a3a25 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(45, 90, 61, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 61, 0.4);
}

.btn-secondary {
    display: block;
    text-align: center;
    padding: 12px 20px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* MAIN */
.result-header {
    margin-bottom: 24px;
    font-size: 16px;
    color: #475569;
    background: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.result-header strong {
    color: #2d5a3d;
    font-weight: 700;
}

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* CARD */
.card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.image-wrapper {
    height: 200px;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.image-wrapper img {
    max-height: 160px;
    max-width: 85%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card:hover .image-wrapper img {
    transform: scale(1.05);
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    min-height: 44px;
    line-height: 1.4;
    color: #1a1a2e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-logo {
    height: 28px;
    max-width: 80px;
    object-fit: contain;
    margin-bottom: 8px;
}

.meta {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
    font-weight: 500;
}

/* PRIS */
.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.promo-price {
    font-size: 26px;
    font-weight: 800;
    color: #dc2626;
    letter-spacing: -0.5px;
}

.unit {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* ORD PRIS + MAX */
.ordinary-price {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.product-savings {
    font-size: 13px;
    color: #d38585;
    font-weight: 600;
    margin-top: 4px;
}

.limit {
    font-size: 12px;
    color: #f59e0b;
    font-weight: 600;
    background: #fef3c7;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 8px;
}

/* BADGES */
.badge {
    display: inline-block;
    margin-top: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border-radius: 8px;
    font-weight: 600;
}

/* PROMO TAG (om ni vill aktivera den) */
.promo-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    z-index: 10;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 20px;
        margin: 16px auto;
    }

    .sidebar {
        position: static;
        order: -1;
    }

    .site-logo {
        height: 60px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 500px) {
    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .card h4 {
        font-size: 13px;
        min-height: 36px;
    }

    .promo-price {
        font-size: 20px;
    }

    .image-wrapper {
        height: 140px;
    }

    .card-body {
        padding: 14px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ADD TO CART BUTTON */
.btn-add-cart {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: auto;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2d5a3d 0%, #1a3a25 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}


.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.3);
}

/* CART PAGE */
.cart-container {
    max-width: 900px;
    margin: 32px auto;
    padding: 0 24px;
}

.cart-container h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a1a2e;
}

.cart-empty {
    background: #ffffff;
    padding: 60px 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.cart-empty p {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 24px;
}

.cart-store-section {
    background: #ffffff;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    overflow: hidden;
}

.cart-store-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.cart-store-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.cart-store-header h2 {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.cart-store-totals {
    text-align: right;
}

.cart-store-subtotal {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2d5a3d;
}

.cart-store-savings {
    display: block;
    font-size: 13px;
    color: #059669;
    margin-top: 2px;
}

.cart-products {
    padding: 8px 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 8px;
    padding: 4px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.cart-item-brand {
    font-size: 12px;
    color: #94a3b8;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 700;
    color: #dc2626;
    min-width: 80px;
    text-align: right;
}

.cart-item-remove {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cart-item-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

.cart-summary {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.cart-total span:first-child {
    font-size: 22px;
    font-weight: 600;
    color: #64748b;
}

.cart-total-amounts {
    text-align: right;
}

.cart-total-price {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #2d5a3d;
}

.cart-total-savings {
    display: block;
    font-size: 14px;
    color: #059669;
    margin-top: 4px;
}

.cart-actions {
    display: flex;
    gap: 12px;
}

.cart-actions .btn-secondary {
    flex: 1;
}

.btn-danger {
    flex: 1;
    display: block;
    text-align: center;
    padding: 12px 20px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #fecaca;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #fecaca;
    border-color: #fca5a5;
}
