/* YouTube grid — section Video hướng dẫn (luôn load, kể cả theme platform) */
.h-video .revidapi-youtube-grid,
.revidapi-youtube-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 !important;
}

.revidapi-youtube-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.h-video .revidapi-yt-card,
.revidapi-yt-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    color: #111 !important;
    text-decoration: none !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
}

.revidapi-yt-thumb {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #e8f5ec;
    width: 100% !important;
}

.revidapi-yt-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    max-width: 100% !important;
}

.revidapi-yt-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0.9;
    pointer-events: none;
}

.revidapi-yt-title {
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Flatsome row/col không được ép flex dọc lên grid video */
.h-video .col-inner,
.h-video [class*="col"] .revidapi-youtube-grid {
    max-width: 100% !important;
}

@media (max-width: 849px) {
    .h-video .revidapi-youtube-grid,
    .revidapi-youtube-grid,
    .revidapi-youtube-grid.cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 549px) {
    .h-video .revidapi-youtube-grid,
    .revidapi-youtube-grid,
    .revidapi-youtube-grid.cols-3 {
        grid-template-columns: 1fr !important;
    }
}

/* n8n Hosting — nút Mua ngay */
.revidapi-n8n-hosting-buy {
    display: block !important;
    width: 100%;
    margin-top: 12px;
}

.revidapi-n8n-hosting-product .revidapi-n8n-hosting-buy .revidapi-buy-now,
.revidapi-n8n-hosting-buy .revidapi-buy-now {
    display: block !important;
    width: 100% !important;
    text-align: center;
    padding: 14px 24px !important;
    min-height: 50px;
    border-radius: 8px !important;
    background: #15803d !important;
    border: 2px solid #15803d !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.3 !important;
    box-shadow: none !important;
}

.revidapi-n8n-hosting-product .revidapi-n8n-hosting-buy .revidapi-buy-now:hover,
.revidapi-n8n-hosting-buy .revidapi-buy-now:hover {
    background: #166534 !important;
    border-color: #166534 !important;
    color: #fff !important;
}

.revidapi-n8n-hosting-product .revidapi-n8n-hosting-buy-hint {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

/* Product loop — giảm cỡ chữ thẻ SP */
.h-slider-pd .product-small p.name.product-title a,
.product-small p.name.product-title a {
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
}

.h-slider-pd .product-small p.name.product-title,
.product-small p.name.product-title {
    min-height: calc(13px * 1.4 * 2) !important;
}

.h-slider-pd .fc-loop-price-current,
.h-slider-pd .fc-loop-price-current .amount,
.product-small .fc-loop-price-current,
.product-small .fc-loop-price-current .amount {
    font-size: 15px !important;
    font-weight: 700 !important;
}

.h-slider-pd .fc-loop-price-old,
.h-slider-pd .fc-loop-price-old .amount,
.product-small del span.amount {
    font-size: 12px !important;
}

.h-slider-pd .fc-product-badge,
.product-small .fc-product-badge {
    font-size: 9px !important;
    padding: 2px 7px !important;
    margin-bottom: 6px !important;
}

.h-slider-pd .fc-product-meta,
.product-small .fc-product-meta {
    font-size: 11px !important;
}

.h-slider-pd .fc-promo-slider,
.product-small .fc-promo-slider {
    font-size: 11px !important;
    height: 16px !important;
}

/* Workflow kinh doanh — Mua ngay */
.revidapi-n8n-workflow-paid .revidapi-n8n-workflow-buy .revidapi-buy-now,
.revidapi-n8n-workflow-buy .revidapi-buy-now {
    display: block !important;
    width: 100% !important;
    text-align: center;
    padding: 14px 24px !important;
    min-height: 50px;
    border-radius: 8px !important;
    background: #15803d !important;
    border: 2px solid #15803d !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.3 !important;
    box-shadow: none !important;
}

.revidapi-n8n-workflow-paid .revidapi-n8n-workflow-buy .revidapi-buy-now:hover,
.revidapi-n8n-workflow-buy .revidapi-buy-now:hover {
    background: #166534 !important;
    border-color: #166534 !important;
    color: #fff !important;
}

.revidapi-n8n-workflow-buy-hint {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

/* Workflow miễn phí — Tải xuống */
.revidapi-n8n-workflow-free form.cart,
.revidapi-n8n-workflow-free .quantity,
.revidapi-n8n-workflow-free .single_add_to_cart_button,
.revidapi-n8n-workflow-free .dc-buy-actions {
    display: none !important;
}

.revidapi-workflow-free-cta .revidapi-download-btn {
    display: block !important;
    width: 100% !important;
    text-align: center;
    padding: 14px 24px !important;
    min-height: 50px;
    border-radius: 8px !important;
    background: #15803d !important;
    border: 2px solid #15803d !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin-top: 12px;
}

.revidapi-workflow-free-cta .revidapi-download-btn:hover {
    background: #166534 !important;
    border-color: #166534 !important;
    color: #fff !important;
}

.revidapi-workflow-guide-link {
    margin: 12px 0 0;
    font-size: 13px;
}

.revidapi-workflow-guide-link a {
    color: #15803d;
    font-weight: 600;
    text-decoration: underline;
}

/* Blog thủ thuật — slider + khoảng cách footer */
.home .h-blog.section {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.home .h-blog .section-content {
    padding-bottom: 8px !important;
}

/* Mũi tên blog — xem theme.css body.home .h-blog .slider.row-slider */

.home .h-blog .post-category,
.home .h-blog .badge.post-category,
.home .h-blog .is-xxsmall.uppercase {
    display: none !important;
}

.home .h-blog .box-blog-post .from_the_blog_excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home #footer .footer-sec .gap,
.home .footer-sec > .section-content > .gap {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
}

.home #footer .footer-sec {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.footer-sec .footer-tagline,
.footer-sec .footer-eco-note {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #6b7280;
    max-width: 280px;
}

.footer-sec .footer-eco-note {
    margin-top: 14px;
    max-width: none;
}

/* Mua ngay → 2 nút xanh (pattern nailgiare dc-buy-actions) */
.revidapi-buy-actions.dc-buy-actions,
.dc-buy-actions.revidapi-buy-actions {
    display: none;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.revidapi-buy-actions.dc-buy-actions.is-visible,
.dc-buy-actions.revidapi-buy-actions.is-visible {
    display: flex;
}

.revidapi-workflow-cart .revidapi-workflow-buy-now,
.revidapi-n8n-workflow-paid .revidapi-workflow-buy-now {
    width: 100%;
    text-align: center;
    padding: 14px 24px !important;
    min-height: 50px;
    border-radius: 8px !important;
    background: #15803d !important;
    border: 2px solid #15803d !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.revidapi-workflow-cart .revidapi-workflow-buy-now:hover {
    background: #166534 !important;
    border-color: #166534 !important;
    color: #fff !important;
}

.revidapi-buy-actions .button {
    margin: 0;
    flex: 1 1 0;
    min-width: 150px;
    text-align: center;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.02em;
    padding: 12px 16px;
}

.revidapi-buy-actions .dc-buy-more {
    background: #fff;
    color: #15803d;
    border: 2px solid #15803d;
}

.revidapi-buy-actions .dc-buy-more:hover {
    background: #f0fdf4;
    color: #166534;
}

.revidapi-buy-actions .dc-buy-now {
    background: #15803d;
    color: #fff;
    border: 2px solid #15803d;
}

.revidapi-buy-actions .dc-buy-now:hover {
    background: #166534;
    border-color: #166534;
    color: #fff;
}

/* Checkout — số lượng +/- (pattern nailgiare .pd-sum-ct .quantity) */
.revidapi-checkout-qty-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.woocommerce-checkout-review-order-table .revidapi-checkout-qty.quantity {
    display: inline-flex;
    justify-content: space-between;
    border: 1px solid #ced4da;
    border-radius: 4px;
    max-width: 120px;
    margin: 0;
}

.woocommerce-checkout-review-order-table .revidapi-checkout-qty .button {
    box-shadow: none !important;
    border: none !important;
    background: none !important;
    padding: 0 12px;
    min-height: 36px;
}

.woocommerce-checkout-review-order-table .revidapi-checkout-qty input.qty {
    box-shadow: none !important;
    border: none !important;
    background: none !important;
    width: 2.5em;
    text-align: center;
    padding: 6px 0;
    margin: 0;
}

.revidapi-checkout-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}

.revidapi-checkout-remove:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.woocommerce-checkout-review-order-table td.product-name {
    vertical-align: top;
}
