/* ==========================================================================
   Phần GIÁ - Thiết kế dạng Box đồng bộ chuẩn giống Box Phân loại
   ========================================================================== */
.woocommerce div.product .summary p.price {
    margin: 16px 0;
    background: #ffffff;
    border: 1px solid var(--border-grey, #ececec);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.woocommerce div.product .summary p.price ins,
.woocommerce div.product .summary p.price > .amount,
.woocommerce div.product .summary p.price > bdi,
.woocommerce div.product .summary p.price ins .amount {
    color: var(--primary-orange, #ff5722) !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    line-height: 1.2;
}

.woocommerce div.product .summary p.price del,
.woocommerce div.product .summary p.price del .amount {
    color: #888888 !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    text-decoration: line-through !important;
    line-height: 1.2;
    opacity: 0.85;
}

/* Badge % Giảm giá & Tag Tiết kiệm tiền */
.hth-discount-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(255, 75, 43, 0.35);
    vertical-align: middle;
    text-decoration: none !important;
}

.hth-save-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    padding: 4px 11px;
    border-radius: 20px;
    vertical-align: middle;
    text-decoration: none !important;
}

.hth-save-tag .hth-save-icon {
    flex-shrink: 0;
    color: #10b981;
}

.hth-save-tag .amount {
    color: #047857 !important;
    font-weight: 700 !important;
    font-size: 13px !important;
}

/* Mặc định ẩn hoàn toàn Badge % và Tag Tiết kiệm ở trang chủ, danh mục, sản phẩm liên quan */
.hth-discount-badge,
.hth-save-tag,
.hth-swatch-price .hth-discount-badge,
.hth-swatch-price .hth-save-tag,
.products .price .hth-discount-badge,
.products .price .hth-save-tag,
ul.products .price .hth-discount-badge,
ul.products .price .hth-save-tag {
    display: none !important;
}

/* CHỈ hiển thị trong Box GIÁ chính của trang chi tiết sản phẩm */
.woocommerce div.product .summary p.price .hth-discount-badge {
    display: inline-flex !important;
}

.woocommerce div.product .summary p.price .hth-save-tag {
    display: inline-flex !important;
}

@media (max-width: 576px) {
    .woocommerce div.product .summary p.price {
        padding: 12px 14px;
        gap: 8px 10px;
    }
    .woocommerce div.product .summary p.price ins,
    .woocommerce div.product .summary p.price ins .amount {
        font-size: 22px !important;
    }
    .woocommerce div.product .summary p.price del,
    .woocommerce div.product .summary p.price del .amount {
        font-size: 13px !important;
    }
    .woocommerce div.product .summary p.price .hth-discount-badge {
        font-size: 12px !important;
        padding: 2px 6px;
    }
    .woocommerce div.product .summary p.price .hth-save-tag {
        font-size: 12px !important;
        padding: 4px 10px;
        flex-basis: 100%;
        width: fit-content;
        max-width: 100%;
    }
}

/* ==========================================================================
   Đồng Hồ Đếm Ngược Giá Sỉ / Flash Sale (Tính Cấp Bách - Urgency)
   ========================================================================== */
.hth-flash-sale-card {
    margin: 14px 0 6px 0;
    background: linear-gradient(135deg, #fff7ed 0%, #fff1f2 100%);
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.05);
}

.hth-flash-sale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hth-flash-sale-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 13px;
    color: #dc2626;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.hth-flash-fire-icon {
    display: inline-block;
    font-size: 16px;
    animation: hthFlameWiggle 1.4s ease-in-out infinite;
}

@keyframes hthFlameWiggle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-8deg) scale(1.1); }
    75% { transform: rotate(8deg) scale(1.1); }
}

.hth-countdown-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hth-timer-box {
    background: #1e293b;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    min-width: 28px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    line-height: 1;
}

.hth-timer-colon {
    color: #dc2626;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
}

.hth-flash-progress-wrap {
    width: 100%;
}

.hth-flash-progress-bar {
    width: 100%;
    height: 9px;
    background: #ffedd5;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 6px;
}

.hth-flash-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #ff7a00 0%, #ff2200 100%);
    position: relative;
    overflow: hidden;
    transition: width 0.4s ease;
}

.hth-flash-progress-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0) 100%);
    animation: hthProgressShimmer 2s infinite linear;
}

@keyframes hthProgressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.hth-flash-progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #4b5563;
}

.hth-flash-progress-label strong {
    color: #dc2626;
    font-weight: 700;
}

