/* Header layout fix PC */
@media (min-width: 921px) {
    .ast-primary-header-bar .site-primary-header-wrap {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 32px;
    }

    .ast-builder-grid-row-container {
        display: flex !important;
        align-items: center !important;
    }

    /* Logo align trai, khong break */
    .site-branding {
        flex-shrink: 0;
    }

    /* Menu align phai */
    .main-header-menu,
    .main-navigation {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .main-header-menu li {
        white-space: nowrap;
    }

    /* Logo image size */
    .custom-logo-link img {
        max-height: 50px;
        width: auto;
    }
}

/* Mobile: stack dung */
@media (max-width: 920px) {
    .ast-primary-header-bar .site-primary-header-wrap {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Footer */
.thiepcuoi-footer {
    background: #2A1F18;
    color: #D4C5B5;
    padding: 60px 0 0;
    margin-top: 80px;
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr 1.3fr;
    gap: 48px;
}

.footer-col h4 {
    color: #FFF;
    font-family: 'Lora', serif;
    font-size: 18px;
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    color: #D4C5B5;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #FFF;
}

.footer-disclosure-title {
    margin-top: 24px;
}

.footer-disclosure {
    font-size: 13px;
    line-height: 1.6;
    color: #A89685;
    font-style: italic;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 48px;
    padding: 20px 24px;
    text-align: center;
    font-size: 14px;
    color: #A89685;
}

@media (max-width: 920px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Home articles section */
.home-articles {
    padding: 80px 0;
    background: #FBF7F0;
}

.home-articles .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.home-articles h2 {
    text-align: center;
    font-family: 'Lora', serif;
    font-size: 36px;
    color: #3E2C20;
    margin-bottom: 8px;
}

.home-articles .section-subtitle {
    text-align: center;
    color: #6B5544;
    margin-bottom: 48px;
}

.home-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.article-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(62,44,32,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(62,44,32,0.15);
}

.article-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.article-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.article-card-body {
    padding: 20px;
}

.article-card-title {
    font-family: 'Lora', serif;
    font-size: 18px;
    color: #3E2C20;
    margin: 0 0 12px;
    line-height: 1.4;
}

.article-card-excerpt {
    color: #6B5544;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.article-card-cta {
    color: #A0826D;
    font-weight: 600;
    font-size: 14px;
}

.home-articles-cta {
    text-align: center;
}

.home-articles-cta .btn {
    display: inline-block;
    padding: 12px 32px;
    background: transparent;
    border: 2px solid #A0826D;
    color: #A0826D;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s;
}

.home-articles-cta .btn:hover {
    background: #A0826D;
    color: white;
}

@media (max-width: 920px) {
    .home-articles-grid {
        grid-template-columns: 1fr;
    }
    .home-articles {
        padding: 48px 0;
    }
    .home-articles h2 {
        font-size: 28px;
    }
}

/* Single post layout with sidebar */
.single-post-wrap {
    padding: 40px 0 80px;
}

.single-post-wrap .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.single-post-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
}

.single-post-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
}

.single-post-content .entry-title {
    font-family: 'Lora', serif;
    font-size: 32px;
    color: #3E2C20;
    margin-bottom: 12px;
    line-height: 1.3;
}

.single-post-content .entry-meta {
    color: #8B7560;
    font-size: 14px;
    margin-bottom: 24px;
}

.single-post-content .entry-featured {
    margin: 0 -40px 32px;
}

.single-post-content .entry-featured img {
    width: 100%;
    display: block;
}

/* Sidebar */
.single-post-sidebar {
    position: relative;
}

.sidebar-block {
    background: white;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(62,44,32,0.06);
}

.sidebar-block-title {
    font-family: 'Lora', serif;
    font-size: 18px;
    color: #3E2C20;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #F5E9D8;
}

.sidebar-toc {
    position: static;
    max-height: none;
    overflow: visible;
}

.sidebar-toc nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-toc nav li {
    margin-bottom: 8px;
}

.sidebar-toc nav .toc-h3 {
    padding-left: 16px;
}

.sidebar-toc nav a {
    color: #6B5544;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    display: block;
    padding: 4px 0;
    transition: color 0.2s;
}

.sidebar-toc nav a:hover,
.sidebar-toc nav a.active {
    color: #A0826D;
    font-weight: 600;
}

/* Mini product card */
.mini-product-card {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F5E9D8;
}

.mini-product-card:last-child {
    border-bottom: none;
}

.mini-product-card img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.mini-product-card h4 {
    font-size: 13px;
    margin: 0 0 4px;
    color: #3E2C20;
    font-family: inherit;
    line-height: 1.3;
}

.mini-product-card .price {
    color: #D9534F;
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px;
}

.mini-cta {
    display: inline-block;
    padding: 4px 10px;
    background: #EE4D2D;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Related posts in sidebar */
.sidebar-related ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-related li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F5E9D8;
}

.sidebar-related li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.sidebar-related a {
    display: flex;
    gap: 12px;
    color: #3E2C20;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
}

.sidebar-related img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Calculator CTA */
.sidebar-calc-cta {
    background: linear-gradient(135deg, #A0826D 0%, #8A6F5C 100%);
    color: white;
}

.sidebar-calc-cta .sidebar-block-title {
    color: white;
    border-bottom-color: rgba(255,255,255,0.2);
}

.sidebar-calc-cta p {
    color: rgba(255,255,255,0.9);
    margin: 0 0 16px;
}

.sidebar-calc-cta .btn-primary {
    display: inline-block;
    background: white;
    color: #A0826D;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* Mobile: sidebar stack below */
@media (max-width: 920px) {
    .single-post-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .single-post-content {
        padding: 24px;
    }

    .single-post-content .entry-featured {
        margin: 0 -24px 24px;
    }

    .single-post-content .entry-title {
        font-size: 24px;
    }

    .sidebar-toc {
        position: static;
    }
}

/* Calculator center fix */
.tc-calculator,
.calculator-wrap,
.calculator-form,
[class*="calculator"] {
    max-width: 700px;
    margin: 40px auto !important;
    padding: 32px;
}

/* Calculator page entry-content full-width container fix */
.page-template-default.page .entry-content,
body.page-cong-cu-tinh-so-thiep-cuoi .entry-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Astra wide layout override for calculator page */
body.page-cong-cu-tinh-so-thiep-cuoi #primary {
    margin: 0 auto;
}

@media (max-width: 920px) {
    .tc-calculator,
    .calculator-wrap,
    .calculator-form {
        margin: 20px auto !important;
        padding: 20px;
    }
}

/* ===== BUG #17 FIX: Single post wide layout ===== */

/* Override Astra ast-narrow-container CHI trong single post */
body.single-post .ast-container {
    max-width: 1200px !important;
}

/* Single post grid: tang gap content vs sidebar */
body.single-post .single-post-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

/* Allow content shrink properly inside grid */
body.single-post .single-post-content {
    min-width: 0;
    max-width: 100%;
}

/* Sidebar fixed width, khong co lai */
body.single-post .single-post-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* Mobile: stack 1 column nhu cu */
@media (max-width: 920px) {
    body.single-post .ast-container {
        max-width: 100% !important;
    }
    body.single-post .single-post-grid {
        grid-template-columns: 1fr;
    }
    body.single-post .single-post-sidebar {
        width: 100%;
    }
}

/* ===== BUG #19: Responsive table on mobile ===== */

/* Mobile: scroll ngang khi bang qua rong */
@media (max-width: 768px) {
    .entry-content table,
    .entry-content .wp-block-table,
    .single-post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        white-space: nowrap;
        font-size: 14px;
    }

    .entry-content table th,
    .entry-content table td {
        white-space: normal;
        min-width: 100px;
        padding: 8px 12px;
    }

    /* Nice scrollbar indicator */
    .entry-content table::-webkit-scrollbar {
        height: 4px;
    }
    .entry-content table::-webkit-scrollbar-thumb {
        background: #A0826D;
        border-radius: 2px;
    }
}

/* Fix Vietnamese font rendering (Bug #19 phu - "mien" -> "mi en") */
.entry-content,
.entry-title,
.single-post-content {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    -webkit-font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
}

/* Title bai: tranh word-break giua tu Vietnamese co dau */
.entry-title,
.single-post-content h1,
.single-post-content h2,
.single-post-content h3 {
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-hyphens: none;
    hyphens: none;
}

/* ===== BUG #20: Mobile header — hide Site Title text, fix logo size ===== */

/* An site title text khi da co custom logo (ca desktop + mobile) */
.has-custom-logo .site-title,
.has-custom-logo .site-description,
.ast-site-identity .site-title,
.ast-site-identity .site-description {
    display: none !important;
}

/* SEO-friendly: an visual nhung giu accessible */
.has-custom-logo .site-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Mobile: logo size + container width */
@media (max-width: 920px) {
    .custom-logo-link img,
    .site-logo-img img {
        max-height: 48px !important;
        max-width: 140px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
    }

    .site-branding,
    .ast-site-identity {
        max-width: 60vw;
    }

    /* Header padding gon lai tren mobile */
    .ast-primary-header-bar {
        padding: 8px 0 !important;
    }
}

/* ===== BUG #21 ROUND 5: Triet de fix bang mobile + title VN ===== */

/* Strategy: Wrap table trong block scroll-able voi width auto-fit cells */
@media (max-width: 768px) {

    /* Reset Round 4 rule (display:block khien cells expand qua rong) */
    .entry-content table,
    .single-post-content table {
        display: table !important;
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal;
        font-size: 13px;
        table-layout: auto;
    }

    /* Wrap parent: cho phep scroll ngang khi bang vuot viewport */
    .entry-content figure.wp-block-table,
    .entry-content .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        margin-bottom: 24px;
        /* Visual hint: gradient fade o mep phai bao co scroll */
        background-image: linear-gradient(to right, transparent calc(100% - 30px), rgba(160, 130, 109, 0.15));
        background-size: 100% 100%;
        background-repeat: no-repeat;
        background-position: right center;
    }

    /* Cell sizing - cho cell co theo content nhung co min dam bao readable */
    .entry-content table th,
    .entry-content table td,
    .single-post-content table th,
    .single-post-content table td {
        padding: 8px 10px !important;
        font-size: 13px;
        line-height: 1.4;
        word-break: break-word;
        min-width: 80px;
        max-width: 200px;
    }

    /* Cot dau (Mau) thuong co text dai → gioi han max-width chat hon */
    .entry-content table td:first-child,
    .entry-content table th:first-child {
        max-width: 130px;
    }

    /* Bold cho header cells */
    .entry-content table th {
        font-weight: 600;
        background: #FBF7F0;
        white-space: nowrap;
    }

    /* Scrollbar chi bao */
    .entry-content figure.wp-block-table::-webkit-scrollbar {
        height: 6px;
    }
    .entry-content figure.wp-block-table::-webkit-scrollbar-thumb {
        background: #A0826D;
        border-radius: 3px;
    }
}

/* ===== Title Vietnamese fix (selector manh hon) ===== */

/* Apply cho TAT CA heading trong post/page content */
body.single h1,
body.single h2,
body.single h3,
body.page h1,
body.page h2,
body.page h3,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-title {
    word-break: keep-all !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: none;
    hyphens: none;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
}

/* Force re-render khi viewport mobile (workaround Lora font kerning bug) */
@media (max-width: 768px) {
    body.single h1,
    body.single h2,
    body.single .entry-title,
    body.page h1,
    body.page h2 {
        letter-spacing: -0.005em;
        word-spacing: 0;
    }
}

/* ===== BUG #21 ROUND 6: Triet de fix bang mobile + title VN ===== */

/* Force body NEVER overflow ngang tren mobile */
@media (max-width: 920px) {
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Tat ca container phai fit trong viewport */
    .ast-container,
    .single-post-wrap,
    .single-post-grid,
    .single-post-content,
    .entry-content {
        max-width: 100% !important;
        overflow-x: visible;
    }
}

/* Table wrapper: scroll rieng cho table, KHONG anh huong body */
.table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 16px 0 24px;
    border: 1px solid #E8DDD2;
    border-radius: 4px;
    background:
        linear-gradient(to right, white 30%, rgba(255,255,255,0)),
        linear-gradient(to right, rgba(160,130,109,0.15), white 70%) right;
    background-size: 30px 100%, 30px 100%;
    background-repeat: no-repeat;
    background-attachment: local, local;
}

