/* ============================================================
   A Project Manager — Frontend
   Sidebar filter · Masonry grid · Before/After · Video
   ============================================================ */

:root {
    --apm-black:    #111111;
    --apm-white:    #ffffff;
    --apm-gray:     #888888;
    --apm-light:    #f0f0f0;
    --apm-ease:     cubic-bezier(0.4, 0, 0.2, 1);
    --apm-dur:      0.28s;
    --apm-cols:     3;
    --apm-gap:      5px;
    --apm-row-unit: 5px;
    --apm-radius:   0px;
    --apm-sidebar:  200px;   /* filter sidebar width */
    --apm-sidebar-gap: 48px;
}

/* ================================================================
   LAYOUT — sidebar + grid side by side
   ================================================================ */
.apm-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    width: 100%;
}
.apm-wrap.has-sidebar {
    display: grid;
    grid-template-columns: var(--apm-sidebar) 1fr;
    gap: var(--apm-sidebar-gap);
    align-items: start;
}
.apm-grid-area { min-width: 0; width: 100%; }

/* ── Sidebar collapsed (JS adds class when container < 700px) ── */
.apm-wrap.has-sidebar.sidebar-stacked {
    grid-template-columns: 1fr;
    gap: 20px;
}
.apm-wrap.has-sidebar.sidebar-stacked .apm-filter-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}
.apm-wrap.has-sidebar.sidebar-stacked .apm-filter-head {
    flex: 0 0 100%;
    margin-bottom: 8px;
}
.apm-wrap.has-sidebar.sidebar-stacked .apm-filter-group {
    margin-bottom: 0;
    display: contents;
}
.apm-wrap.has-sidebar.sidebar-stacked .apm-filter-group-label { display: none; }

/* ── Responsive viewport breakpoints ── */
@media (max-width: 900px) {
    .apm-wrap.has-sidebar {
        grid-template-columns: 160px 1fr;
        --apm-sidebar-gap: 28px;
    }
}

/* ── Mobile (≤ 767px): bottom-sheet filter ── */
@media (max-width: 767px) {
    /* Grid: collapse sidebar column */
    .apm-wrap.has-sidebar {
        grid-template-columns: 1fr;
        gap: 0;
    }
    /* Sidebar: collapse to 0 in layout — fixed children still visible */
    .apm-filter-sidebar,
    .apm-wrap.has-sidebar.sidebar-stacked .apm-filter-sidebar {
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        position: static !important;
    }

    /* Floating "Filter" button (bottom-right) */
    .apm-filter-mob-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 24px;
        right: 20px;
        background: #fff;
        color: #000;
        border: none;
        border-radius: 0;
        padding: 8px 16px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        cursor: pointer;
        z-index: 9997;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    }

    /* Dark backdrop */
    .apm-filter-backdrop {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
    }
    .apm-filter-sidebar.is-open .apm-filter-backdrop {
        opacity: 1;
        visibility: visible;
    }

    /* Bottom sheet content */
    .apm-filter-content {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 85vh;
        background: #f7f7f7;
        z-index: 9999;
        padding: 30px 25px 40px;
        border-radius: 20px 20px 0 0;
        overflow-y: auto;
        box-sizing: border-box;
        transform: translateY(100%);
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), visibility 0.4s;
    }
    .apm-filter-sidebar.is-open .apm-filter-content {
        transform: translateY(0);
        visibility: visible;
    }

    /* Close × button */
    .apm-filter-mob-close {
        display: block !important;
        position: absolute;
        right: 20px;
        top: 20px;
        background: none;
        border: none;
        font-size: 32px;
        line-height: 1;
        cursor: pointer;
        color: #000;
        padding: 0;
    }

    /* Override stacked inline layout for groups inside bottom sheet */
    .apm-filter-sidebar.is-open .apm-filter-group {
        display: block !important;
        margin-bottom: 24px;
    }
    .apm-filter-sidebar.is-open .apm-filter-group-label {
        display: block !important;
    }
}

