/* ================================================================
   Dent67 Mega Menu Widget v2 — Frontend CSS
   ================================================================ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ── CSS Variable Defaults (preset overrides these inline) ─────── */
.d67mm-wrap {
    --d67-wrap-bg:      #ffffff;
    --d67-accent:       #0077cc;
    --d67-divider:      #e8edf2;
    --d67-item-c:       #2c3e50;
    --d67-item-hc:      #0077cc;
    --d67-item-hbg:     #f0f7ff;
    --d67-indicator:    #0077cc;
    --d67-overlay:      rgba(0,30,60,0.45);
    --d67-cta-bg:       #ffffff;
    --d67-cta-c:        #0077cc;
    --d67-heading-c:    #8a9bb0;
    --d67-arrow-c:      #b0c4d8;
    --d67-border:       #e8edf2;
    --d67-shadow:       0 8px 40px rgba(0,0,0,0.08);
}

/* ── Reset ────────────────────────────────────────────────────── */
.d67mm-wrap *, .d67mm-wrap *::before, .d67mm-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Wrapper ──────────────────────────────────────────────────── */
.d67mm-wrap {
    display: block;
    width: 100%;
    overflow: hidden;
    background-color: var(--d67-wrap-bg);
    border: 1px solid var(--d67-border);
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: var(--d67-shadow);
    font-family: 'Poppins', sans-serif;
    position: relative;
    transition: background-color 0.3s;
}

.d67mm-wrap.has-accent {
    border-top: 3px solid var(--d67-accent);
}

/* ── Heading ──────────────────────────────────────────────────── */
.d67mm-heading {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--d67-heading-c);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--d67-divider);
}

/* ── Inner layout ─────────────────────────────────────────────── */
.d67mm-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

/* ── List side ────────────────────────────────────────────────── */
.d67mm-list-side {
    flex-shrink: 0;
    padding-right: 0;
    transition: width 0.35s ease;
}

.d67mm-has-img-panel .d67mm-list-side {
    padding-right: 24px;
}

.d67mm-columns {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    height: 100%;
}

.d67mm-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
}

.d67mm-col:not(:last-child) {
    border-right: 1px solid var(--d67-divider);
    padding-right: 24px;
}

/* ── Item ─────────────────────────────────────────────────────── */
.d67mm-item {
    display: block;
    width: 100%;
}

.d67mm-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--d67-item-c);
    text-decoration: none;
    background-color: transparent;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-left-color 0.18s ease,
        transform 0.15s ease;
    will-change: transform, background-color;
    cursor: pointer;
}

.d67mm-item a:hover,
.d67mm-item.is-active a {
    background-color: var(--d67-item-hbg);
    color: var(--d67-item-hc);
    border-left-color: var(--d67-indicator);
    transform: translateX(3px);
    text-decoration: none;
}

.d67mm-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.d67mm-arrow {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
    color: var(--d67-arrow-c);
    transition: color 0.18s ease, transform 0.18s ease;
    display: inline-block;
}

.d67mm-item a:hover .d67mm-arrow,
.d67mm-item.is-active .d67mm-arrow {
    color: var(--d67-item-hc);
    transform: translateX(4px);
}

/* ── Image Panel ──────────────────────────────────────────────── */
.d67mm-img-panel {
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background-color: #dce8f7;
    background-size: cover;
    background-position: center;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
}

/* Overlay */
.d67mm-img-overlay {
    position: absolute;
    inset: 0;
    background: var(--d67-overlay);
    border-radius: inherit;
    transition: background 0.35s ease;
}

/* Content over image */
.d67mm-img-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.d67mm-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    transition: opacity 0.25s ease;
}

.d67mm-panel-excerpt {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,0.82);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: opacity 0.25s ease;
}

.d67mm-panel-cta {
    display: inline-block;
    margin-top: 4px;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--d67-cta-c);
    background-color: var(--d67-cta-bg);
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease,
        opacity 0.25s ease;
    align-self: flex-start;
}

.d67mm-panel-cta:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Image panel crossfade transition */
.d67mm-img-panel.is-transitioning .d67mm-panel-title,
.d67mm-img-panel.is-transitioning .d67mm-panel-excerpt,
.d67mm-img-panel.is-transitioning .d67mm-panel-cta {
    opacity: 0;
}

/* ================================================================
   PRESET-SPECIFIC OVERRIDES  (bolt-on, low specificity)
   These provide the correct defaults when presets are chosen.
   Elementor style controls can still override them.
================================================================ */

/* dark-glass: backdrop-filter */
.d67mm-preset-dark-glass {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ================================================================
   Empty state (editor only)
================================================================ */
.d67mm-empty {
    padding: 40px;
    text-align: center;
    color: #aaa;
    font-style: italic;
    border: 2px dashed #ddd;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 1024px) {
    .d67mm-inner {
        flex-direction: column;
    }
    .d67mm-list-side {
        width: 100% !important;
        padding-right: 0;
    }
    .d67mm-img-panel {
        width: 100% !important;
        min-height: 220px;
        margin-top: 20px;
    }
    .d67mm-columns {
        flex-wrap: wrap;
    }
    .d67mm-col {
        flex: 1 1 calc(50% - 12px);
    }
}

@media (max-width: 600px) {
    .d67mm-wrap {
        padding: 20px 16px;
    }
    .d67mm-columns {
        flex-direction: column;
        gap: 0;
    }
    .d67mm-col {
        flex: 1 1 100%;
    }
    .d67mm-col:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--d67-divider);
        padding-right: 0;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    .d67mm-img-panel {
        min-height: 180px;
    }
}

/* ================================================================
   TEXT OVERFLOW MODES
================================================================ */

/* ── Mod 1: Ellipsis (varsayılan) ─────────────────────────────── */
.d67mm-overflow-ellipsis .d67mm-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.d67mm-overflow-ellipsis .d67mm-item a {
    overflow: hidden;
}

/* Native browser tooltip title attr ile çalışır, ek JS gerekmez */

/* ── Mod 2: Parantez gizle (PHP zaten kısar, label wrap olabilir) */
.d67mm-overflow-short-name .d67mm-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* ── Mod 3: Font küçült — tüm isim görünsün ──────────────────── */
.d67mm-overflow-small-font .d67mm-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 11px;
    line-height: 1.3;
    display: block;
}

.d67mm-overflow-small-font .d67mm-item a {
    align-items: flex-start;
    padding-top: 7px;
    padding-bottom: 7px;
}
