/* ==========================================================================
 * Variante 2 â€“ Seiten-Panel (Rich Reference Cards + Leaflet map + toggle)
 * Client-approved design, rolled out to beet / cane / refinery flowcharts.
 * BMA CI blue: #009fe3
 * ========================================================================== */

/* â”€â”€ Side Panel â”€â”€ */
#side-panel {
    position: fixed;
    top: 100px;              /* below the fixed 100px header */
    right: -550px;
    width: 40%;
    max-width: 550px;
    bottom: 0;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 7000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#side-panel.open {
    right: 0;
}

.panel-header {
    background: #009fe3;
    color: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.3;
    /*max-width: calc(100% - 40px);*/
}

.panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    opacity: 0.85;
}

.panel-close:hover { opacity: 1; }

.panel-body {
    overflow-y: auto;
    flex: 1;
    padding: 18px 16px;
}

/* â”€â”€ Sections â”€â”€ */
.panel-section-title {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #009fe3;
    margin-bottom: 10px;
    margin-top: 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8f4fc;
}

.section-block {
    margin-bottom: 22px;
}

/* Product Buttons */
.product-btn {
    display: block;
    width: 100%;
    background: #009fe3;
    color: white;
    border: none;
    padding: 9px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.88rem;
    margin-bottom: 8px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.product-btn:hover { background: #0080c0; color: white; }

/* â”€â”€ Rich Reference Cards â”€â”€ */
.ref-card-rich {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.13);
    margin-bottom: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s;
    display: flex;
}

.ref-card-rich:hover { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); }
.ref-card-rich.active { outline: 2px solid #009fe3; }

.ref-card-rich .ref-img {
    width: 40%;
    height: 250px;
    object-fit: cover;
    object-position: center center;
    display: block;
    background: #d0e8f5;
}

.ref-card-rich .ref-body {
    width: 60%;
    padding: 12px 14px 10px;
}

.ref-card-rich .ref-factory-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: #111;

}

.ref-card-rich .ref-row {
    font-size: 0.82rem;
    color: #555;

    line-height: 1.4;
}

.ref-card-rich .ref-row strong {
    color: #333;
}

.ref-card-rich .ref-technical {
    background: #f3f5f7;
    border-radius: 4px;
    padding: 7px 9px;
    font-size: 0.77rem;
    color: #444;
    white-space: pre-line;
    font-family: Arial, sans-serif;
    margin: 7px 0 8px;
    border-left: 3px solid #009fe3;
}

.ref-card-rich .ref-year-badge {
    display: inline-block;
    background: #009fe3;
    color: white;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: bold;
}

/* Leaflet Map */
#ref-map {
    width: 100%;
    height: 200px;
    border-radius: 4px;
    margin-bottom: 14px;
    z-index: 1;
}

/* â”€â”€ Mobile â”€â”€ */
@media (max-width: 600px) {
    #side-panel {
        width: 100%;
        right: -100%;
    }
}

/* â”€â”€ Toggle / Segmented Control â”€â”€ */
.ref-toggle-group {
    display: flex;
    gap: 0;
    margin-top: 8px;
    border-radius: 6px;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    width: fit-content;
}

.ref-toggle-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: none;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: Arial, sans-serif;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.ref-toggle-btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: #009fe3;
}

.ref-toggle-btn:not(.active):hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

/* â”€â”€ Content Fade Transition â”€â”€ */
.fade-switch {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.fade-switch.show {
    opacity: 1;
}

/* â”€â”€ Plant Ref Extra Details â”€â”€ */
.ref-card-rich .ref-plant-detail {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e8ef;
}

.ref-card-rich .ref-plant-detail .ref-row {
    margin-bottom: 3px;
}

.ref-card-rich .ref-highlight {
    background: #fff8e1;
    border-left: 3px solid #f0a500;
    padding: 7px 9px;
    font-size: 0.77rem;
    color: #555;
    border-radius: 0 4px 4px 0;
    margin: 7px 0 8px;
    line-height: 1.45;
}

.ref-card-rich .ref-highlight::before {
    content: '\2B50\00A0';
}

.leaflet-container {
    touch-action: none;
}
