/*
 * NMI Chery Menu — Stylesheet
 * Automatically enqueued by the plugin. No manual pasting required.
 *
 * Colour tokens — adjust to match your brand:
 */

:root {
    --nmi-sidebar-bg:    #8c7f76;          /* warm taupe — left parent column  */
    --nmi-accordion-bg:  #7a6d64;          /* slightly darker — middle column  */
    --nmi-display-bg:    #f0eeec;          /* near-white — right car panel     */
    --nmi-text-light:    #ffffff;
    --nmi-text-dark:     #1a1a1a;
    --nmi-text-muted:    rgba(255,255,255,0.55);
    --nmi-accent:        #c8a97a;          /* gold/tan — Explore button        */
    --nmi-accent-hover:  #b8976a;
    --nmi-badge-bg:      #c8a97a;
    --nmi-font-heading:  'Arial Narrow', Arial, sans-serif;
    --nmi-font-body:     Arial, sans-serif;
    --nmi-panel-z:       9999;
    --nmi-transition:    0.25s ease;
}

/* ── Panel wrapper ─────────────────────────────────────────────────────────── */

#nmi-chery-panel {
    position:       fixed;
    left:           0;
    width:          100%;
    z-index:        var(--nmi-panel-z);
    overflow:       hidden;
    max-height:     0;
    opacity:        0;
    pointer-events: none;
    transition:     max-height 0.35s ease, opacity 0.25s ease;
    box-shadow:     0 8px 32px rgba(0, 0, 0, 0.18);
    /* top is set dynamically by JS to match header height */
}

#nmi-chery-panel.is-open {
    max-height:     600px;
    opacity:        1;
    pointer-events: all;
}

/* ── Inner 3-column grid ───────────────────────────────────────────────────── */

.nmi-inner {
    display:               grid;
    grid-template-columns: 220px 280px 1fr;
    min-height:            360px;
    max-height:            auto;
}

/* ── Left column: parent list ──────────────────────────────────────────────── */

.nmi-col--parents {
    background:      var(--nmi-sidebar-bg);
    padding:         0;
    display:         flex;
    flex-direction:  column;
    justify-content: start;
}

.nmi-parent-list {
    list-style: none;
    margin:     0;
    padding:    0;
}

.nmi-parent-item {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         14px 28px;
    color:           var(--nmi-text-muted);
    font-family:     var(--nmi-font-heading);
    font-size:       2rem;
    font-weight:     700;
    letter-spacing:  0.04em;
    cursor:          pointer;
    border-left:     3px solid transparent;
    transition:      color var(--nmi-transition), border-left-color var(--nmi-transition);
}

.nmi-parent-item:hover,
.nmi-parent-item.is-active {
    color:             var(--nmi-text-light);
    border-left-color: var(--nmi-text-light);
}

.nmi-chevron {
    flex-shrink: 0;
    opacity:     0.5;
    transition:  opacity var(--nmi-transition);
}

.nmi-parent-item:hover .nmi-chevron,
.nmi-parent-item.is-active .nmi-chevron {
    opacity: 1;
}

/* ── Middle column: accordion ──────────────────────────────────────────────── */

.nmi-col--accordion {
    background: var(--nmi-accordion-bg);
    padding:    0;
    overflow-y: auto;
}

.nmi-accordion {
    list-style: none;
    margin:     0;
    padding:    0;
}

.nmi-accordion-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nmi-accordion-toggle {
    width:           100%;
    background:      none;
    border:          none;
    padding:         14px 28px;
    color:           var(--nmi-text-light);
    font-family:     var(--nmi-font-heading);
    font-size:       2rem;
    font-weight:     700;
    letter-spacing:  0.05em;
    text-align:      left;
    cursor:          pointer;
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    transition:      background var(--nmi-transition);
}

.nmi-accordion-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.nmi-toggle-icon {
    font-size:   2rem;
    line-height: 1;
    opacity:     0.7;
}

/* Accordion content: collapsed by default, open when section has .is-open */

.nmi-accordion-content {
    list-style:  none;
    margin:      0;
    padding:     0 0 8px 0;
    max-height:  0;
    overflow:    hidden;
    transition:  max-height 0.3s ease;
}

.nmi-accordion-section.is-open .nmi-accordion-content {
    max-height: 400px;
}

/* Grandchild items */

.nmi-gc-item {
    padding:     5px 28px 5px 36px;
    color:       var(--nmi-text-muted);
    font-family: var(--nmi-font-body);
    font-size:   1.8rem;
    cursor:      pointer;
    display:     flex;
    align-items: center;
    gap:         10px;
    transition:  color var(--nmi-transition);
}

.nmi-gc-item:hover,
.nmi-gc-item.is-active {
    color: var(--nmi-text-light);
}

.nmi-badge {
    background:     var(--nmi-badge-bg);
    color:          #fff;
    font-size:      2rem;
    font-weight:    700;
    letter-spacing: 0.08em;
    padding:        2px 6px;
    border-radius:  2px;
    text-transform: uppercase;
}

/* ── Right column: car display ─────────────────────────────────────────────── */

.nmi-col--display {
    background:  var(--nmi-display-bg);
    position:    relative;
    overflow:    hidden;
    display:     flex;
    align-items: center;
}

