/* ============================================
   EXPLORE HILLS v5.6 — Single Select + Auto Scroll
   ============================================ */

.te-wrap {
    --te-radius: 16px;
    --te-radius-sm: 10px;
    --te-radius-pill: 999px;
    --te-green: #10b981;
    --te-green-dark: #059669;
    --te-green-light: #ecfdf5;
    --te-green-border: #a7f3d0;
    --te-text: #111827;
    --te-text-secondary: #4b5563;
    --te-text-muted: #9ca3af;
    --te-border: #f3f4f6;
    --te-border-hover: #e5e7eb;
    --te-card-bg: #ffffff;
    --te-surface: #f9fafb;
    --te-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --te-shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --te-shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --te-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    max-width: 1360px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    color: var(--te-text);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
    position: relative;
}

.te-wrap *,
.te-wrap *::before,
.te-wrap *::after {
    box-sizing: border-box;
}

/* ---------- HEADER ---------- */
.te-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.te-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--te-text);
    margin: 0;
    line-height: 1.2;
}

.te-count {
    color: var(--te-text-secondary);
    font-size: 0.85rem;
    margin: 4px 0 0;
    font-weight: 500;
}

.te-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.te-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 42px;
    background: var(--te-surface);
    border-radius: var(--te-radius-pill);
    border: 1.5px solid var(--te-border-hover);
    transition: all var(--te-transition);
    min-width: 220px;
    max-width: 320px;
}

.te-search-wrap:focus-within {
    background: #fff;
    border-color: var(--te-green);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

.te-search-icon {
    color: var(--te-text-muted);
    flex-shrink: 0;
}

.te-search-wrap input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.88rem;
    width: 100%;
    color: var(--te-text);
    font-weight: 500;
}

.te-search-clear {
    background: var(--te-border-hover);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--te-text-secondary);
    padding: 0;
}

/* ---------- FILTER BAR ---------- */
.te-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    z-index: 100;
}

.te-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 16px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: var(--te-radius-pill);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--te-transition);
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 102;
}

.te-settings-btn:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.te-settings-icon {
    display: block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='21' x2='4' y2='14'/%3E%3Cline x1='4' y1='10' x2='4' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12' y2='3'/%3E%3Cline x1='20' y1='21' x2='20' y2='16'/%3E%3Cline x1='20' y1='12' x2='20' y2='3'/%3E%3Cline x1='1' y1='14' x2='7' y2='14'/%3E%3Cline x1='9' y1='8' x2='15' y2='8'/%3E%3Cline x1='17' y1='16' x2='23' y2='16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.te-badge {
    background: var(--te-green);
    color: #fff;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 20px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: absolute;
    top: -4px;
    right: -4px;
    box-shadow: 0 0 0 2px #fff;
}

.te-quick-tags-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.te-quick-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 4px;
    width: 100%;
}

.te-quick-tags::-webkit-scrollbar {
    display: none;
}

/* ---------- QUICK PILLS - COMPETITOR STYLE ---------- */
.te-qtag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--te-radius-pill);
    border: 2px solid var(--te-border-hover);
    background: #ffffff;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    position: relative;
}

.te-qtag:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* Active state - RED HIGHLIGHT like competitor */
.te-qtag.active {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
    transform: scale(1.02);
}

/* "All Treks" button - different color when active */
.te-qtag[data-type="all"].active {
    background: var(--te-green);
    border-color: var(--te-green);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.te-scroll-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid var(--te-border-hover);
    color: var(--te-text);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 0;
}

.te-scroll-next:hover {
    background: #f8fafc;
    transform: scale(1.05);
}

.te-scroll-next svg {
    width: 16px;
    height: 16px;
}

/* ---------- ACTIVE FILTER CHIPS ---------- */
.te-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    animation: teFadeIn 0.3s ease;
}

.te-af-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #35db51;
    border-radius: var(--te-radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.te-af-chip:hover {
    background: #fee2e2;
}

.te-af-chip .te-af-x {
    font-size: 14px;
    opacity: 0.7;
}

.te-af-chip:hover .te-af-x {
    opacity: 1;
}

/* ---------- FILTER DRAWER ---------- */
.te-drawer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 520px;
    background: #ffffff;
    z-index: 101;
    display: flex;
    flex-direction: column;
    border-radius: 0 0 20px 20px;
    border: 1px solid #e5e7eb;
    border-top: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    /* FIX #2: Slide DOWN from top instead of up, so close animation
       slides back DOWN cleanly (no upward jump) */
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    margin-top: 10px;
    /* FIX #3: Force crisp rendering on GPU-composited layer */
    will-change: transform, opacity;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
}

.te-drawer.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.te-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.te-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.te-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--te-border);
    flex-shrink: 0;
}

.te-drawer-head h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--te-text);
}

.te-drawer-head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.te-clear-all {
    background: none;
    border: none;
    color: #dc2626;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.88rem;
    transition: opacity 0.2s ease;
}

