/* =====================================================================
   Flash Sale V2 — chỉ nạp trên trang dùng template "Flash Sale V2".
   Thẻ sản phẩm (.product-small) giữ nguyên style của Flatsome.
   ===================================================================== */

.tgdt-fs {
    --fs-red: #ed1c24;
    --fs-green-dark: #1d5a2c;
    --fs-green: #2e8b3e;
    --fs-nu: #c2185b;
    --fs-nu-2: #e2477f;
    --fs-nam: #1f7a37;
    --fs-nam-2: #3a9b50;
    --fs-pk: #a8231b;
    --fs-pk-2: #d0392f;
    --fs-ink: #1f2a1f;
    --fs-line: #e6e6e6;
}

/* --- Banner -------------------------------------------------------- */
.tgdt-fs__banner-img {
    display: block;
    width: 100%;
    height: auto;
}

/* --- Sắp hết thời gian + đồng hồ ---------------------------------- */
.tgdt-fs__hurry {
    padding-top: 28px;
    padding-bottom: 8px;
    text-align: center;
}

.tgdt-fs__hurry-title {
    margin: 0 0 16px;
    color: var(--fs-red);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.tgdt-fs__timer {
    display: flex;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
}

.tgdt-fs__timer span {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 4px 12px;
    border-radius: 8px;
    background: #1f1f1f;
    color: #fff;
    text-align: center;
}

.tgdt-fs__timer b {
    display: block;
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tgdt-fs__timer small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    opacity: .75;
    text-transform: uppercase;
}

/* --- Chương trình thời vụ (Black Friday…) ------------------------- */
.tgdt-fs__camp {
    --camp-bg: #141414;
    --camp-card: #262626;
    --camp-yellow: #ffc533;
    margin: 28px 0 8px;
    padding: 20px 20px 22px;
    border-radius: 14px;
    background: var(--camp-bg);
    color: #fff;
}

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

.tgdt-fs__camp-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.tgdt-fs__camp-date {
    margin: 0 0 4px;
    color: var(--camp-yellow);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}

.tgdt-fs__camp-title {
    margin: 0;
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
}

.tgdt-fs__camp-title span {
    color: var(--camp-yellow);
}

.tgdt-fs__camp-off {
    flex: none;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

.tgdt-fs__camp-off small {
    margin-right: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.tgdt-fs__camp-off strong {
    color: var(--camp-yellow);
    font-size: 40px;
    font-weight: 800;
}

.tgdt-fs__camp-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.tgdt-fs__camp-item {
    display: flex;
    flex-direction: column;
    color: #fff;
    text-align: center;
}

.tgdt-fs__camp-item:hover {
    color: #fff;
}

.tgdt-fs__camp-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5; /* = ảnh sản phẩm của site */
    overflow: hidden;
    border-radius: 8px;
    background: var(--camp-card);
}

.tgdt-fs__camp-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

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

.tgdt-fs__camp-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #d0112b;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.tgdt-fs__camp-name {
    display: -webkit-box;
    margin: 10px 4px 4px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tgdt-fs__camp-price {
    margin-top: auto;
    color: var(--camp-yellow);
    font-size: 15px;
    font-weight: 700;
}

.tgdt-fs__camp-price del {
    margin-right: 4px;
    color: rgba(255, 255, 255, .55);
    font-size: 13px;
    font-weight: 400;
}

.tgdt-fs__camp-price ins {
    color: var(--camp-yellow);
    text-decoration: none;
}

.tgdt-fs__camp-price .amount {
    color: inherit;
}

/* --- Thanh chọn nhóm / mục ---------------------------------------- */
.tgdt-fs__nav {
    margin: 20px 0 8px;
}

.tgdt-fs__nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tgdt-fs__chip {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--fs-line);
    border-radius: 999px;
    background: #fff;
    color: var(--fs-ink);
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
}

.tgdt-fs__chip:hover {
    border-color: currentColor;
    color: var(--fs-red);
}

.tgdt-fs__chip--group {
    margin-left: 10px;
    border: 0;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
}

.tgdt-fs__chip--group:first-child {
    margin-left: 0;
}

.tgdt-fs__chip--group:hover {
    color: #fff;
    opacity: .9;
}

.tgdt-fs__chip--group.tgdt-fs--nu { background: var(--fs-nu); }
.tgdt-fs__chip--group.tgdt-fs--nam { background: var(--fs-nam); }
.tgdt-fs__chip--group.tgdt-fs--pk { background: var(--fs-pk); }

/* --- Nhóm + mục ----------------------------------------------------- */
.tgdt-fs__group,
.tgdt-fs__section {
    scroll-margin-top: 90px;
}

.tgdt-fs__group {
    padding: 24px 0 8px;
}

.tgdt-fs__title {
    margin: 0 0 14px;
    color: var(--fs-green-dark);
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
}

.tgdt-fs__section {
    margin-bottom: 28px;
}

.tgdt-fs__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-bottom: 16px;
    padding: 10px 16px;
    border-radius: 6px;
    color: #fff;
}

