/* ================================================================
   JOM Referencer 2.1 — Frontend
   Overflow-fixed, upgraded panel design
   ================================================================ */

/* === TAB NAVIGATION === */
.jom-ref-tabs {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 24px 20px 48px;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

.jom-ref-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 30px;
    border: 1px solid rgba(0, 0, 0, .10);
    background: transparent !important;
    color: #999;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 60px;
    transition: all .25s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.jom-ref-tab:hover {
    color: #00253C;
    border-color: rgba(0, 0, 0, .18);
    background: rgba(0, 0, 0, .02) !important;
}

.jom-ref-tab.active {
    color: #fff !important;
    background: #00253C !important;
    border-color: #00253C;
}

.jom-ref-tab:focus { outline: none; }
.jom-ref-tab:active { color: #555; }
.jom-ref-tab svg { width: 18px; height: 18px; opacity: .5; }
.jom-ref-tab.active svg { opacity: 1; stroke: #e87722; }


/* === MAP CONTAINER === */
.jom-ref-map-wrap {
    width: 100%;
    padding: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
}

.jom-ref-map {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background: #f0f0f0;
}


/* === LIST CONTAINER === */
.jom-ref-list {
    width: 100%;
    padding: 0 !important;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}


/* === GRID ITEM === */
.jom-ref-row {
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    border-right: 1px solid rgba(0, 0, 0, .08);
    cursor: pointer;
    transition: background .25s ease;
    position: relative;
    min-height: 18vh;
}

.jom-ref-row:nth-child(2n) { border-right: none; }
.jom-ref-row:nth-child(-n+2) { border-top: 1px solid rgba(0, 0, 0, .08); }

.jom-ref-row:hover { background: rgba(232, 119, 34, .04); }
.jom-ref-row:active { background: rgba(232, 119, 34, .07); }

.jom-ref-row-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 40px 48px;
    height: 100%;
    box-sizing: border-box;
}

.jom-ref-row-logo {
    flex-shrink: 0;
    width: 160px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.jom-ref-row-logo img {
    max-height: 58px;
    max-width: 150px;
    object-fit: contain;
    opacity: .65;
    transition: opacity .3s ease, filter .3s ease;
    filter: grayscale(.3);
}

.jom-ref-row:hover .jom-ref-row-logo img {
    opacity: 1;
    filter: grayscale(0);
}

.jom-ref-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.jom-ref-row-name {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jom-ref-row-count {
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    white-space: nowrap;
    letter-spacing: .02em;
}

.jom-ref-row-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    transition: all .3s ease;
    background: transparent;
}

.jom-ref-row:hover .jom-ref-row-arrow {
    color: #e87722;
    background: rgba(232, 119, 34, .08);
    transform: translateX(3px);
}


/* ================================================================
   PANEL / MODAL — Slide-in, no jank
   ================================================================ */

.jom-ref-panel {
    position: fixed;
    inset: 0;
    z-index: 999999;
    pointer-events: none;
    visibility: hidden;
}

.jom-ref-panel.active {
    pointer-events: auto;
    visibility: visible;
}

.jom-ref-panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 20, 40, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .35s ease;
}

.jom-ref-panel.active .jom-ref-panel-overlay { opacity: 1; }

/* Panel content — clean, no fixed ::before */
.jom-ref-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 540px;
    max-width: 92vw;
    height: 100%;
    background: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0;
    transform: translateX(100%);
    transition: transform .4s cubic-bezier(.16, 1, .3, 1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, .12);
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
}

.jom-ref-panel.active .jom-ref-panel-content {
    transform: translateX(0);
}

/* Close button */
.jom-ref-panel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(4px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: all .2s ease;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.jom-ref-panel-close:hover { background: #e87722; color: #fff; }
.jom-ref-panel-close:focus { outline: 2px solid #e87722; outline-offset: 2px; }

/* Header — textured logo area */
.jom-ref-panel-header {
    padding: 52px 48px 36px;
    background-color: #f8f9fa;
    background-image: url('https://jomrustfri.udvikling360.dk/wp-content/uploads/2025/11/Grafik-3.jpg');
    background-size: 600px;
    background-position: center;
    background-repeat: repeat;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.jom-ref-panel-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .82);
    pointer-events: none;
}

.jom-ref-panel-header > * {
    position: relative;
    z-index: 1;
}

.jom-ref-panel-logo {
    max-height: 52px;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 20px;
    display: block;
}

.jom-ref-panel-title {
    font-size: 26px;
    font-weight: 900;
    color: #00253C;
    letter-spacing: -.02em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.jom-ref-panel-desc {
    font-size: 15px;
    color: rgba(0, 37, 60, .55);
    line-height: 1.7;
}

/* Machines section */
.jom-ref-panel-section {
    padding: 32px 48px 0;
}

.jom-ref-panel-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: #e87722;
    margin-bottom: 18px;
}

.jom-ref-panel-machines {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.jom-ref-machine-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.jom-ref-machine-card:last-child { border-bottom: none; }

.jom-ref-machine-card-img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jom-ref-machine-card-img img { width: 100%; height: 100%; object-fit: cover; }
.jom-ref-machine-card-img svg { width: 24px; height: 24px; color: #ccc; }

.jom-ref-machine-card-info { flex: 1; min-width: 0; }

.jom-ref-machine-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #00253C;
    margin-bottom: 2px;
}

.jom-ref-machine-card-desc {
    font-size: 13px;
    color: rgba(0, 37, 60, .5);
    line-height: 1.5;
}

/* Footer — website link */
.jom-ref-panel-footer {
    padding: 20px 48px 0;
    border-top: 1px solid rgba(0, 0, 0, .06);
}

.jom-ref-panel-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #e87722;
    text-decoration: none;
    transition: color .2s ease;
    padding: 6px 0;
}

.jom-ref-panel-link:hover { color: #c5611a; }
.jom-ref-panel-link:focus { outline: none; color: #c5611a; }


/* ================================================================
   CTA WIDGET — Dark card med textur
   ================================================================ */

.jom-ref-panel-cta {
    margin: 32px 48px 48px;
    padding: 28px 24px;
    background: #00253C;
    border-radius: 14px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.jom-ref-panel-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://jomrustfri.udvikling360.dk/wp-content/uploads/2025/11/Grafik-3.jpg') center / 500px repeat;
    opacity: .04;
    pointer-events: none;
}

.jom-ref-panel-cta > * {
    position: relative;
    z-index: 1;
}

.jom-ref-panel-cta-heading {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: -.01em;
}

.jom-ref-panel-cta-text {
    font-size: 14px;
    color: rgba(255, 255, 255, .5);
    line-height: 1.6;
    margin-bottom: 20px;
}

.jom-ref-panel-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #e87722;
    color: #fff;
    border-radius: 60px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease, transform .15s ease;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
}

.jom-ref-panel-cta-btn:hover { background: #d06a1e; transform: translateY(-1px); color: #fff; }
.jom-ref-panel-cta-btn:focus { outline: 2px solid #e87722; outline-offset: 2px; color: #fff; }
.jom-ref-panel-cta-btn:active { color: #fff; }
.jom-ref-panel-cta-btn svg { transition: transform .2s ease; }
.jom-ref-panel-cta-btn:hover svg { transform: translateX(3px); }

.jom-ref-panel-cta-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, .4);
    text-decoration: none;
    transition: color .2s ease;
}

.jom-ref-panel-cta-phone:hover { color: #e87722; }
.jom-ref-panel-cta-phone:focus { color: #e87722; }


/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1024px) {
    .jom-ref-row { min-height: 20vh; }
    .jom-ref-row-inner { padding: 32px 32px; }
}

@media (max-width: 768px) {
    .jom-ref-list { grid-template-columns: 1fr !important; }

    .jom-ref-row { border-right: none !important; min-height: auto; }
    .jom-ref-row:nth-child(-n+2) { border-top: none !important; }
    .jom-ref-row:first-child { border-top: 1px solid rgba(0, 0, 0, .08) !important; }

    .jom-ref-row-inner { padding: 24px 20px; gap: 16px; }
    .jom-ref-row-logo { width: 100px; height: 44px; }
    .jom-ref-row-logo img { max-height: 40px; max-width: 90px; }
    .jom-ref-row-name { font-size: 15px; }
    .jom-ref-row-arrow { width: 36px; height: 36px; }
    .jom-ref-row-arrow svg { width: 16px; height: 16px; }

    .jom-ref-panel-content { width: 100%; max-width: 100%; }

    .jom-ref-panel-header { padding: 40px 24px 28px; }
    .jom-ref-panel-section { padding: 24px 24px 0; }
    .jom-ref-panel-footer { padding: 20px 24px 0; }
    .jom-ref-panel-cta { margin: 24px 24px 32px; padding: 24px 20px; }

    .jom-ref-panel-title { font-size: 22px; }
    .jom-ref-machine-card-img { width: 52px; height: 52px; }
}
