/* =====================================================
   Vĩnh XD Element — Frontend Styles
   ===================================================== */

/* ─── POST WIDGET ─── */
.vxd-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.vxd-post-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    transition: transform .35s cubic-bezier(.25,.46,.45,.94),
                box-shadow .35s cubic-bezier(.25,.46,.45,.94);
}
.vxd-post-card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: 0 18px 36px rgba(0,0,0,.14), 0 6px 12px rgba(0,0,0,.07);
}

.vxd-post-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vxd-post-thumb {
    position: relative;
    overflow: hidden;
}
.vxd-post-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.vxd-post-card:hover .vxd-post-thumb img {
    transform: scale(1.04);
}
.vxd-no-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #eee;
}

.vxd-post-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #0066B1;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.vxd-post-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.vxd-post-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    display: block;
}

.vxd-post-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px;
    line-height: 1.4;
}

.vxd-post-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    flex-grow: 1;
    margin: 0 0 12px;
}

.vxd-post-readmore {
    font-size: 13px;
    font-weight: 600;
    color: #0066B1;
    margin-top: auto;
}

/* ─── XE SHARED BASE ─── */
.vxd-xe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.vxd-xe-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    transition: transform .35s cubic-bezier(.25,.46,.45,.94),
                box-shadow .35s cubic-bezier(.25,.46,.45,.94);
}
.vxd-xe-card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: 0 20px 40px rgba(0,0,0,.13), 0 6px 12px rgba(0,0,0,.07);
}
.vxd-xe-card.vxd-hide { display: none !important; }

.vxd-xe-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Image wrap ── */
.vxd-xe-image-wrap {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}
.vxd-xe-image-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: contain;   /* contain = hiện full xe như ảnh mẫu */
    display: block;
    transition: transform .4s ease;
    padding: 8px;
}
.vxd-xe-card:hover .vxd-xe-image-wrap img {
    transform: scale(1.04);
}

/* ── Body chung ── */
.vxd-xe-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Wrapper riêng cho phần trong <a> khi card có khu vực tương tác (Giá Xe XD / Xe Tab) */
.vxd-xe-link-body {
    padding: 14px 16px 0;
}

/* ── Tên xe ── */
.vxd-xe-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.3;
}

/* ── Đường kẻ phân cách ── */
.vxd-xe-divider {
    border: none;
    border-top: 1px solid #eeeeee;
    margin: 0 0 10px;
}

/* ─────────────────────────────────────────────
   LAYOUT BASIC (widget-xe) — giống ảnh 2
   Tên xe to + label/giá dạng 2 dòng
───────────────────────────────────────────── */
.vxd-xe-card--basic .vxd-xe-title {
    font-size: 17px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 12px;
}

/* Dòng giá / trả góp */
.vxd-xe-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 14px;
}
.vxd-xe-gia-label,
.vxd-xe-gop-label {
    color: #555;
    font-weight: 400;
    white-space: nowrap;
}
.vxd-xe-gia-value {
    color: #e53935;
    font-weight: 700;
    font-size: 15px;
}
.vxd-xe-gop-value {
    color: #0066B1;
    font-weight: 700;
    font-size: 15px;
}

/* ─────────────────────────────────────────────
   LAYOUT PLUS (widget-xe-plus) — giống ảnh 1
   Ảnh nền trắng, tên dưới, meta-row: dòng xe + nedc
───────────────────────────────────────────── */
.vxd-xe-card--plus .vxd-xe-image-wrap img {
    aspect-ratio: 4/3;
    object-fit: contain;
    padding: 12px;
}

.vxd-xe-card--plus .vxd-xe-title {
    font-size: 22px;
    font-weight: 800;
    font-style: italic;
    color: #1a1a1a;
    margin: 0 0 8px;
}

/* Hàng meta: dòng xe (trái) + NEDC (phải) */
.vxd-xe-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}
.vxd-xe-dong-xe-text {
    color: #0066B1;
    font-size: 13px;
    font-weight: 600;
}
.vxd-xe-nedc-row {
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 3px;
}
.vxd-xe-nedc-value {
    font-weight: 600;
    color: #1a1a1a;
}
.vxd-xe-nedc-label {
    color: #888;
    font-size: 12px;
}