.table-scroll-wrap table {
    margin: 0;
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.table-scroll-wrap th,
.table-scroll-wrap td {
    padding: 12px 14px;
    border: 1px solid #E8DDD2;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    min-width: 90px;
    max-width: 220px;
}

.table-scroll-wrap th {
    background: #FBF7F0;
    font-weight: 600;
    white-space: nowrap;
}

/* Mobile scrollbar hint */
@media (max-width: 768px) {
    .table-scroll-wrap {
        font-size: 13px;
    }
    .table-scroll-wrap::-webkit-scrollbar {
        height: 6px;
    }
    .table-scroll-wrap::-webkit-scrollbar-thumb {
        background: #A0826D;
        border-radius: 3px;
    }
    .table-scroll-wrap th,
    .table-scroll-wrap td {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 80px;
        max-width: 160px;
    }
}

/* ===== Title Vietnamese render fix (lan 3) ===== */

/* Force browser render voi precision cao cho VN diacritics */
.entry-title,
.entry-content h1,
.entry-content h2,
.entry-content h3,
body.single h1,
body.single h2,
body.page h1,
body.page h2 {
    text-rendering: geometricPrecision !important;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-break: keep-all !important;
    overflow-wrap: break-word;
    hyphens: none;
}

/* Mobile: ep word-spacing chat + font on dinh */
@media (max-width: 768px) {
    .entry-title,
    .entry-content h1,
    .entry-content h2,
    body.single h1,
    body.single h2,
    body.page h1,
    body.page h2 {
        word-spacing: -0.02em;
        letter-spacing: 0;
        font-feature-settings: "kern" 1, "liga" 1;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* ===== FEATURE A: Page Tất cả thiệp ===== */

.all-products-wrap {
    padding: 40px 0 80px;
    background: #FAF7F2;
}

.all-products-wrap .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.all-products-header {
    text-align: center;
    margin-bottom: 40px;
}

.all-products-header h1 {
    font-family: 'Lora', serif;
    font-size: 32px;
    color: #3E2C20;
    margin-bottom: 12px;
}

.all-products-header .lead {
    color: #6B5544;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(62,44,32,0.06);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    color: #6B5544;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #E8DDD2;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #3E2C20;
    cursor: pointer;
    min-width: 180px;
}

.filter-results {
    margin-left: auto;
    color: #6B5544;
    font-size: 14px;
}

#results-count {
    font-weight: 600;
    color: #A0826D;
}

/* Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(62,44,32,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(62,44,32,0.12);
}

.product-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.product-card-image {
    aspect-ratio: 1;
    background: #FBF7F0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    color: #C0B0A0;
    font-size: 14px;
}

.product-card-body {
    padding: 14px;
}

.product-card-name {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #3E2C20;
    margin: 0 0 8px;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.product-card-meta .price {
    color: #D9534F;
    font-weight: 700;
    font-size: 16px;
}

.product-card-meta .sold {
    color: #999;
    font-size: 12px;
}

.product-card-rating {
    color: #FFA500;
    font-size: 12px;
    margin-bottom: 8px;
}

.product-card-cta {
    display: inline-block;
    background: #EE4D2D;
    color: white;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.product-card-link:hover .product-card-cta {
    background: #D9421E;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6B5544;
}

/* Responsive */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .all-products-header h1 {
        font-size: 24px;
    }

    .filter-bar {
        gap: 12px;
        padding: 12px;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: 100%;
    }

    .filter-select {
        width: 100%;
        min-width: 0;
    }

    .filter-results {
        margin-left: 0;
        width: 100%;
        text-align: right;
    }

    .product-card-body {
        padding: 10px;
    }

    .product-card-name {
        font-size: 13px;
        min-height: 36px;
    }
}

/* ===== FEATURE B Tier 1: Sticky CTA Mobile ===== */

.sticky-cta-mobile {
    display: none; /* Hide PC */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 12px rgba(62,44,32,0.15);
    z-index: 9998;
    padding: 8px 12px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.sticky-cta-mobile.hidden {
    transform: translateY(100%);
}

.sticky-cta-content {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.sticky-cta-image {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #FBF7F0;
}

.sticky-cta-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sticky-cta-info {
    flex: 1;
    min-width: 0;
}

.sticky-cta-name {
    font-size: 12px;
    color: #3E2C20;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.sticky-cta-price {
    color: #D9534F;
    font-weight: 700;
    font-size: 14px;
}

.sticky-cta-button {
    background: #EE4D2D;
    color: white;
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.sticky-cta-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

/* Show on mobile only */
@media (max-width: 768px) {
    .sticky-cta-mobile {
        display: block;
    }

    /* Add padding-bottom to body để CTA không che content */
    body.single {
        padding-bottom: 70px;
    }
}

/* ===== FEATURE B Tier 2: Exit-intent Popup ===== */

.exit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(62,44,32,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.exit-popup {
    background: white;
    border-radius: 12px;
    max-width: 720px;
    width: 100%;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.exit-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px 12px;
}

.exit-popup-close:hover {
    color: #3E2C20;
}

.exit-popup h2 {
    font-family: 'Lora', serif;
    color: #3E2C20;
    font-size: 28px;
    margin: 0 0 8px;
}

.exit-popup-subtitle {
    color: #6B5544;
    margin: 0 0 24px;
}

.exit-popup-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.exit-popup-product {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #E8DDD2;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.exit-popup-product:hover {
    transform: translateY(-4px);
    border-color: #A0826D;
}

.exit-popup-product img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.exit-popup-product-info {
    padding: 12px;
}

.exit-popup-product-info .name {
    font-size: 13px;
    line-height: 1.3;
    color: #3E2C20;
    margin-bottom: 6px;
    min-height: 34px;
}

.exit-popup-product-info .price {
    color: #D9534F;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}

.exit-popup-product-info .cta {
    color: #A0826D;
    font-weight: 600;
    font-size: 13px;
}

/* Mobile: HIDE popup (Google penalty intrusive interstitials) */
@media (max-width: 768px) {
    .exit-popup-overlay {
        display: none !important;
    }
}

/* ===== FEATURE B Tier 3: Inline CTA boxes ===== */

.inline-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #FBF7F0;
    border-left: 4px solid #A0826D;
    border-radius: 4px;
    padding: 20px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.inline-cta-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.inline-cta-product-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.inline-cta-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inline-cta-text {
    flex: 1;
    min-width: 200px;
}

.inline-cta-text h4 {
    font-family: 'Lora', serif;
    font-size: 17px;
    color: #3E2C20;
    margin: 0 0 6px;
}

.inline-cta-text p {
    color: #6B5544;
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.4;
}

.inline-cta-text .price {
    color: #D9534F;
    font-weight: 600;
}

.inline-cta-button {
    background: #A0826D;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.inline-cta-button:hover {
    background: #8A6F5C;
    color: white;
}

.inline-cta-product .inline-cta-button {
    background: #EE4D2D;
}

.inline-cta-product .inline-cta-button:hover {
    background: #D9421E;
}

@media (max-width: 600px) {
    .inline-cta {
        padding: 16px;
        gap: 12px;
    }

    .inline-cta-button {
        width: 100%;
        text-align: center;
    }

    .inline-cta-text {
        min-width: 0;
        width: 100%;
    }
}

/* ===== BUG #25: Page default template — center H1 + content ===== */

/* Page mặc định (so-sanh, ve-chung-toi, thiep-cuoi-online, chinh-sach, dieu-khoan) */
body.page-template-default .entry-header,
body.page-template-default .entry-content {
    max-width: 800px;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.page-template-default .entry-header {
    text-align: center;
    padding: 40px 24px 20px;
}

body.page-template-default .entry-title {
    font-family: 'Lora', serif;
    font-size: 36px;
    color: #3E2C20;
    margin: 0 0 12px;
    line-height: 1.3;
}

body.page-template-default .entry-content {
    padding: 0 24px 60px;
}

/* Pillar page /thiep-cuoi-online/ rộng hơn 1 chút */
body.page-id-7 .entry-header,
body.page-id-7 .entry-content {
    max-width: 900px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    body.page-template-default .entry-title {
        font-size: 26px;
    }
    body.page-template-default .entry-header {
        padding: 24px 16px 16px;
    }
    body.page-template-default .entry-content {
        padding: 0 16px 40px;
    }
}
