/* =====================================================================
   Trang chủ V2 — chỉ nạp trên trang dùng template "Trang chủ V2".
   Header / footer giữ nguyên của Flatsome.
   Máy tính: dạng lưới. Điện thoại (≤ 549px): các dải .tgdt-home__scroll vuốt ngang.
   ===================================================================== */

.tgdt-home {
    --h-green-dark: #154a2c;
    --h-red: #d0112b;
    --h-lime: #d5ec3c;
    --h-lime-bg: #e3f0d2;
    --h-ink: #1f2a1f;
    --h-muted: #5f665f;
    --h-band: #f3f4f1;
    --h-ph: #e3e6e1;
    --h-gap: 12px;
    padding-bottom: 32px;
    color: var(--h-ink);
}

.tgdt-home p {
    margin: 0;
}

.tgdt-home img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Chung --------------------------------------------------------- */
.tgdt-home__section {
    padding-top: 32px;
}

.tgdt-home__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 14px;
}

.tgdt-home .tgdt-home__title {
    width: auto; /* CSS riêng của theme ép h2 rộng 100% -> link "Xem tất cả" rớt dòng. */
    margin: 0;
    color: var(--h-ink);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
}

.tgdt-home__head-side {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tgdt-home__more {
    color: var(--h-green-dark);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.tgdt-home__more:hover {
    text-decoration: underline;
}

.tgdt-home__btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 4px;
    background: var(--h-lime);
    color: var(--h-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.tgdt-home__btn--dark {
    background: var(--h-green-dark);
    color: #fff;
}

.tgdt-home__btn--dark:hover {
    color: #fff;
    opacity: .9;
}

/* Ô danh mục: ảnh + tên */
.tgdt-home__tile {
    display: block;
    min-width: 0;
    color: var(--h-ink);
}

.tgdt-home__tile-media {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: var(--h-ph);
}

.tgdt-home__tile-media img {
    transition: transform .3s;
}

.tgdt-home__tile:hover img {
    transform: scale(1.04);
}

.tgdt-home__tile-label {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

/* --- Banner -------------------------------------------------------- */
.tgdt-home__hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--h-gap);
    padding-top: 16px;
}

.tgdt-home__hero--full {
    grid-template-columns: 1fr;
}

.tgdt-home__slider {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border-radius: 6px;
    background: var(--h-ph);
}

.tgdt-home__track {
    display: flex;
    aspect-ratio: 2 / 1;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.tgdt-home__track::-webkit-scrollbar {
    display: none;
}

.tgdt-home__slide {
    display: block;
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.tgdt-home__slide picture {
    display: block;
    height: 100%;
}

.tgdt-home__dots {
    position: absolute;
    right: 0;
    bottom: 10px;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.tgdt-home__dots button {
    width: 8px;
    height: 8px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, .6);
    box-shadow: 0 0 2px rgba(0, 0, 0, .3);
    transition: width .2s;
}

.tgdt-home__dots button.is-active {
    width: 22px;
    background: #fff;
}

.tgdt-home__side {
    display: flex;
    flex-direction: column;
    gap: var(--h-gap);
    min-width: 0;
}

.tgdt-home__side-item {
    display: block;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 6px;
    background: var(--h-ph);
}

/* --- 4 ô cam kết ----------------------------------------------------- */
.tgdt-home__usp {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--h-gap);
    margin: var(--h-gap) 0 0;
    padding: 0;
    list-style: none;
}

.tgdt-home__usp li {
    margin: 0;
    padding: 12px 14px;
    border-radius: 6px;
    background: var(--h-band);
    line-height: 1.4;
}

.tgdt-home__usp a {
    display: block;
    color: inherit;
}

.tgdt-home__usp strong {
    display: block;
    font-size: 13px;
}

.tgdt-home__usp span {
    display: block;
    color: var(--h-muted);
    font-size: 12px;
}

/* --- Ô tròn -------------------------------------------------------- */
.tgdt-home__circles {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.tgdt-home__tile--circle {
    text-align: center;
}

.tgdt-home__tile--circle .tgdt-home__tile-media {
    border-radius: 50%;
}

/* --- Deal sốc ------------------------------------------------------ */
.tgdt-home .tgdt-home__deal .tgdt-home__title {
    color: var(--h-red);
}

.tgdt-home__timer {
    color: var(--h-muted);
    font-size: 12px;
    white-space: nowrap;
}

.tgdt-home__timer b {
    display: inline-block;
    margin-left: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--h-green-dark);
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

/* Thẻ sản phẩm là thẻ chung của site (content-product), chỉ chỉnh khoảng cách. */
.tgdt-home__deal-grid .products {
    margin-bottom: 0;
}

/* --- Deal sốc, KOC: 1 hàng cuộn ngang + thanh kéo ---------------------
   position: relative giữ chữ ẩn (.screen-reader-text trong giá) nằm trong dải,
   không kéo rộng cả trang trên điện thoại. */
.tgdt-home__deal-grid .products {
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.tgdt-home__deal-grid .products::-webkit-scrollbar,
.tgdt-home__koc-row::-webkit-scrollbar {
    display: none;
}

.tgdt-home__deal-grid .products > .col {
    flex: 0 0 25%;
    max-width: 25%;
    scroll-snap-align: start;
}

.tgdt-home__row5.tgdt-home__koc-row {
    position: relative;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 4 * 16px) / 5);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.tgdt-home__koc-row > * {
    scroll-snap-align: start;
}

.tgdt-home__hs .is-dragging {
    scroll-snap-type: none;
    cursor: grabbing;
    user-select: none;
}

.tgdt-home__bar {
    position: relative;
    height: 4px;
    margin-top: 12px;
    border-radius: 4px;
    background: #e3e7e1;
    cursor: pointer;
    touch-action: none;
}

.tgdt-home__bar[hidden] {
    display: none;
}

/* Vùng bấm cao hơn thanh 4px cho dễ nắm. */
.tgdt-home__bar::before {
    content: "";
    position: absolute;
    inset: -8px 0;
}

.tgdt-home__bar > span {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 4px;
    background: var(--h-green-dark);
}

/* --- Đồ tập theo giới ------------------------------------------------ */
.tgdt-home__tabs {
    display: flex;
    gap: 8px;
}

.tgdt-home__tabs button {
    min-height: 0;
    margin: 0;
    padding: 5px 20px;
    border: 1.5px solid var(--h-green-dark);
    border-radius: 999px;
    background: #fff;
    color: var(--h-green-dark);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    text-transform: none;
}

.tgdt-home__tabs button[aria-selected="true"] {
    background: var(--h-green-dark);
    color: #fff;
}

.tgdt-home__panel {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.tgdt-home__panel[hidden] {
    display: none;
}

.tgdt-home__big {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    grid-column: span 2;
    gap: 12px;
    min-height: 100%;
    padding: 24px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--h-lime-bg);
    color: var(--h-ink);
}

.tgdt-home__big--image {
    position: relative;
    background: var(--h-ph);
    color: #fff;
}

.tgdt-home .tgdt-home__big--image img {
    position: absolute;
    inset: 0;
}

/* Lớp tối phía dưới cho chữ trên ảnh dễ đọc. */
.tgdt-home__big--image::after {
    content: "";
    position: absolute;
    inset: 40% 0 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .55));
    pointer-events: none;
}

.tgdt-home__big--image > span {
    position: relative;
    z-index: 1;
}

.tgdt-home__big--image .tgdt-home__big-title {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.tgdt-home__big-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.tgdt-home__big .tgdt-home__btn {
    align-self: flex-start;
}

/* --- Pickleball ---------------------------------------------------- */
.tgdt-home__pb {
    display: grid;
    /* Cột ảnh lớn rộng ~4.8 lần ô nhỏ: ảnh 2:1 cao vừa bằng 2 hàng ô nhỏ (ảnh + tên). */
    grid-template-columns: minmax(0, 24fr) minmax(0, 5fr) minmax(0, 5fr);
    gap: 16px;
}

.tgdt-home__pb--noimg {
    grid-template-columns: repeat(4, 1fr);
}

.tgdt-home__pb-big {
    display: block;
    grid-row: span 2;
    /* Kéo cao bằng đúng 2 hàng ô nhỏ: thẳng cả mép trên lẫn mép dưới. Ảnh 2:1 chỉ xén vài px nếu tên ô nhỏ xuống dòng. */
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
    border-radius: 6px;
    background: var(--h-ph);
}

/* --- Phụ kiện, KOC (5 ô) ----------------------------------------------- */
.tgdt-home__row5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.tgdt-home__koc {
    display: block;
    min-width: 0;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 6px;
    background: var(--h-ph);
}

/* --- Hệ thống cửa hàng ------------------------------------------------ */
.tgdt-home__store {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border-radius: 6px;
    background: var(--h-band);
}

.tgdt-home__store--noimg {
    grid-template-columns: 1fr;
}

.tgdt-home__store-media {
    border-radius: 0;
    background: var(--h-ph);
}

.tgdt-home__store-media .tgdt-home__track {
    aspect-ratio: 4 / 3;
}

.tgdt-home__store-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 32px 40px;
}

.tgdt-home__store-body p {
    max-width: 440px;
    color: var(--h-muted);
    font-size: 14px;
    line-height: 1.6;
}

.tgdt-home__store-body .tgdt-home__btn {
    margin-top: 6px;
}

/* --- Tin tức --------------------------------------------------------- */
.tgdt-home__news {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tgdt-home__post {
    display: block;
    min-width: 0;
    color: var(--h-ink);
}

.tgdt-home__post-media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: var(--h-ph);
}

.tgdt-home__post-title {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tgdt-home__post:hover .tgdt-home__post-title {
    color: var(--h-green-dark);
}

/* --- Máy tính bảng ------------------------------------------------- */
@media (max-width: 849px) {
    .tgdt-home__circles { grid-template-columns: repeat(3, 1fr); }
    .tgdt-home__panel { grid-template-columns: repeat(4, 1fr); }
    .tgdt-home__big { grid-column: 1 / -1; min-height: 160px; }
    .tgdt-home__big--image { aspect-ratio: 2 / 1; min-height: 0; }
    .tgdt-home__pb { grid-template-columns: repeat(4, 1fr); }
    .tgdt-home__pb-big { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 2 / 1; }
    .tgdt-home__store-body { padding: 24px; }
}

/* --- Điện thoại ------------------------------------------------------ */
@media (max-width: 549px) {
    .tgdt-home { --h-gap: 10px; }

    .tgdt-home__section { padding-top: 24px; }
    .tgdt-home .tgdt-home__title { font-size: 18px; }

    /* Banner: chỉ banner chính, ảnh điện thoại 4:3. */
    .tgdt-home__hero { grid-template-columns: 1fr; padding-top: 0; }
    .tgdt-home__hero.container { padding-right: 0; padding-left: 0; }
    .tgdt-home__slider { border-radius: 0; }
    .tgdt-home__track { aspect-ratio: 4 / 3; }
    .tgdt-home__side { display: none; }

    /* Dải vuốt ngang: ô sau lấp ló để khách biết còn nữa. */
    .tgdt-home__scroll {
        display: grid;
        grid-auto-columns: var(--h-item, 42%);
        grid-auto-flow: column;
        grid-template-columns: none;
        gap: 10px;
        margin-right: -15px;
        margin-left: -15px;
        padding: 0 15px 4px;
        overflow-x: auto;
        scroll-padding: 0 15px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .tgdt-home__scroll::-webkit-scrollbar { display: none; }
    .tgdt-home__scroll > * { scroll-snap-align: start; }

    .tgdt-home__usp { --h-item: 44%; }
    .tgdt-home__circles { --h-item: 27%; }
    /* Deal: thẻ chung của site, vuốt ngang thay vì 2 cột xuống dòng. */
    .tgdt-home__deal-grid .products {
        flex-wrap: nowrap;
        margin-right: -15px;
        margin-left: -15px;
        padding: 0 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .tgdt-home__deal-grid .products::-webkit-scrollbar { display: none; }
    .tgdt-home__deal-grid .products > .col {
        flex: 0 0 44%;
        max-width: 44%;
        scroll-snap-align: start;
    }
    .tgdt-home__row5 { --h-item: 36%; }
    .tgdt-home__row5.tgdt-home__koc-row { grid-auto-columns: var(--h-item); }
    .tgdt-home__news { --h-item: 72%; }

    /* Đồng hồ deal: dải tối ngang hết chiều rộng dưới tiêu đề. */
    .tgdt-home__deal .tgdt-home__head { display: grid; grid-template-columns: 1fr auto; }
    .tgdt-home__deal .tgdt-home__head-side { display: contents; }
    .tgdt-home__timer {
        grid-column: 1 / -1;
        grid-row: 2;
        padding: 7px 12px;
        border-radius: 4px;
        background: var(--h-green-dark);
        color: rgba(255, 255, 255, .8);
    }
    .tgdt-home__timer b { padding: 0; background: none; }

    /* Tab xuống dưới tiêu đề. */
    .tgdt-home__gender .tgdt-home__head { flex-direction: column; align-items: flex-start; }
    .tgdt-home__panel { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .tgdt-home__big { min-height: 190px; }
    .tgdt-home__big--image { min-height: 0; } /* min-height + tỉ lệ 2:1 làm ô ảnh rộng tràn màn hình. */
    .tgdt-home__big-title { font-size: 24px; }

    .tgdt-home__pb { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .tgdt-home__store { grid-template-columns: 1fr; }
    .tgdt-home__store-body { padding: 18px 16px 20px; }
}