/* ================================================================
   FILTER SIDEBAR
   ================================================================ */
.apm-filter-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: none;
}
.apm-filter-sidebar::-webkit-scrollbar { display: none; }

/* Mobile-only elements: hidden on desktop (min-width ensures it doesn't override mobile rules) */
@media (min-width: 768px) {
    .apm-filter-mob-toggle,
    .apm-filter-mob-close,
    .apm-filter-backdrop { display: none !important; }
}

/* Header row */
.apm-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e0e0e0;
}
.apm-filter-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--apm-black);
}
.apm-filter-reset {
    background: none;
    border: none;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--apm-gray);
    cursor: pointer;
    transition: color var(--apm-dur);
    display: none; /* shown via JS when any checkbox is checked */
}
.apm-filter-reset.is-visible { display: block; }
.apm-filter-reset:hover { color: var(--apm-black); }

/* Group */
.apm-filter-group {
    margin-bottom: 22px;
}
.apm-filter-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--apm-gray);
    margin-bottom: 10px;
}

/* Checkbox item */
.apm-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    cursor: pointer;
    line-height: 1.4;
}
.apm-filter-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
/* Custom checkbox box */
.apm-filter-check-box {
    width: 16px;
    height: 16px;
    border: 1.5px solid #c8c8c8;
    border-radius: 3px;
    background: var(--apm-white);
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--apm-dur), background var(--apm-dur);
}
.apm-filter-check-box::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: 2px solid var(--apm-white);
    border-top: none;
    border-left: none;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s;
}
.apm-filter-item input:checked ~ .apm-filter-check-box {
    background: var(--apm-black);
    border-color: var(--apm-black);
}
.apm-filter-item input:checked ~ .apm-filter-check-box::after {
    transform: rotate(45deg) scale(1);
}
.apm-filter-label {
    font-size: 13px;
    color: var(--apm-black);
    transition: opacity var(--apm-dur);
}
.apm-filter-item:hover .apm-filter-label { opacity: 0.6; }
.apm-filter-item:hover .apm-filter-check-box { border-color: #888; }

/* ================================================================
   MASONRY GRID
   ================================================================ */
.apm-grid {
    display: grid;
    grid-template-columns: repeat(var(--apm-cols), 1fr);
    grid-auto-rows: 1px;
    column-gap: var(--apm-gap);
    row-gap: 0;
    align-items: start;
}

/* Before JS calculates spans */
.apm-grid:not(.is-ready) .apm-item {
    margin-bottom: var(--apm-gap);
}

/* Responsive — 2 cols on tablet/mobile */
@media (max-width: 1024px) { .apm-grid { --apm-cols: 2; } }
/* Override inline --apm-cols on mobile with !important */
@media (max-width: 767px)  { .apm-grid { grid-template-columns: repeat(2, 1fr) !important; } }

/* ── Item ───────────────────────────────────────────────────── */
.apm-item {
    cursor: pointer;
    position: relative;
    border-radius: var(--apm-radius);
    overflow: hidden;
}
.apm-item.apm-lm-hidden  { display: none !important; }
.apm-item.apm-filter-out { display: none !important; }

.apm-item.apm-fade-in {
    animation: apmFade 0.35s var(--apm-ease) both;
}
@keyframes apmFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ── Cover ──────────────────────────────────────────────────── */
.apm-cover {
    position: relative;
    overflow: hidden;
    background: var(--apm-light);
    display: block;
    width: 100%;
}
.apm-cover-img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform var(--apm-dur) var(--apm-ease);
}
.apm-cover-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--apm-light);
}
.apm-cover-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--apm-dur) var(--apm-ease);
}

/* ── Hover effects ──────────────────────────────────────────── */
.apm-hover-gradient .apm-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.18) 40%, transparent 70%);
    opacity: 0;
    transition: opacity var(--apm-dur) var(--apm-ease);
    pointer-events: none;
    z-index: 1;
}
.apm-item.apm-hover-gradient:hover .apm-cover::after { opacity: 1; }
.apm-item.apm-hover-gradient:hover .apm-cover-img    { transform: scale(1.04); }

