/* ============================================
   SCAN-MÖRE MASKINER
   Färger: gul #FFD500, röd #D50000, svart #1a1a1a
   ============================================ */
:root {
    --sm-yellow: #FFD500;
    --sm-yellow-dark: #E6C000;
    --sm-red: #D50000;
    --sm-red-dark: #A80000;
    --sm-black: #1a1a1a;
    --sm-gray-900: #2c2c2c;
    --sm-gray-700: #4a4a4a;
    --sm-gray-500: #6b7280;
    --sm-gray-300: #d1d5db;
    --sm-gray-100: #f4f5f7;
    --sm-white: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--sm-black);
    background: var(--sm-gray-100);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sm-red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; }
button { font-family: inherit; cursor: pointer; }
code { background: #f0f1f4; padding: 2px 5px; border-radius: 3px; font-size: 0.9em; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* HEADER – vit, minimal */
.site-header {
    background: var(--sm-black);
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 20px;
}
.header-home {
    font-weight: 800;
    font-size: 16px;
    color: var(--sm-white);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.header-home:hover { text-decoration: none; color: var(--sm-yellow); }
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a { color: var(--sm-white); font-weight: 700; font-size: 15px; }
.main-nav a:hover { color: var(--sm-yellow); text-decoration: none; }
.main-nav .nav-phone {
    background: var(--sm-red);
    color: var(--sm-white);
    padding: 10px 18px;
    border-radius: 4px;
    font-weight: 700;
}
.main-nav .nav-phone:hover { background: var(--sm-red-dark); color: var(--sm-white); text-decoration: none; }

/* HERO – gul bakgrund, loggan smälter in */
.hero {
    background: var(--sm-yellow);
    color: var(--sm-black);
    padding: 24px 0;
    margin-bottom: 24px;
    border-bottom: 4px solid var(--sm-red);
}
.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.hero-text { flex: 1; }
.hero-text h1 { font-size: 34px; margin-bottom: 8px; font-weight: 800; letter-spacing: -0.01em; color: var(--sm-black); }
.hero-text p { font-size: 16px; color: var(--sm-gray-700); margin: 0; }
.hero-logo {
    flex: 0 0 auto;
}
.hero-logo img {
    height: 110px;
    width: auto;
    display: block;
}
@media (max-width: 700px) {
    .hero-inner { flex-direction: column; align-items: center; gap: 16px; }
    .hero-logo img { height: 75px; }
}

/* FILTERS */
.filter-bar {
    background: var(--sm-white);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    border-top: 3px solid var(--sm-yellow);
}
.filter-bar label {
    font-size: 13px;
    font-weight: 700;
    color: var(--sm-gray-700);
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.filter-bar input[type="text"], .filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--sm-gray-300);
    border-radius: 4px;
    font-size: 14px;
    background: var(--sm-white);
    min-width: 180px;
}
.filter-bar input[type="text"]:focus, .filter-bar select:focus {
    outline: 2px solid var(--sm-red);
    outline-offset: -1px;
    border-color: var(--sm-red);
}
.filter-bar .result-count { margin-left: auto; color: var(--sm-gray-500); font-size: 13px; }

/* AD GRID */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.listing-card {
    background: var(--sm-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    border: 1px solid transparent;
}
.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.14);
    border-color: var(--sm-yellow);
    text-decoration: none;
}
.listing-card-image {
    width: 100%;
    height: 0;
    padding-bottom: 75%;
    background: #eef0f4 center/cover no-repeat;
    position: relative;
}
.listing-card-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 13px;
}
.listing-card-group {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--sm-yellow);
    color: var(--sm-black);
    font-size: 11px;
    font-weight: 800;
    padding: 5px 11px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.listing-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.listing-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sm-black);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-card-misc {
    font-size: 13px;
    color: var(--sm-gray-500);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-card-price {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f1f4;
    font-size: 19px;
    font-weight: 800;
    color: var(--sm-red);
}
.listing-card-price.no-price { color: var(--sm-gray-500); font-size: 14px; font-weight: 600; }

.empty-state { text-align: center; padding: 80px 20px; color: var(--sm-gray-500); }

.gallery { background: #000; position: relative; }
.breadcrumb { padding: 16px 0; color: var(--sm-gray-500); font-size: 13px; }
.breadcrumb a { color: var(--sm-gray-500); }
.breadcrumb a:hover { color: var(--sm-red); }
.breadcrumb .sep { margin: 0 8px; }

.product-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    margin-bottom: 40px;
}
@media (max-width: 900px) { .product-layout { grid-template-columns: 1fr; } }

.product-main {
    background: var(--sm-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.gallery { background: var(--sm-black); }
.gallery-main { width: 100%; height: 0; padding-bottom: 75%; background: var(--sm-black) center/contain no-repeat; }
.gallery-thumbs { display: flex; gap: 6px; padding: 8px; background: var(--sm-black); overflow-x: auto; }
.gallery-thumbs button {
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    border: 2px solid transparent;
    padding: 0;
    background: var(--sm-black) center/cover no-repeat;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity .15s, border-color .15s;
}
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs button.active { opacity: 1; border-color: var(--sm-yellow); }

.product-info { padding: 24px; }
.product-group-badge {
    display: inline-block;
    background: var(--sm-yellow);
    color: var(--sm-black);
    font-size: 11px;
    font-weight: 800;
    padding: 5px 11px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}
.product-title { font-size: 28px; font-weight: 800; margin: 0 0 8px; line-height: 1.2; letter-spacing: -0.01em; }
.product-misc {
    color: var(--sm-gray-700);
    font-size: 15px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #fffbe6;
    border-left: 3px solid var(--sm-yellow);
    border-radius: 0 4px 4px 0;
}
.product-description {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e4e6eb;
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 14.5px;
    color: #333;
}
.product-description h2 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--sm-black);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
/* Specifikationstabell */
.spec-table-wrap {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e4e6eb;
}
.spec-table-heading {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--sm-black);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.spec-table tr:nth-child(even) { background: #f9fafb; }
.spec-table tr:hover { background: #fffbe6; }
.spec-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #e4e6eb;
    vertical-align: top;
    line-height: 1.5;
}
.spec-key {
    font-weight: 600;
    color: var(--sm-gray-700);
    width: 45%;
    white-space: nowrap;
}
.spec-val {
    color: var(--sm-black);
}

/* CONTACT SIDEBAR */
.contact-sidebar {
    background: var(--sm-white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: 24px;
    align-self: start;
    position: sticky;
    top: 100px;
    border-top: 4px solid var(--sm-yellow);
}
.contact-price { border-bottom: 1px solid #e4e6eb; padding-bottom: 16px; margin-bottom: 20px; }
.contact-price-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sm-gray-500);
    font-weight: 700;
    margin-bottom: 4px;
}
.contact-price-value { font-size: 34px; font-weight: 800; color: var(--sm-red); line-height: 1.1; letter-spacing: -0.01em; }
.contact-price-value.no-price { color: var(--sm-black); font-size: 20px; }
.contact-heading { font-size: 17px; font-weight: 800; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.02em; }
.contact-sub { font-size: 13px; color: var(--sm-gray-500); margin-bottom: 16px; }
.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-form label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--sm-gray-700);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--sm-gray-300);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: var(--sm-white);
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: 2px solid var(--sm-red);
    outline-offset: -1px;
    border-color: var(--sm-red);
}
.contact-form textarea { resize: vertical; min-height: 100px; }
.contact-form button {
    background: var(--sm-red);
    color: var(--sm-white);
    border: none;
    padding: 13px 20px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    margin-top: 4px;
    transition: background .15s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.contact-form button:hover { background: var(--sm-red-dark); }

.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #fffbe6; color: #5a4a00; border: 1px solid var(--sm-yellow); }

/* FOOTER */
.site-footer {
    background: var(--sm-black);
    color: #c8ccd3;
    padding: 30px 0;
    margin-top: 40px;
    font-size: 13px;
    border-top: 4px solid var(--sm-yellow);
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.site-footer a { color: var(--sm-yellow); }
.site-footer p { margin: 0; }

/* ADMIN */
.admin-body { background: var(--sm-gray-100); }
.admin-header {
    background: var(--sm-black);
    color: var(--sm-white);
    padding: 14px 0;
    margin-bottom: 24px;
    border-bottom: 3px solid var(--sm-yellow);
}
.admin-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-size: 18px; margin: 0; color: var(--sm-white); }
.admin-header h1 .accent { color: var(--sm-yellow); }
.admin-nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.admin-nav a { color: #c8ccd3; font-size: 14px; font-weight: 500; }
.admin-nav a:hover { color: var(--sm-yellow); text-decoration: none; }
.admin-nav a.current { color: var(--sm-yellow); font-weight: 700; }

.admin-card {
    background: var(--sm-white);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 20px;
}
.admin-card h2 { font-size: 20px; margin-bottom: 16px; font-weight: 800; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e4e6eb;
    font-size: 14px;
    vertical-align: middle;
}
.admin-table th {
    background: #f9fafb;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sm-gray-500);
}
.admin-table .thumb { width: 60px; height: 45px; background: #eef0f4 center/cover no-repeat; border-radius: 4px; }

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}
.btn-primary { background: var(--sm-red); color: var(--sm-white); }
.btn-primary:hover { background: var(--sm-red-dark); text-decoration: none; color: var(--sm-white); }
.btn-secondary { background: var(--sm-white); color: var(--sm-gray-700); border: 1px solid var(--sm-gray-300); }
.btn-secondary:hover { background: #f3f4f6; text-decoration: none; color: var(--sm-gray-700); }
.btn-yellow { background: var(--sm-yellow); color: var(--sm-black); }
.btn-yellow:hover { background: var(--sm-yellow-dark); text-decoration: none; color: var(--sm-black); }
.btn-danger { background: #dc2626; color: var(--sm-white); }
.btn-danger:hover { background: #b91c1c; text-decoration: none; color: var(--sm-white); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--sm-gray-700); margin-bottom: 6px; }
.form-group input[type="text"], .form-group input[type="number"], .form-group input[type="password"],
.form-group input[type="email"], .form-group select, .form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--sm-gray-300);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: 2px solid var(--sm-red);
    outline-offset: -1px;
    border-color: var(--sm-red);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group .help { font-size: 12px; color: var(--sm-gray-500); margin-top: 4px; }

.image-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.image-preview-item {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%;
    background: #eef0f4 center/cover no-repeat;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e4e6eb;
}
.image-preview-item .remove {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(213, 0, 0, 0.95);
    color: var(--sm-white);
    border: none;
    width: 26px; height: 26px;
    border-radius: 50%;
    font-size: 16px; line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.login-box {
    max-width: 400px;
    margin: 80px auto;
    background: var(--sm-white);
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-top: 4px solid var(--sm-yellow);
}
.login-box h1 { text-align: center; margin-bottom: 24px; font-size: 22px; font-weight: 800; }
.login-box .logo-small { text-align: center; margin-bottom: 20px; }
.login-box .logo-small img { height: 60px; margin: 0 auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--sm-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border-left: 4px solid var(--sm-yellow);
}
.stat-value { font-size: 30px; font-weight: 800; color: var(--sm-red); }
.stat-label { font-size: 13px; color: var(--sm-gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; font-weight: 600; }

.group-list { list-style: none; padding: 0; margin: 0 0 16px; }
.group-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 6px;
}
.group-list .count { font-size: 12px; color: var(--sm-gray-500); margin-right: 12px; }