.te-clear-all:hover {
    opacity: 0.7;
}

.te-drawer-close {
    background: var(--te-surface);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--te-text-secondary);
    padding: 0;
    transition: all 0.2s ease;
}

.te-drawer-close:hover {
    background: var(--te-border-hover);
}

.te-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 28px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.te-drawer-body::-webkit-scrollbar {
    width: 6px;
}

.te-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

.te-drawer-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.te-drawer-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.te-fgroup {
    margin-bottom: 24px;
}

.te-fgroup:last-child {
    margin-bottom: 0;
}

.te-fgroup-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-bottom: 12px;
    display: block;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--te-border);
}

.te-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- DRAWER PILLS - COMPLETELY HIDE RADIO ---------- */
.te-fopt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.te-fopt input[type="radio"] {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.te-fopt span {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: var(--te-radius-pill);
    border: 2px solid var(--te-border-hover);
    background: #ffffff;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.te-fopt:hover span {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* Checked state - RED HIGHLIGHT like competitor */
.te-fopt input:checked ~ span {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

/* "All" options - green when checked */
.te-fopt:has(span:first-child) input[value=""]:checked ~ span,
.te-fopt input[value=""]:checked ~ span {
    background: var(--te-green);
    border-color: var(--te-green);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

/* ---------- RESULTS GRID ---------- */
.te-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
    min-height: 200px;
    position: relative;
    z-index: 1;
}

.te-card-hidden {
    display: none !important;
}

.te-card {
    display: flex;
    flex-direction: column;
    background: var(--te-card-bg);
    border-radius: var(--te-radius);
    overflow: hidden;
    border: 1px solid var(--te-border);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: teCardIn 0.45s ease backwards;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.te-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--te-shadow-lg);
    border-color: transparent;
}

.te-card-img {
    height: 200px;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5, #d1fae5);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.te-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.te-card:hover .te-card-img img {
    transform: scale(1.06);
}

.te-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
}

.te-card-grade {
    padding: 4px 12px;
    border-radius: var(--te-radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    line-height: 1.4;
}

.te-card-grade.easy {
    background: rgba(16, 185, 129, 0.92);
    color: #fff;
}

.te-card-grade.moderate {
    background: rgba(245, 158, 11, 0.92);
    color: #fff;
}

.te-card-grade.difficult {
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
}

.te-card-duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 5px 14px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    border-radius: var(--te-radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 2;
}

.te-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--te-green);
    opacity: 0.35;
}

.te-no-img svg {
    width: 48px;
    height: 48px;
}

.te-card-body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.te-card-title {
    font-size: 1.08rem;
    font-weight: 750;
    color: var(--te-text);
    margin: 0 0 6px;
    line-height: 1.35;
}

.te-card-excerpt {
    color: var(--te-text-secondary);
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.te-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 14px;
}

.te-card-tag {
    padding: 3px 10px;
    background: var(--te-surface);
    border-radius: var(--te-radius-pill);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--te-text-secondary);
    text-transform: uppercase;
}

.te-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--te-border);
    font-size: 0.8rem;
    color: var(--te-text-secondary);
    font-weight: 500;
    margin-top: auto;
}

.te-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.te-meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--te-text-muted);
}

.te-load-more-wrap {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 20px 0 10px;
}

.te-load-more-btn {
    padding: 13px 30px;
    background: var(--te-green);
    color: #ffffff;
    border: none;
    border-radius: var(--te-radius-pill);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(16,185,129,0.25);
}

.te-load-more-btn:hover {
    background: var(--te-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16,185,129,0.35);
}

.te-loading {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 80px 20px;
}

.te-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--te-border);
    border-top-color: var(--te-green);
    border-radius: 50%;
    animation: teSpin 0.7s linear infinite;
}

.te-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.te-empty h3 {
    margin: 16px 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--te-text);
}

.te-empty p {
    margin: 0;
    color: var(--te-text-secondary);
    font-size: 0.9rem;
}

.te-empty-icon svg {
    width: 48px;
    height: 48px;
    color: var(--te-text-muted);
}

@keyframes teSpin {
    to { transform: rotate(360deg); }
}