.apm-item.apm-hover-overlay:hover .apm-cover-overlay {
    opacity: 1; background: rgba(0,0,0,0.35);
}
.apm-item.apm-hover-overlay:hover .apm-cover-img { transform: scale(1.04); }
.apm-item.apm-hover-zoom:hover .apm-cover-img    { transform: scale(1.08); }

/* ── Hover caption ──────────────────────────────────────────── */
.apm-hover-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 20px 16px 16px;
    z-index: 2;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--apm-dur) var(--apm-ease), transform var(--apm-dur) var(--apm-ease);
    pointer-events: none;
}
.apm-item:hover .apm-hover-caption { opacity: 1; transform: translateY(0); }
.apm-caption-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    letter-spacing: -0.01em;
}
.apm-caption-meta {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.78);
}

/* ── Card footer ────────────────────────────────────────────── */
.apm-card-footer {
    padding: 8px 0 4px;
}
.apm-card-title {
    margin: 0 0 5px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--apm-black);
}
.apm-card-cats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
.apm-cat-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    white-space: nowrap;
    line-height: 1;
}
.apm-cat-tag:hover        { border-color: var(--apm-black); background: var(--apm-black); color: #fff; }
.apm-cat-tag.is-filtered  { border-color: var(--apm-black); background: var(--apm-black); color: #fff; }
.apm-card-meta {
    margin: 0;
    font-size: 11px;
    color: var(--apm-gray);
}

/* ── Empty ──────────────────────────────────────────────────── */
.apm-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--apm-gray);
    padding: 60px 0;
    font-size: 14px;
}

/* ── AJAX filtering state ───────────────────────────────────── */
.apm-grid.apm-filtering {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ================================================================
   VIDEO
   ================================================================ */
.apm-video-el {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s var(--apm-ease);
    pointer-events: none;
}
.apm-video-el.is-playing  { opacity: 1; }
.apm-video-thumb.is-hidden { opacity: 0; transition: opacity 0.4s var(--apm-ease); }

.apm-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.82);
    background: rgba(0,0,0,0.32);
    backdrop-filter: blur(2px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: opacity 0.28s var(--apm-ease), transform 0.28s var(--apm-ease);
    pointer-events: none;
}
.apm-item:hover .apm-play-badge {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.15);
}
.apm-lb-trigger { display: none !important; pointer-events: none; }

