﻿/* ===== CJMA – Claes Johansson Mark & Anläggning ===== */

/* Släpvagns-ikon (inline SVG) */
.trailer-icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.15em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='6' width='16' height='8' rx='1.5' fill='black'/%3E%3Ccircle cx='8' cy='16' r='2' fill='black'/%3E%3Ccircle cx='16' cy='16' r='2' fill='black'/%3E%3Crect x='0' y='10' width='5' height='2' rx='1' fill='black'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='6' width='16' height='8' rx='1.5' fill='black'/%3E%3Ccircle cx='8' cy='16' r='2' fill='black'/%3E%3Ccircle cx='16' cy='16' r='2' fill='black'/%3E%3Crect x='0' y='10' width='5' height='2' rx='1' fill='black'/%3E%3C/svg%3E") no-repeat center;
}

:root {
    --cjma-blue: #0878C4;           /* Primär – knappar, ikoner, accenter */
    --cjma-blue-dark: #0a3d62;      /* Mörk – navbar, footer */
    --cjma-blue-bg: #e8f1f8;        /* Ljus – subtila bakgrunder */
    --cjma-sand: #9FCAE8;           /* Accent – CTA, kampanj (ljusblå) */
    --cjma-sand-light: #edf4f9;     /* Ljus blågrå – trust-bar, steg */
    --cjma-light: #f5f7fa;          /* Off-white gråblå – sektionsbakgrund */
    --cjma-dark: #2b2b2b;           /* Text */
    --cjma-grey: #6c757d;           /* Grå accenter */

    /* Bakåtkompatibla alias */
    --cjma-green: var(--cjma-blue);
    --cjma-green-dark: var(--cjma-blue-dark);
    --cjma-green-bg: var(--cjma-blue-bg);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--cjma-dark);
}

/* Navbar */
.navbar-cjma {
    background: var(--cjma-green-dark) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow-anchor: none;
}

/* Logga */
.navbar-logo {
    height: 42px;
    width: auto;
    transition: height 0.35s ease, transform 0.35s ease;
}

/* Startsidan: stor logga som krymper vid scroll */
body[data-page="home"] .navbar-logo {
    height: 84px;
}
body[data-page="home"].scrolled .navbar-logo {
    height: 42px;
}

/* Navbar padding-transition för smidig krympning */
.navbar-cjma {
    transition: padding 0.35s ease;
}
body[data-page="home"] .navbar-cjma {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}
body[data-page="home"].scrolled .navbar-cjma {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}
.footer-logo { height: 55px; width: auto; }
.hero-logo   { height: 60px; width: auto; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

/* Hero – videobakgrund */
.hero-video {
    position: relative;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: 0;
}

.hero-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(10, 61, 98, 0.85) 0%,
        rgba(8, 120, 196, 0.72) 100%
    );
    z-index: 1;
}

.hero-video-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 4rem 0 3.5rem;
}

/* Fallback om video inte finns / gammal .hero klass */
.hero {
    background: linear-gradient(160deg, var(--cjma-green-dark) 0%, var(--cjma-green) 100%);
    color: white;
    padding: 4rem 0 3.5rem;
}

.hero h1,
.hero-video-content h1 { font-size: 2.5rem; font-weight: 800; }

.hero .lead,
.hero-video-content .lead { font-size: 1.15rem; opacity: 0.9; }

.hero .btn-order,
.hero-video-content .btn-order {
    font-size: 1.3rem;
    padding: 0.8rem 2.5rem;
    background: white;
    border: none;
    color: var(--cjma-blue-dark);
    font-weight: 700;
    border-radius: 50px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero .btn-order:hover,
.hero-video-content .btn-order:hover {
    transform: scale(1.05);
    background: var(--cjma-sand);
    color: var(--cjma-blue-dark);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.hero .btn-calc,
.hero-video-content .btn-calc {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero .btn-calc:hover,
.hero-video-content .btn-calc:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.6);
    color: white;
    transform: translateY(-2px);
}

/* Trust-bar */
.trust-bar {
    background: var(--cjma-sand-light);
    border-bottom: 2px solid var(--cjma-sand);
    padding: 1.1rem 0;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--cjma-green-dark);
}

.trust-item i {
    font-size: 1.5rem;
    color: var(--cjma-green);
}

/* Produktkort */
.product-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: #e9ecef;
}

