/* ==========================================================================
   Tràng An — Trang chủ (các section dưới hero → trên footer)
   Port từ CMS cũ (templates/kaizen) sang stack mới, CSS tự chứa, scope .pf-home
   ========================================================================== */

.pf-home {
    --pf-primary: #ED4A2A;   /* đỏ cam — màu chính Tràng An (PCCC) */
    --pf-accent: #d32128;
    --pf-green: #41ad45;
    --pf-green-cta: #1a7d20;   /* xanh đậm cho nút CTA — đạt tương phản WCAG AA với chữ trắng */
    --pf-gray: #eaeef4;
}

/* Section header: tiêu đề + link "Xem tất cả" cùng hàng */
.pf-home .pf-section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 16px; margin-bottom: 24px;
}
.pf-home .pf-section-head .pf-box-title { margin-bottom: 0; }
.pf-home .pf-view-all {
    color: var(--pf-primary); font-weight: 600; font-size: 15px;
    text-decoration: none; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px;
}
.pf-home .pf-view-all:hover { color: var(--pf-accent); }
.pf-home .pf-view-all i { transition: transform .15s; }
.pf-home .pf-view-all:hover i { transform: translateX(3px); }

.pf-home .pf-box-title {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.pf-home .pf-box-title a,
.pf-home .pf-box-title {
    color: var(--pf-primary);
    text-decoration: none;
}

.pf-home .pf-box-title a:hover { color: var(--pf-accent); }

.pf-bg-gray {
    background-image: linear-gradient(180deg, var(--pf-gray) 0%, transparent 100%);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.pf-sidebar .pf-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    overflow: hidden;
    margin-bottom: 24px;
}

.pf-sidebar .pf-card-head {
    background: var(--pf-primary);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    padding: 12px 16px;
    margin: 0;
    text-transform: uppercase;
}

.pf-cat-list { list-style: none; margin: 0; padding: 8px 0; }

.pf-cat-list li { border-bottom: 1px solid #eef1f6; }
.pf-cat-list li:last-child { border-bottom: 0; }

.pf-cat-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #243056;
    text-decoration: none;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.pf-cat-list a:hover { background: var(--pf-gray); color: var(--pf-primary); }
.pf-cat-list a i { color: var(--pf-green); }

.pf-cat-list .pf-sub { list-style: none; margin: 0; padding: 0 0 0 18px; }
.pf-cat-list .pf-sub a { padding: 8px 16px; font-weight: 400; font-size: 14px; }
.pf-cat-list .pf-sub a::before { content: "•"; color: var(--pf-green); }

/* ── Hỗ trợ trực tuyến ───────────────────────────────────────────────────── */
.pf-support-body { padding: 16px; }
.pf-support-body img { max-width: 100%; height: auto; }
.pf-support-group { margin-top: 12px; }
.pf-support-group h4 { font-size: 16px; color: var(--pf-primary); margin: 8px 0; }
.pf-support-group div { margin-bottom: 4px; color: #333; }
.pf-support-group i { color: var(--pf-green); margin-right: 6px; }

/* ── Đăng ký bảo hộ thương hiệu ──────────────────────────────────────────── */
.pf-trademark-body { padding: 16px; }
.pf-trademark-thumb {
    position: relative; display: block; width: 100%; padding: 0; border: 0; line-height: 0;
    background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden;
}
.pf-trademark-thumb img { width: 100%; height: auto; display: block; transition: transform .3s; }
.pf-trademark-thumb:hover img { transform: scale(1.04); }
.pf-trademark-thumb:focus-visible { outline: 2px solid var(--pf-primary); outline-offset: 2px; }
.pf-trademark-zoom {
    position: absolute; right: 10px; bottom: 10px;
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(24, 32, 138, .85); color: #fff; font-size: 16px;
    opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s;
}
.pf-trademark-thumb:hover .pf-trademark-zoom,
.pf-trademark-thumb:focus-visible .pf-trademark-zoom { opacity: 1; transform: scale(1); }

/* ── Lightbox (ảnh đơn, dùng chung) ──────────────────────────────────────── */
.pf-lightbox {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center; padding: 24px;
}
.pf-lightbox.active { display: flex; }
.pf-lightbox-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .82); cursor: zoom-out; }
.pf-lightbox-figure {
    position: relative; margin: 0; max-width: 92vw; max-height: 90vh; display: flex;
    animation: pfLightboxIn .2s ease;
}
.pf-lightbox-img {
    max-width: 92vw; max-height: 90vh; width: auto; height: auto; object-fit: contain;
    border-radius: 6px; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.pf-lightbox-close {
    position: absolute; top: -14px; right: -14px; width: 40px; height: 40px;
    border: 0; border-radius: 50%; background: #fff; color: #1a2240; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.pf-lightbox-close:hover { background: var(--pf-accent); color: #fff; }
@keyframes pfLightboxIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ── Tìm kiếm ────────────────────────────────────────────────────────────── */
.pf-search { background: #fff; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.06); padding: 16px; margin-bottom: 24px; }
.pf-search .btn-pf { background: var(--pf-primary); color: #fff; border: 0; }
.pf-search .btn-pf:hover { background: var(--pf-accent); }

/* ── Tin tức (Tri thức nông nghiệp) ──────────────────────────────────────── */
.pf-section { padding: 32px; margin-bottom: 32px; }

/* Placeholder ảnh dùng chung (tin + sản phẩm) */
.pf-news-noimg, .pf-product-noimg {
    display: flex; align-items: center; justify-content: center;
    width: 100%; background: var(--pf-gray); color: #b3bcd0;
}

.pf-news-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    overflow: hidden;
    height: 100%;                 /* card đều chiều cao → hết "răng cưa" */
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.pf-news-item:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.12); }

.pf-news-thumb { display: block; overflow: hidden; }
.pf-news-thumb img {
    width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; transition: transform .3s;
}
.pf-news-item:hover .pf-news-thumb img { transform: scale(1.05); }
.pf-news-noimg { aspect-ratio: 16 / 9; font-size: 40px; }

.pf-news-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.pf-news-date { font-size: 12.5px; color: #8893a8; margin-bottom: 6px; }
.pf-news-date i { color: var(--pf-green); margin-right: 4px; }
.pf-news-item h3 {
    font-size: 17px; margin: 0 0 8px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pf-news-item h3 a { color: #1a2240; text-decoration: none; }
.pf-news-item h3 a:hover { color: var(--pf-accent); }
.pf-news-item p {
    color: #555; font-size: 14px; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Sản phẩm ────────────────────────────────────────────────────────────── */
.pf-product {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.pf-product:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.12); }

/* Ảnh sản phẩm: viền đỏ "khu vực bảo vệ" (ý tưởng từ site cũ Tràng An) — tiết chế độ dày */
.pf-product .pf-product-img {
    display: block; position: relative; overflow: hidden;
    border: 4px solid var(--primary-red, #ED4A2A);
    border-radius: 6px;
    background: #fff;
}
.pf-product .pf-product-img img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: transform .3s;
}
.pf-product:hover .pf-product-img img { transform: scale(1.06); }
.pf-product-noimg { aspect-ratio: 1 / 1; font-size: 46px; }

/* Badge góc ảnh: % giảm hoặc HOT */
.pf-badge {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    font-size: 12px; font-weight: 700; color: #fff; line-height: 1.4;
    padding: 3px 9px; border-radius: 6px;
}
.pf-badge-sale { background: var(--pf-accent); }
.pf-badge-hot  { background: var(--pf-green-cta); }

.pf-product .pf-product-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.pf-product h3 {
    font-size: 15.5px; margin: 0 0 8px; line-height: 1.4; min-height: 2.8em;  /* 2 dòng cố định → giá thẳng hàng */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pf-product h3 a { color: #1a2240; text-decoration: none; }
.pf-product h3 a:hover { color: var(--pf-primary); }

.pf-rating { color: #f5a623; font-size: 13px; letter-spacing: 1px; margin-bottom: 10px; }

.pf-product .pf-price-box { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pf-price-group { display: flex; flex-direction: column; line-height: 1.2; }
.pf-product .pf-sale-price { color: var(--pf-accent); font-weight: 700; font-size: 17px; }
.pf-base-price { color: #98a1b3; font-size: 13px; text-decoration: line-through; }
.pf-contact-label { color: #c0000c; font-weight: 700; font-size: 14px; }

.pf-buy-now, .pf-call-us {
    display: inline-flex; align-items: center; gap: 5px;
    border: 0; border-radius: 8px; padding: 9px 14px; min-height: 40px;  /* touch target lớn hơn */
    font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.pf-buy-now { background: var(--pf-primary); color: #fff; }
.pf-buy-now:hover { background: var(--pf-green-cta); color: #fff; }

.pf-call-us { background: var(--pf-green-cta); color: #fff; }
.pf-call-us:hover { background: #14641a; color: #fff; }

/* ── Dịch vụ ─────────────────────────────────────────────────────────────── */
.pf-services .pf-box-title { text-align: center; }
.pf-service { display: block; text-align: center; text-decoration: none; color: #1a2240; }
.pf-service img { max-width: 100%; height: auto; border-radius: 10px; }
.pf-service h3 { font-size: 18px; margin-top: 14px; color: var(--pf-primary); }
.pf-service:hover h3 { color: var(--pf-accent); }

/* ── Giới thiệu (module) ─────────────────────────────────────────────────── */
.pf-intro {
    background: var(--pf-primary);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    padding: 40px 32px;
    margin-bottom: 32px;
}
.pf-intro, .pf-intro * { color: #fff; }
.pf-intro .pf-box-title { color: #fff; text-align: center; }
.pf-intro a { color: #ffd54a; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .pf-section, .pf-intro { padding: 20px; }
    .pf-home .pf-box-title { font-size: 24px; }
}

@media (max-width: 575.98px) {
    .pf-home .pf-section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}