/* ── Case Study badge (inside .apm-cover, always visible) ── */
.apm-badge-case-study {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 9;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1.4;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ── YouTube hover-preview iframe ── */
.apm-yt-preview {
    position: absolute;
    inset: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border: none;
    z-index: 2;
    pointer-events: none;
    object-fit: cover;
}

/* ================================================================
   BEFORE / AFTER SLIDER
   ================================================================ */
.apm-ba {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
    cursor: col-resize;
    user-select: none;
}
.apm-ba-after  { display: block; width: 100%; height: auto; }
.apm-ba-before {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    clip-path: inset(0 50% 0 0);
    pointer-events: none;
}
.apm-ba-handle {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4;
    pointer-events: none;
}
.apm-ba-line { position: absolute; inset: 0; background: rgba(255,255,255,0.85); width: 2px; }
.apm-ba-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center; justify-content: center;
    position: relative; z-index: 5;
    pointer-events: all;
    cursor: col-resize;
    flex-shrink: 0;
}
.apm-ba-circle svg { color: #444; }

/* ================================================================
   LOAD MORE
   ================================================================ */
.apm-lm-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}
.apm-lm-btn {
    display: inline-flex;
    align-items: center;
    padding: 13px 48px;
    border: 1.5px solid #111;
    border-radius: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    color: #111;
}
.apm-lm-btn:hover          { background: #111; color: #fff; }
.apm-lm-btn:disabled       { opacity: 0.4; cursor: default; }
.apm-lm-btn:disabled:hover { background: transparent; color: #111; }

/* ================================================================
   PROJECT LIGHTBOX
   All rules use #apm-proj-lb prefix to override theme/Elementor styles
   ================================================================ */

#apm-proj-lb {
    position: fixed !important;
    inset: 0 !important;
    background: #000 !important;
    z-index: 9999999 !important;
    display: none;            /* JS sets display:flex */
    flex-direction: column !important;
    align-items: center !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Toolbar top-right — reset ALL inherited/theme button styles ── */
#apm-proj-lb .apl-toolbar {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    gap: 18px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}
#apm-proj-lb .apl-toolbar button,
#apm-proj-lb .apl-toolbar button:focus,
#apm-proj-lb .apl-toolbar button:active {
    all: unset !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    color: rgba(255,255,255,0.55) !important;
    transition: color 0.18s !important;
    outline: none !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
#apm-proj-lb .apl-toolbar button:hover {
    color: #fff !important;
}

/* ── Navigation arrows ── */
#apm-proj-lb .apl-prev,
#apm-proj-lb .apl-next {
    all: unset !important;
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 99999999 !important;
    cursor: pointer !important;
    display: flex;              /* NO !important → jQuery .toggle() can hide/show */
    align-items: center !important;
    justify-content: center !important;
    width: 64px !important;
    height: 140px !important;
    color: rgba(255,255,255,0.45) !important;
    transition: color 0.2s !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    pointer-events: auto !important;
}
#apm-proj-lb .apl-prev { left: 0 !important; }
#apm-proj-lb .apl-next { right: 0 !important; }
#apm-proj-lb .apl-prev:hover,
#apm-proj-lb .apl-next:hover {
    color: rgba(255,255,255,0.9) !important;
}

/* ── Scrollable content area ── */
#apm-proj-lb .apl-scroll-area {
    flex: 1 !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 60px 0 60px !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
    /* flex column → items stack vertically, aligned to center */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}
/* Video/single-image: center content vertically */
#apm-proj-lb.apl-is-short .apl-scroll-area {
    justify-content: center !important;
}
#apm-proj-lb .apl-scroll-area::-webkit-scrollbar { width: 4px !important; }
#apm-proj-lb .apl-scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18) !important; border-radius: 2px !important; }

/* ── Info bar ── */
#apm-proj-lb .apl-info {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 0 24px !important;
    text-align: center !important;
    background: transparent !important;
    flex-shrink: 0 !important;
}
#apm-proj-lb .apl-title {
    margin: 0 0 4px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #fff !important;
    letter-spacing: -0.01em !important;
    line-height: 1.3 !important;
    font-family: inherit !important;
}
#apm-proj-lb .apl-meta {
    margin: 0 !important;
    font-size: 12px !important;
    color: rgba(255,255,255,0.38) !important;
    font-family: inherit !important;
    font-weight: 400 !important;
}

/* ── Single-column gallery ── */
#apm-proj-lb .apl-justified-grid {
    column-count: 1 !important;
    width: 100% !important;
}
#apm-proj-lb .apl-j-img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto 10px !important;
    object-fit: unset !important;
}

/* ── Hero image (full-width thumbnail at top) ── */
#apm-proj-lb .apl-img {
    display: block;           /* NO !important — jQuery .hide() phải override được */
    max-width: 100% !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: unset !important;
    margin-left: auto !important;
    margin-right: auto !important;
    user-select: none !important;
}

/* ── Video: 16:9, centered ── */
#apm-proj-lb .apl-video-wrap {
    /* max width = fit the 70% of viewport height at 16:9 ratio */
    width: 100% !important;
    max-width: min(100%, calc(70vh * 16 / 9)) !important;
    position: relative !important;
    background: #000 !important;
    aspect-ratio: 16 / 9 !important;
    display: none;
}
#apm-proj-lb .apl-video-wrap iframe,
#apm-proj-lb .apl-video-wrap video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Mobile */
@media (max-width: 600px) {
    #apm-proj-lb .apl-scroll-area { padding: 60px 20px 40px !important; }
    #apm-proj-lb .apl-prev  { width: 44px !important; }
    #apm-proj-lb .apl-next  { width: 44px !important; }
}