.hth-flash-stock-badge {
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

@media (max-width: 480px) {
    .hth-flash-sale-card {
        padding: 10px 12px;
        margin: 12px 0 4px 0;
    }
    .hth-flash-sale-title {
        font-size: 12px;
    }
    .hth-timer-box {
        min-width: 25px;
        height: 24px;
        font-size: 13px !important;
    }
    .hth-flash-progress-label {
        font-size: 11px;
    }
    .hth-flash-stock-badge {
        font-size: 10px;
        padding: 1px 6px;
    }
}

/* Ẩn giá lặp lại bên trong single_variation của WooCommerce */
.single_variation_wrap .woocommerce-variation-price {
    display: none !important;
}

/* ==========================================================================
   Swatch chọn phân loại sản phẩm (kiểu CellphoneS) - thay cho dropdown mặc định
   ========================================================================== */

.hth-variation-swatches {
    margin: 16px 0;
    background: #ffffff;
    border: 1px solid var(--border-grey, #ececec);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.hth-swatch-group {
    margin-bottom: 18px;
}
.hth-swatch-group:last-child {
    margin-bottom: 0;
}

.hth-swatch-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark, #1a1a1a);
    margin-bottom: 10px;
}

.hth-swatch-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.hth-swatch-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #e2e2e2;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.hth-swatch-btn:hover {
    border-color: var(--primary-orange, #d0021b);
}

.hth-swatch-btn.active {
    border-color: var(--primary-orange, #d0021b);
    box-shadow: 0 0 0 1px var(--primary-orange, #d0021b) inset;
}

.hth-swatch-btn.active::after {
    content: "\2713";
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: var(--primary-orange, #d0021b);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
}

.hth-swatch-btn.hth-swatch-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.hth-swatch-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.hth-swatch-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hth-swatch-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hth-swatch-price {
    font-size: 12.5px;
    color: #555;
    margin-top: 2px;
}

.hth-swatch-price .amount {
    color: var(--primary-orange, #d0021b);
    font-weight: 600;
}

.hth-swatch-clear-wrap {
    margin-top: 4px;
}

.hth-swatch-clear-wrap .reset_variations {
    font-size: 13px;
    color: #777;
    text-decoration: underline;
}

/* Ẩn bảng dropdown mặc định của WooCommerce khi đã có swatch thay thế */
form.variations_form table.variations.hth-swatches-enhanced {
    display: none;
}

@media (max-width: 480px) {
    .hth-swatch-options {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* ==========================================================================
   Thanh Tiến Trình Miễn Phí Vận Chuyển (Free Shipping Progress Bar)
   ========================================================================== */
.hth-free-shipping-wrap {
    margin: 0 0 24px 0;
    width: 100%;
}

.hth-fs-card {
    background: linear-gradient(135deg, #fffbeb 0%, #f0fdf4 100%);
    border: 1.5px solid #fde68a;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
    transition: all 0.3s ease;
}

.hth-fs-card.is-free {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #86efac;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
}

.hth-fs-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hth-fs-truck-icon-wrap {
    width: 38px;
    height: 38px;
    background: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.hth-fs-icon {
    font-size: 20px;
    display: inline-block;
    animation: hthTruckBounce 2s ease-in-out infinite;
}

@keyframes hthTruckBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.hth-fs-message {
    font-size: 14.5px;
    line-height: 1.45;
    color: #1e293b;
}

.hth-fs-highlight {
    color: #dc2626;
    font-weight: 800;
}

.hth-fs-highlight .woocommerce-Price-amount {
    color: #dc2626 !important;
}

.hth-fs-congrats {
    color: #047857;
    font-weight: 700;
    font-size: 14.5px;
}

.hth-fs-progress-outer {
    margin-bottom: 6px;
}

.hth-fs-progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.hth-fs-progress-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
    position: relative;
    overflow: hidden;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hth-fs-card.is-free .hth-fs-progress-fill {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.hth-fs-progress-shimmer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0) 100%);
    animation: hthProgressShimmer 2s infinite linear;
}

.hth-fs-progress-milestones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: #64748b;
    margin-top: 5px;
    font-weight: 500;
}

.hth-fs-percent-badge {
    background: #ffffff;
    color: #059669;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-size: 11px;
}

/* Khối Gợi Ý Mua Kèm */
.hth-fs-upsell-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.hth-fs-upsell-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

.hth-fs-zap {
    font-size: 15px;
    color: #f59e0b;
}

.hth-fs-upsell-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.hth-fs-upsell-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}

.hth-fs-upsell-item:hover {
    border-color: #fde68a;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.08);
}

.hth-fs-item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.hth-fs-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hth-fs-item-info {
    flex: 1;
    min-width: 0;
}

.hth-fs-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none !important;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.hth-fs-item-name:hover {
    color: #ea580c;
}

.hth-fs-item-price {
    font-size: 12px;
    font-weight: 700;
    color: #dc2626;
    margin-top: 2px;
}

.hth-fs-item-price .woocommerce-Price-amount {
    color: #dc2626 !important;
}

.hth-fs-add-btn {
    background: linear-gradient(135deg, #ff7a00 0%, #ff5722 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(255, 87, 34, 0.2);
}

.hth-fs-add-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 8px rgba(255, 87, 34, 0.3);
}

.hth-fs-add-btn.loading {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.hth-fs-add-btn.added {
    background: #10b981;
    cursor: default;
    transform: none;
}

@media (max-width: 767px) {
    .hth-fs-card {
        padding: 12px 14px;
        border-radius: 12px;
    }
    .hth-fs-message {
        font-size: 13px;
    }
    .hth-fs-upsell-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .hth-fs-upsell-item {
        flex: 0 0 245px;
        scroll-snap-align: start;
    }
}

/* ==========================================================================
   Huy Hiệu Sao Vàng Đánh Giá Sản Phẩm (Google Star Rating Badge)
   ========================================================================== */
.hth-product-rating-badge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 12px 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

.hth-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 1.5px;
    color: #f59e0b;
    font-size: 15px;
    line-height: 1;
}

.hth-rating-score {
    color: #b45309;
    font-weight: 800;
    font-size: 13.5px;
    margin-left: 4px;
}

.hth-rating-separator {
    color: #cbd5e1;
    font-size: 12px;
}

.hth-rating-count {
    color: #4b5563;
    text-decoration: none !important;
}

.hth-rating-count:hover {
    color: #ea580c;
}

.hth-rating-count strong,
.hth-rating-sold strong {
    color: #1e293b;
    font-weight: 700;
}

.hth-verified-badge-mini {
    background: #ecfdf5;
    color: #059669;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #d1fae5;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .hth-product-rating-badge {
        font-size: 12px;
        gap: 6px;
        margin: 4px 0 10px 0;
    }
    .hth-rating-stars {
        font-size: 13.5px;
    }
    .hth-rating-score {
        font-size: 12.5px;
    }
}