.product-card .usage-hint { font-size: 0.85rem; color: #6c757d; }
.product-card .price { font-size: 1.4rem; font-weight: 700; color: var(--cjma-green); }

.product-card .fraction-badge {
    background: var(--cjma-green);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.product-card .delivery-hint {
    font-size: 0.78rem;
    color: var(--cjma-green);
    font-weight: 600;
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card-link:hover { color: inherit; }

/* Kampanjblock */
.campaign-block {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.campaign-offer {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid var(--cjma-sand);
}

.campaign-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #c0392b;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campaign-price {
    font-size: 3.5rem;
    font-weight: 900;
    color: #c0392b;
    line-height: 1;
}

.campaign-original-price {
    font-size: 1.1rem;
    color: #999;
    text-decoration: line-through;
}

.campaign-news {
    background: var(--cjma-light);
    border: 1px solid #dee2e6;
}

.campaign-info {
    background: #cfe2ff;
    border: 1px solid #9ec5fe;
}

.campaign-latestnews {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #ced4da;
}

.campaign-latestnews .news-article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.campaign-latestnews .news-article-link:hover {
    opacity: 0.85;
}

/* Kassa / Varukorg */
.cart-item { border-bottom: 1px solid #eee; padding: 1rem 0; }
.cart-item:last-child { border-bottom: none; }

/* Admin */
.admin-bar {
    background: var(--cjma-sand);
    color: var(--cjma-dark);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.admin-tile {
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.admin-tile:hover { transform: scale(1.03); color: white; }
.admin-tile i { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }

.admin-tile .badge-count {
    font-size: 1.5rem;
    background: rgba(255,255,255,0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-top: 0.3rem;
}

/* Status steg */
.status-steps { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.status-step {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #dee2e6;
    background: white;
    transition: all 0.2s;
}

.status-step.active { background: var(--cjma-green); color: white; border-color: var(--cjma-green); }
.status-step.completed { background: #d1ecf1; border-color: #0878C4; color: #0a3d62; }

/* Stor knapp (touchvänlig) */
.btn-lg-touch {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 12px;
    min-height: 56px;
}

/* CJMA grön knapp */
.btn-cjma {
    background: var(--cjma-green);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-cjma:hover {
    background: var(--cjma-green-dark);
    color: white;
    transform: translateY(-1px);
}

/* Kalkylator */
.calculator-box {
    background: var(--cjma-light);
    border-radius: 12px;
    padding: 2rem;
    border: 2px solid var(--cjma-green);
}

.calculator-result { font-size: 2rem; font-weight: 800; color: var(--cjma-green); }

/* Tjänstekort */
.service-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    transition: transform 0.25s, box-shadow 0.25s;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.10);
}

.service-icon    { font-size: 2.5rem; color: var(--cjma-green); }
.service-icon-lg { font-size: 3rem; color: var(--cjma-green); flex-shrink: 0; }
.service-card-img { width: 100%; height: 220px; object-fit: cover; display: block; }

/* 3-stegsflöde */
.steps-flow {
    background: var(--cjma-sand-light);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
}

.step-wrapper { position: relative; display: inline-block; }

.step-number {
    font-size: 0.75rem;
    font-weight: 800;
    color: rgba(255,255,255,0.8);
    position: absolute;
    top: 2px;
    right: -2px;
    background: var(--cjma-green-dark);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 1;
}

.step-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--cjma-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 0.75rem;
    box-shadow: 0 4px 16px rgba(8,120,196,0.3);
}

.step-arrow {
    color: var(--cjma-sand);
    font-size: 2rem;
    align-self: center;
}

/* Snabbinfo-sektion */
.info-section { background: var(--cjma-light); }

/* Responsive */
@@media (max-width: 768px) {
    .hero h1,
    .hero-video-content h1 { font-size: 1.8rem; }
    .hero .btn-order,
    .hero-video-content .btn-order { font-size: 1.1rem; width: 100%; }
    .hero-logo { height: 48px; }
    .hero-video { min-height: 420px; }
    .hero-video-content { padding: 3rem 0 2.5rem; }
    .trust-item { font-size: 0.85rem; }
    .trust-item i { font-size: 1.2rem; }
    .step-arrow { transform: rotate(90deg); }
    .step-circle { width: 60px; height: 60px; font-size: 1.5rem; }
}

/* ── Admin help tooltips ───────────────────────────────── */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #6c757d;
    border: 1.5px solid #ced4da;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 5px;
    vertical-align: middle;
    transition: all .15s;
    user-select: none;
}
.help-icon:hover {
    color: #fff;
    background: var(--cjma-green, #198754);
    border-color: var(--cjma-green, #198754);
}
    .campaign-price { font-size: 2.5rem; }
    .admin-tile { min-height: 100px; padding: 1.2rem; }
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.25s, box-shadow 0.25s;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* News content */
.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}
.news-content h2, .news-content h3 {
    margin-top: 1.5rem;
}
.news-content p {
    line-height: 1.8;
}

/* Product image gallery */
.gallery-thumbs {
    flex-wrap: wrap;
}
.gallery-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
    background: #f0f0f0;
}
.gallery-thumb:hover {
    border-color: var(--cjma-blue);
    transform: scale(1.05);
}
.gallery-thumb.active {
    border-color: var(--cjma-blue);
    box-shadow: 0 0 0 2px var(--cjma-blue);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-thumb-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    font-size: 1.8rem;
}