@keyframes teCardIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes teFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- RESPONSIVE MOBILE ---------- */
@media (max-width: 768px) {
    .te-wrap {
        padding: 12px 10px;
    }

    .te-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .te-header-right {
        width: 100%;
    }

    .te-search-wrap {
        min-width: 100%;
        max-width: 100%;
    }

    .te-quick-tags {
        gap: 6px;
        padding: 2px;
    }

    .te-qtag {
        padding: 8px 16px;
        font-size: 0.82rem;
        flex-shrink: 0;
        max-width: calc(48vw - 8px);
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    /* CRITICAL FIX: Remove z-index from filter-bar on mobile.
       Without this, .te-filter-bar creates a stacking context that traps
       the drawer's z-index inside it. The overlay (a sibling) then
       renders ON TOP of the drawer, blocking all touch events. */
    .te-filter-bar {
        z-index: auto;
    }

    /* Mobile: Full screen bottom sheet */
    .te-drawer {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 85vh;
        height: 85dvh;
        max-height: none;
        border-radius: 20px 20px 0 0;
        border: 1px solid #e5e7eb;
        border-bottom: none;
        transform: translateY(100%);
        margin-top: 0;
        z-index: 1002;
        /* Ensure crisp text, no blur from GPU compositing */
        -webkit-font-smoothing: subpixel-antialiased;
        -moz-osx-font-smoothing: auto;
    }

    .te-drawer.open {
        transform: translateY(0);
    }

    .te-overlay {
        z-index: 1001;
    }

    /* Ensure drawer content is tappable on mobile */
    .te-drawer-head,
    .te-drawer-body,
    .te-fopt,
    .te-fopt span,
    .te-clear-all,
    .te-drawer-close {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Make filter pills larger touch targets on mobile */
    .te-fopt span {
        padding: 10px 16px;
        font-size: 0.85rem;
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .te-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .te-card-img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .te-title {
        font-size: 1.3rem;
    }

    .te-qtag {
        padding: 7px 14px;
        font-size: 0.78rem;
        max-width: calc(52vw - 8px);
    }

    .te-settings-btn {
        padding: 0 12px;
        height: 38px;
    }

    .te-scroll-next {
        width: 32px;
        height: 32px;
    }

    .te-drawer-body {
        padding: 16px 16px 24px;
    }

    .te-pill-group {
        gap: 6px;
    }

    .te-fopt span {
        padding: 9px 14px;
        font-size: 0.8rem;
        min-height: 44px;
        min-width: 44px;
    }

    /* FIX #3: Ensure close/clear buttons have adequate touch targets */
    .te-drawer-close {
        width: 44px;
        height: 44px;
    }
}
/* ============================================
   V4 SHORTCODE-STYLE WRAPPERS
   (button / icon / compact — carried over from V4 so the
   [explore_hills style="button|icon|compact"] shortcodes keep working
   with the V5 explorer markup rendered inside them)
   ============================================ */

/* ============================================
   BUTTON SHORTCODE STYLE
   ============================================ */

.eh-btn-wrap {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
}

.eh-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--te-green, #10b981);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px rgba(16,185,129,0.25);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    vertical-align: middle;
}

.eh-trigger-btn:hover {
    background: var(--te-green-dark, #059669);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16,185,129,0.35);
}

.eh-trigger-btn:active {
    transform: translateY(0);
}

.eh-trigger-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.eh-trigger-btn .eh-btn-text {
    line-height: 1;
    display: inline-block;
}

/* Modal */
.eh-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s;
}

.eh-modal.open {
    opacity: 1;
    visibility: visible;
}

.eh-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.eh-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 94vw;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}

.eh-modal.open .eh-modal-content {
    transform: scale(1) translateY(0);
}

.eh-modal-content .te-wrap {
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

/* ============================================
   MODAL CLOSE BUTTON — Fixed alignment
   ============================================ */
.eh-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 20001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.95);
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 0;
}

.eh-modal-close:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}

.eh-modal-close:active {
    transform: scale(0.9) rotate(90deg);
}

.eh-modal-close svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   ICON SHORTCODE STYLE (header search icon)
   ============================================ */

.eh-icon-wrap {
    display: inline-flex;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
}

.eh-icon-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    color: inherit;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

.eh-icon-trigger:hover {
    background: rgba(16,185,129,0.1);
    color: var(--te-green, #10b981);
}

.eh-icon-trigger:active {
    background: rgba(16,185,129,0.2);
    transform: scale(0.92);
}

.eh-icon-trigger svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Icon with badge counter */
.eh-icon-trigger .te-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    font-size: 0.6rem;
    padding: 0 4px;
    background: var(--te-green, #10b981);
    color: #fff;
    border-radius: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   COMPACT MODE
   ============================================ */

.te-wrap--compact .te-header {
    margin-bottom: 14px;
}

.te-wrap--compact .te-title {
    font-size: 1.2rem;
}

.te-wrap--compact .te-search-wrap input {
    width: 100%;
    min-width: 0;
}

.te-wrap--compact .te-quick-tags {
    margin-bottom: 14px;
    padding-bottom: 14px;
    gap: 5px;
}

.te-wrap--compact .te-qtag {
    padding: 5px 12px;
    font-size: 0.75rem;
}

.te-wrap--compact .te-grid {
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.te-wrap--compact .te-card-img {
    height: 170px;
}

.te-wrap--compact .te-card-body {
    padding: 14px 16px 16px;
}

.te-wrap--compact .te-card-title {
    font-size: 0.95rem;
}