@media (max-width: 767px) {
    .apm-wrap { padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
}

body.apm-no-scroll { overflow: hidden; }

/* ================================================================
   FEATURED GRID — 2 hàng bằng nhau, object-fit cover
   Hàng 1: 1 ảnh lớn (50%) + 2 ảnh bằng nhau (25% mỗi cái)
   Hàng 2: 3 ảnh đều (33% mỗi cái)
   ================================================================ */
.apm-grid-featured {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--apm-gap, 5px);
}

/* Hàng lẻ (1, 7, 13...): large + 2 medium */
.apm-grid-featured .apm-item:nth-child(6n+1) { grid-column: span 6; }
.apm-grid-featured .apm-item:nth-child(6n+2) { grid-column: span 3; }
.apm-grid-featured .apm-item:nth-child(6n+3) { grid-column: span 3; }
/* Hàng chẵn (2, 8, 14...): 3 đều */
.apm-grid-featured .apm-item:nth-child(6n+4) { grid-column: span 4; }
.apm-grid-featured .apm-item:nth-child(6n+5) { grid-column: span 4; }
.apm-grid-featured .apm-item:nth-child(6n)   { grid-column: span 4; }

/* Chiều cao cố định trực tiếp trên item — đáng tin hơn grid-auto-rows */
.apm-grid-featured .apm-item {
    height: var(--apm-row-height, 380px);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border-radius: var(--apm-radius);
}

/* Cover và ảnh lấp đầy item */
.apm-grid-featured .apm-cover {
    width: 100%;
    height: 100%;
}
.apm-grid-featured .apm-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.apm-grid-featured .apm-ba {
    width: 100%;
    height: 100%;
}
.apm-grid-featured .apm-ba-after,
.apm-grid-featured .apm-ba-before {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tablet ≤1024px: 2 cột đều, reset span về 1 */
@media (max-width: 1024px) {
    .apm-grid-featured {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .apm-grid-featured .apm-item:nth-child(n) {
        grid-column: span 1 !important;
        height: var(--apm-row-height, 260px); /* Elementor override qua selector, fallback 260px */
    }
}

/* Mobile ≤767px: 1 cột */
@media (max-width: 767px) {
    .apm-grid-featured {
        grid-template-columns: 1fr !important;
    }
    .apm-grid-featured .apm-item:nth-child(n) {
        grid-column: span 1 !important;
        height: var(--apm-row-height, 200px); /* Elementor override qua selector, fallback 200px */
    }
}

/* ── Gallery dots ── */
#apm-proj-lb .apl-dots {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
}
#apm-proj-lb .apl-dot {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.3) !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.2s !important;
    flex-shrink: 0 !important;
}
#apm-proj-lb .apl-dot.active {
    background: #fff !important;
    transform: scale(1.3) !important;
}
#apm-proj-lb .apl-dot:hover {
    background: rgba(255,255,255,0.7) !important;
}

/* ================================================================
   PROPOSAL FORM BOX (in filter sidebar)
   ================================================================ */
.apm-proposal-box {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,0.1);
}
.apm-proposal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.apm-proposal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.apm-proposal-input::placeholder { color: #999; }
.apm-proposal-input:focus { border-color: #aaa; }
.apm-proposal-btn {
    width: 100%;
    padding: 14px 16px;
    background-color: #c8472b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}
.apm-proposal-btn:hover { opacity: 0.85; }
.apm-proposal-btn:disabled { opacity: 0.6; cursor: default; }
.apm-proposal-msg {
    font-size: 13px;
    text-align: center;
    margin-top: 4px;
    line-height: 1.4;
}
.apm-proposal-msg.success { color: #2a7a2a; }
.apm-proposal-msg.error   { color: #c0392b; }