/* Dòng giá trong Plus */
.vxd-xe-price-row--plus {
    justify-content: space-between;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
    margin-top: 4px;
    margin-bottom: 0;
}
.vxd-xe-price-row--plus .vxd-xe-gia-label,
.vxd-xe-price-row--plus .vxd-xe-gop-label {
    font-size: 13px;
}
.vxd-xe-price-row--plus .vxd-xe-gia-value,
.vxd-xe-price-row--plus .vxd-xe-gop-value {
    font-size: 14px;
}

/* ── Bảng phiên bản (Tab & Giá Xe widgets) ── */
.vxd-xe-versions-box {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-bottom: 12px;
    flex-grow: 1;
    text-align: left;
}
.vxd-xe-version-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 13px;
}
.vxd-xe-version-row:last-child { border-bottom: none; }
.vxd-xe-version-row .v-name  { color: #555; padding-right: 10px; }
.vxd-xe-version-row .v-price { color: #333; font-weight: 600; }

/* ─────────────────────────────────────────────
   PHẦN GIÁ + ƯU ĐÃI TƯƠNG TÁC (vud-*)
   Dùng cho Giá Xe XD & Xe Tab Vĩnh XD
   Nằm NGOÀI thẻ <a> để checkbox bấm được
───────────────────────────────────────────── */
.vud-wrap {
    color: inherit;
    max-width: 100%;
    padding: 0 16px 16px;
    text-align: left;
}

/* ── Danh sách phiên bản ── */
.vud-ver-list {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-bottom: 4px;
}
.vud-ver-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px dashed #f0f0f0;
    gap: 10px;
}
.vud-ver-item:last-child { border-bottom: none; }
.vud-ver-name {
    font-size: 13px;
    color: #555;
    flex: 1;
}
.vud-ver-price {
    text-align: right;
    flex-shrink: 0;
}
.vud-price-old {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    transition: color .2s ease;
}
.vud-price-old.vud-strike {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
    font-size: 12px;
}
.vud-price-new {
    display: none;
    font-size: 14px;
    font-weight: 700;
    color: #ea580c;
    margin-top: 2px;
}

/* ── Box chung: border bo tròn, legend đè lên border ── */
.vud-box {
    position: relative;
    border-radius: 10px;
    padding: 18px 14px 14px;
    margin: 16px 0 6px;
}
.vud-box-km { border: 1.5px solid var(--vxd-uu-dai-color, #ea580c); }

/* ── Legend đè lên border (giống fieldset/legend) ── */
.vud-box-label {
    position: absolute;
    top: -11px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: 100px;
    padding: 6px 12px;
    line-height: 1;
}
.vud-box-km .vud-box-label {
    background: var(--vxd-uu-dai-color, #ea580c);
    color: #fff;
}

/* ── Ưu đãi: block, mỗi dòng 1 chương trình ── */
.vud-block-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Checkbox label: không nền, không viền ── */
.vud-chk-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    padding: 2px 0;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
}
.vud-chk-label input[type=checkbox] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}
.vud-box-km .vud-chk-label input { accent-color: var(--vxd-uu-dai-color, #ea580c); }
.vud-chk-text { font-weight: 500; color: #1e293b; }

/* badge giá */
.vud-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
    white-space: nowrap;
}
.vud-box-km .vud-badge {
    background: color-mix(in srgb, var(--vxd-uu-dai-color, #ea580c) 15%, #fff);
    color: var(--vxd-uu-dai-color, #ea580c);
}

/* Badge trả góp (Tab / Giá Xe widgets) */
.vxd-xe-badge-gop {
    background: linear-gradient(135deg, #0066B1, #004b87);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,102,177,.2);
    margin: 0 16px 16px;
}
.vxd-xe-badge-gop span {
    color: #ffeb3b;
    font-size: 15px;
    font-weight: 700;
    margin-left: 3px;
}

/* ─── TAB FILTER ─── */
.vxd-xe-filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    justify-content: center;
}
.vxd-xe-tab-btn {
    padding: 8px 20px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    color: #0066B1;
    transition: all .25s;
    line-height: 1;
}
.vxd-xe-tab-btn.active,
.vxd-xe-tab-btn:hover {
    background: #0066B1 !important;
    color: #fff !important;
    border-color: #0066B1 !important;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .vxd-post-grid  { grid-template-columns: repeat(2, 1fr); }
    .vxd-xe-grid    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .vxd-post-grid  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .vxd-xe-grid    { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .vxd-xe-card    { padding: 10px; }
    .vxd-xe-title   { font-size: 14px; margin: 10px 0 8px; }
    .vxd-xe-badge-gia { font-size: 11px; padding: 3px 8px; top: 6px; right: 6px; }
    .vxd-xe-version-row { font-size: 11px; flex-direction: column; align-items: flex-start; gap: 2px; }
    .vxd-xe-version-row .v-price { font-weight: 700; color: #d0021b; }
    .vxd-xe-badge-gop { padding: 8px 6px; font-size: 12px; border-radius: 6px; }
    .vxd-xe-badge-gop span { font-size: 13px; }

    .vxd-xe-filter-tabs { gap: 6px; }
    .vxd-xe-tab-btn { padding: 5px 12px; font-size: 12px; }

    .vxd-post-title  { font-size: 14px; }
    .vxd-post-body   { padding: 12px; }
}

@media (max-width: 480px) {
    .vxd-post-grid  { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════
   WIDGET: ƯU ĐÃI XD  (.vxdud-*)
   ===================================================== */

.vxdud-widget {
    --vxdud-accent: #ea580c;
    font-family: inherit;
}

/* ── Box ưu đãi ── */
.vxdud-uu-dai-box {
    position: relative;
    border: 1.5px solid var(--vxdud-accent);
    border-radius: 12px;
    padding: 20px 16px 16px;
    margin-bottom: 24px;
}

.vxdud-uu-dai-label {
    position: absolute;
    top: -14px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--vxdud-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 5px 14px;
    border-radius: 100px;
    line-height: 1;
}

.vxdud-uu-dai-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.25);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.vxdud-uu-dai-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Checkbox label */
.vxdud-chk-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    padding: 2px 0;
    background: none !important;
    border: none !important;
}

.vxdud-chk-label input[type=checkbox] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
    accent-color: var(--vxdud-accent);
}

.vxdud-chk-text {
    font-weight: 500;
    color: #1e293b;
    flex: 1;
}

/* Badge giảm giá */
.vxdud-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
    background: color-mix(in srgb, var(--vxdud-accent) 15%, #fff);
    color: var(--vxdud-accent);
}

/* ── Bảng giá ── */
.vxdud-table {
    width: 100%;
    border-collapse: collapse;
}

/* Tiêu đề bảng */
.vxdud-table-head {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    align-items: center;
    background: #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 4px;
    gap: 10px;
}

.vxdud-table-head span {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #1d4ed8;
}

.vxdud-col-gia-head,
.vxdud-col-uu-dai-head {
    text-align: center;
}

/* Hàng xe */
.vxdud-table-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
    transition: background .15s ease;
}

.vxdud-table-row:last-child {
    border-bottom: none;
}

.vxdud-table-row:hover {
    background: #fafafa;
}

/* Cột 1: Ảnh */
.vxdud-col-thumb {
    display: flex;
    align-items: center;
}

.vxdud-col-thumb a {
    display: block;
    line-height: 0;
}

.vxdud-col-thumb img {
    height: 60px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    display: block;
}

.vxdud-no-thumb {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-decoration: none;
}

/* Cột 2: Giá từ */
.vxdud-col-gia {
    font-size: 16px;
    font-weight: 700;
    color: #1d4ed8;
    text-align: center;
}

/* Cột 3: Giá ưu đãi */
.vxdud-col-uu-dai {
    font-size: 16px;
    font-weight: 700;
    color: #ea580c;
    text-align: center;
    transition: all .2s ease;
}

/* Trạng thái khi chưa chọn ưu đãi: cột 3 mờ */
.vxdud-col-uu-dai.vxdud-no-discount {
    color: #9ca3af;
    font-weight: 400;
    font-size: 13px;
    font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .vxdud-table-head {
        grid-template-columns: 70px 1fr 1fr;
        padding: 10px 10px;
    }
    .vxdud-table-head span { font-size: 11px; letter-spacing: .3px; }

    .vxdud-table-row {
        grid-template-columns: 70px 1fr 1fr;
        padding: 8px 10px;
        gap: 6px;
    }

    .vxdud-col-thumb img { height: 44px; }
    .vxdud-col-gia,
    .vxdud-col-uu-dai { font-size: 13px; }

    .vxdud-chk-label { font-size: 13px; }
    .vxdud-badge { font-size: 11px; padding: 2px 8px; }
}