.tgdt-fs--nu .tgdt-fs__bar { background: linear-gradient(90deg, var(--fs-nu), var(--fs-nu-2)); }
.tgdt-fs--nam .tgdt-fs__bar { background: linear-gradient(90deg, var(--fs-nam), var(--fs-nam-2)); }
.tgdt-fs--pk .tgdt-fs__bar { background: linear-gradient(90deg, var(--fs-pk), var(--fs-pk-2)); }

.tgdt-fs__kicker {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tgdt-fs__big {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.tgdt-fs__note {
    font-size: 13px;
    opacity: .9;
}

/* "Xem thêm": chỉ dùng CSS (checkbox ẩn + label) để bấm được ngay cả khi
   JavaScript còn đang bị hoãn tới lần tương tác đầu tiên.
   Số 8 khớp với TGDT_FS_VISIBLE trong includes/sections.php. */
/* display:none (không phải ẩn bằng opacity): label vẫn bật/tắt được checkbox,
   nhưng trình duyệt không focus vào nó -> không bị kéo ngược lên đầu mục.
   !important vì CSS của Flatsome gán display cho input, đè thuộc tính hidden. */
.tgdt-fs .tgdt-fs__more-toggle {
    display: none !important;
}

.tgdt-fs__more-toggle:not(:checked) ~ .products > .product-small:nth-child(n+9) {
    display: none;
}

.tgdt-fs__more-toggle:checked ~ .tgdt-fs__more {
    display: none;
}

.tgdt-fs__more {
    display: block;
    width: max-content;
    margin: 4px auto 0;
    padding: 9px 26px;
    border: 1px solid var(--fs-red);
    border-radius: 6px;
    color: var(--fs-red);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.tgdt-fs__more:hover {
    background: var(--fs-red);
    color: #fff;
}

/* --- Khối tư vấn cuối trang --------------------------------------- */
.tgdt-fs__cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 12px 0 40px;
    padding: 20px 24px;
    border-radius: 10px;
    background: var(--fs-green-dark);
    color: #fff;
}

.tgdt-fs__cta p {
    margin: 0;
}

.tgdt-fs__cta-title {
    font-size: 20px;
    font-weight: 700;
}

.tgdt-fs__cta-text {
    margin-top: 4px !important;
    font-size: 14px;
    opacity: .85;
}

.tgdt-fs__cta-btn {
    flex: none;
    padding: 10px 22px;
    border-radius: 6px;
    background: #43a047;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.tgdt-fs__cta-btn:hover {
    background: #388e3c;
    color: #fff;
}

/* --- Mobile -------------------------------------------------------- */
@media (max-width: 549px) {
    .tgdt-fs__camp { margin-top: 20px; padding: 16px 12px 18px; border-radius: 10px; }
    .tgdt-fs__camp-head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 12px; }
    .tgdt-fs__camp-title { font-size: 24px; }
    .tgdt-fs__camp-off strong { font-size: 28px; }
    .tgdt-fs__camp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tgdt-fs__camp-badge { width: 38px; height: 38px; font-size: 12px; }
    .tgdt-fs__camp-name { font-size: 13px; }
    .tgdt-fs__camp-price { font-size: 14px; }
    .tgdt-fs__camp-price del { display: block; margin: 0; }

    .tgdt-fs__hurry-title { font-size: 22px; }

    .tgdt-fs__timer { gap: 6px; }
    .tgdt-fs__timer span { padding: 10px 2px 8px; }
    .tgdt-fs__timer b { font-size: 26px; }
    .tgdt-fs__timer small { margin-top: 5px; font-size: 9px; letter-spacing: .04em; }

    /* Thanh chọn cuộn ngang thay vì xuống nhiều dòng */
    .tgdt-fs__nav-inner {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tgdt-fs__nav-inner::-webkit-scrollbar { display: none; }

    .tgdt-fs__title { font-size: 20px; }
    .tgdt-fs__big { font-size: 22px; }

    .tgdt-fs__cta {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .tgdt-fs__cta-title { font-size: 17px; }
}