.nmi-display {
    position:       relative;
    width:          100%;
    height:         100%;
    display:        flex;
    align-items:    center;
    padding:        32px 40px;
    row-gap:        0;
    flex-direction: column;
}

/* Large watermark model name behind the car */
.nmi-car-name-bg {
    position:       relative;
    top:            20px;
    right:          0;
    transform:      translateY(-55%);
    font-family:    var(--nmi-font-heading);
    font-size:      clamp(30px, 4vw, 100px);
    font-weight:    900;
    letter-spacing: 0.08em;
    color:          rgba(0, 0, 0, 0.07);
    white-space:    nowrap;
    pointer-events: none;
    user-select:    none;
    text-transform: uppercase;
}

/* Car image */
img#nmi-car-image {
    max-height:  350px;
    max-width:   65%;
    object-fit:  contain;
    transition:  opacity 0.2s ease;
}

.nmi-car-image.is-transitioning {
    opacity: 0;
}

/* Price block + Explore button */
a#nmi-car-image-link {
    text-align: center;
}

.nmi-car-meta {
    position:    relative;
    z-index:     2;
    display:     flex;
    align-items: center;
    gap:         15px;
}

.nmi-price-block {
    display:        flex;
    flex-direction: row;
    align-items:    center;
    gap:            15px;
}

.nmi-label {
    font-family:   var(--nmi-font-body);
    font-size:     2rem;
    color:         var(--nmi-text-dark);
    opacity:       0.6;
    margin-bottom: 0;
}

.nmi-price {
    font-family:    var(--nmi-font-heading);
    font-size:      clamp(2.8rem, 5vw, 4rem);
    font-weight:    700;
    color:          var(--nmi-text-dark);
    letter-spacing: -0.01em;
}

.nmi-explore-btn {
    display:         inline-block;
    background:      var(--nmi-accent);
    color:           #fff;
    font-family:     var(--nmi-font-body);
    font-size:       2rem;
    letter-spacing:  0.1em;
    text-transform:  uppercase;
    padding:         14px 36px;
    text-decoration: none;
    transition:      background var(--nmi-transition);
}

.nmi-explore-btn:hover {
    background: var(--nmi-accent-hover);
    color:      #fff;
}

/* ── Nav trigger active state ──────────────────────────────────────────────── */

.nmi-trigger--active > a,
.nmi-trigger--active {
    opacity: 0.75;
}

/* ── Mobile (≤768px) ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {

    #nmi-chery-panel {
        position: relative;
        top:      auto !important;
    }

    .nmi-inner {
        grid-template-columns: 1fr;
        min-height:            unset;
        max-height:            unset;
    }

    .nmi-col--parents {
        padding:        16px 0;
        flex-direction: row;
        flex-wrap:      wrap;
    }

    .nmi-parent-item {
        padding:       10px 18px;
        font-size:     2rem;
        border-left:   none;
        border-bottom: 3px solid transparent;
    }

    .nmi-parent-item:hover,
    .nmi-parent-item.is-active {
        border-left-color:   transparent;
        border-bottom-color: var(--nmi-text-light);
    }

    .nmi-col--display {
        min-height: 280px;
    }

    img#nmi-car-image {
    max-height:  350px;
    max-width:   65%;
    object-fit:  contain;
    transition:  opacity 0.2s ease;
}

    .nmi-car-meta {
        flex-direction: column;
        align-items:    flex-start;
        gap:            16px;
    }

    .nmi-car-name-bg {
        font-size: 48px;
    }
}

/* ── Mobile accordion column (hidden on desktop) ───────────────────────────── */

.nmi-col--mobile {
    display: none;
}

@media (max-width: 768px) {

    /* Hide desktop-only columns */
    .nmi-col--parents,
    .nmi-col--accordion,
    .nmi-col--display {
        display: none;
    }

    /* Show mobile accordion column full width */
    .nmi-col--mobile {
        display:    block;
        background: var(--nmi-accordion-bg);
        width:      100%;
    }

    /* Override grid to single column */
    .nmi-inner {
        grid-template-columns: 1fr;
        min-height:            unset;
        max-height:            unset;
    }

    /* Child headings — styled differently from grandchild links */
    .nmi-mobile-child-heading {
        padding:        10px 28px 6px 28px;
        color:          var(--nmi-text-light);
        font-family:    var(--nmi-font-heading);
        font-size:      1.6rem;
        font-weight:    700;
        letter-spacing: 0.03em;
        list-style:     none;
        cursor:         default;
    }

    /* Grandchild links */
    .nmi-col--mobile .nmi-gc-item {
        padding: 6px 28px 6px 40px;
    }

    .nmi-col--mobile .nmi-gc-item a {
        color:           var(--nmi-text-muted);
        text-decoration: none;
        font-family:     var(--nmi-font-body);
        font-size:       1.6rem;
        display:         flex;
        align-items:     center;
        gap:             10px;
        transition:      color var(--nmi-transition);
    }

    .nmi-col--mobile .nmi-gc-item a:hover {
        color: var(--nmi-text-light);
    }

    /* Panel scrollable on mobile if content is tall */
    #nmi-chery-panel.is-open {
        max-height: 80vh;
        overflow-y: auto;
    }
}
