:root {
    --ffwoo-primary: var(--color-primary, #055cce); 
    /* cần mã màu blue của facebook */
    --ffwoo-primary-h: var(--color-primary-dark, #1877F2);
    --ffwoo-border: #ddd;
    --ffwoo-bg: #f7f7f7;
    --ffwoo-white: #fff;
    --ffwoo-text: #303030;
    --ffwoo-muted: #8b8b8b;
    --ffwoo-accent: #d9544f;
    --ffwoo-radius: 4px;
    --ffwoo-shadow: 0 14px 28px rgba(0, 0, 0, .09);
}

.woocommerce-page #ffwoo-wrapper ~ ul.products,
.woocommerce-page #ffwoo-wrapper ~ .woocommerce-pagination,
body.ffwoo-active ul.products:not(.ffwoo-products),
body.ffwoo-active .woocommerce-pagination {
    display: none !important;
}

#ffwoo-wrapper {
    display: flex;
    gap: 28px;
    width: 100%;
    align-items: flex-start;
}

#ffwoo-wrapper.ffwoo-no-filters {
    display: block;
}

#ffwoo-wrapper.ffwoo-no-filters #ffwoo-sidebar {
    display: none;
}

.ffwoo-layout-top {
    flex-direction: column;
    gap: 18px;
}

#ffwoo-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.ffwoo-layout-top #ffwoo-sidebar {
    width: 100%;
}

#ffwoo-main {
    flex: 1;
    min-width: 0;
}

.ffwoo-filter-shell {
    width: 100%;
}

.ffwoo-filter-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ffwoo-filter-group.ffwoo-group-disabled{
    pointer-events: none;
}
.ffwoo-layout-top .ffwoo-filter-groups {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}

.ffwoo-filter-group {
    position: relative;
    width: 100%;
}

.ffwoo-layout-top .ffwoo-filter-group {
    width: auto;
    min-width: 150px;
    flex: 1 1 150px;
    max-width: 150px;
}

.ffwoo-filter-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--ffwoo-border);
    border-radius: var(--ffwoo-radius);
    background: var(--ffwoo-white);
    color: var(--ffwoo-text);
    padding: 9px 12px;
    min-height: 38px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.ffwoo-filter-group.is-open .ffwoo-filter-trigger,
.ffwoo-filter-trigger:hover {
    border-color: var(--ffwoo-primary);
    box-shadow: 0 0 0 1px rgba(51, 72, 98, .12);
}

.ffwoo-chevron {
    color: var(--ffwoo-muted);
    font-size: 11px;
    transition: transform .18s ease;
}

.ffwoo-filter-group.is-open .ffwoo-chevron {
    transform: rotate(180deg);
}

.ffwoo-filter-panel {
    display: none;
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    width: min(450px, 92vw);
    max-height: 360px;
    overflow: auto;
    padding: 14px;
    background: var(--ffwoo-white);
    border: 1px solid var(--ffwoo-border);
    border-radius: 5px;
    box-shadow: var(--ffwoo-shadow);
    z-index: 30;
}

.ffwoo-layout-sidebar .ffwoo-filter-panel {
    width: 100%;
}

.ffwoo-filter-group.is-open .ffwoo-filter-panel {
    display: block;
}

.ffwoo-price-options,
.ffwoo-term-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ffwoo-price-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ffwoo-term-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ffwoo-empty-options {
    font-size: 12px;
    color: var(--ffwoo-muted);
    line-height: 1.5;
    padding: 4px 2px;
}

.ffwoo-price-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px 16px 10px;
    color: var(--ffwoo-text);
    font-size: 13px;
    cursor: pointer;
    position: relative;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    min-height: 40px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.ffwoo-group-disabled.is-open{
    
}
.ffwoo-price-opt:hover {
    border-color: var(--ffwoo-primary);
    background: #0159ff24;
    box-shadow: 0 0 0 1px rgba(51, 72, 98, .12) inset;
}

.ffwoo-price-opt.active {
    border-color: var(--ffwoo-primary);
    background: var(--ffwoo-primary);
    box-shadow: 0 0 0 1px rgba(51, 72, 98, .12) inset;
    color: var(--ffwoo-white);
}
.ffwoo-price-opt.active .ffwoo-price-count {
    color: var(--ffwoo-white);
}
.ffwoo-hidden-option {
    display: none !important;
}

.ffwoo-option-fade {
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}

.ffwoo-filter-group {
    transition: opacity .25s ease, filter .25s ease;
}

#ffwoo-wrapper.ffwoo-focus-open {
    position: relative;
}

#ffwoo-wrapper.ffwoo-focus-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 15;
    pointer-events: none;
}

#ffwoo-wrapper.ffwoo-focus-open .ffwoo-filter-group {
    position: relative;
    z-index: 16;
}

#ffwoo-wrapper.ffwoo-focus-open .ffwoo-filter-group.ffwoo-dimmed {
    opacity: .35;
    filter: grayscale(.25);
    pointer-events: none;
}

#ffwoo-wrapper.ffwoo-focus-open .ffwoo-filter-group.is-open {
    z-index: 35;
}

.ffwoo-filter-group.ffwoo-group-disabled .ffwoo-filter-trigger {
    opacity: .5;
    filter: grayscale(.1);
}

.ffwoo-filter-group.ffwoo-group-no-data {
    display: none !important;
}

.ffwoo-price-opt-dot {
    width: 15px;
    height: 15px;
    min-width: 15px;
    border: 1.5px solid #b9b9b9;
    border-radius: 50%;
    display: inline-block;
    background: #fff;
    position: absolute;
    top: 5px;
    right: 5px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.ffwoo-price-opt:hover .ffwoo-price-opt-dot {
    border-color: #9ca8b7;
}

.ffwoo-price-opt.active .ffwoo-price-opt-dot::after {
    content: '';
    width: 5px;
    height: 3px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg) translateY(-.5px);
    position: absolute;
    top: 4px;
    left: 4px;
}

.ffwoo-price-count,
.ffwoo-attr-count {
    font-size: 11px;
    color: var(--ffwoo-muted);
}

.ffwoo-price-count,
.ffwoo-attr-count {
    position: absolute;
    bottom: 5px;
    right: 5px;
    line-height: 1;
}

.ffwoo-price-opt.active .ffwoo-price-opt-dot {
    background: #ef4455;
    border-color: #ef4455;
}

.ffwoo-price-opt-label {
    display: inline-block;
    padding-right: 26px;
}

 
.ffwoo-check-label.ffwoo-brand-hide-text{
    display: block;
    text-align: center;
}
.ffwoo-check-label.ffwoo-brand-hide-text img{
    width: 50px;
    height: 30px;
    border-radius: 0;
    object-fit: contain;
    border: 0;
    background: transparent;
}
.ffwoo-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px 16px 10px;
    color: var(--ffwoo-text);
    font-size: 13px;
    cursor: pointer;
    position: relative;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    min-height: 40px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.ffwoo-check-label:hover {
    border-color: #bfc8d4;
}

.ffwoo-check-label:has(.ffwoo-chk:checked) ,
.ffwoo-check-label:hover{
    border-color: var(--ffwoo-primary);
    background: #0159ff24;
    box-shadow: 0 0 0 1px rgba(51, 72, 98, .12) inset;
}

.ffwoo-brand-logo {
    width: 30px;
    height: auto;
    object-fit: cover;
}

.ffwoo-brand-logo.hidden-txt {
    margin-right: 0;
}

.ffwoo-option-text {
    display: inline-block;
}

.ffwoo-brand-hide-text .ffwoo-option-text {
    display: none;
}

.ffwoo-check-label input[type="checkbox"].ffwoo-chk {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    pointer-events: none !important;
}

.ffwoo-chk-box {
    width: 15px;
    height: 15px;
    min-width: 15px;
    border: 1.5px solid #b9b9b9;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    position: absolute;
    top: 5px;
    right: 5px;
}

.ffwoo-chk:checked + .ffwoo-chk-box {
    background: #ef4455;
    border-color: #ef4455;
    box-shadow: none;
}

.ffwoo-chk:checked + .ffwoo-chk-box::after {
    content: '';
    width: 5px;
    height: 3px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg) translateY(-.5px);
}

.ffwoo-check-label:hover .ffwoo-chk-box {
    border-color: #9ca8b7;
}

.ffwoo-chk:focus-visible + .ffwoo-chk-box {
    box-shadow: 0 0 0 3px rgba(51, 72, 98, .18);
}

#ffwoo-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ffwoo-border);
}

#ffwoo-result-count {
    color: var(--ffwoo-muted);
    font-size: 13px;
    display: block !important;
}

#ffwoo-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.ffwoo-active-tags-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ffwoo-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding:0 5px;
    border-radius: 5px;
    background: var(--ffwoo-primary);
    color: #fff;
    font-size: 12px;
}

.ffwoo-tag-x {
    border: none;
    background: none;
    padding: 0;
    color: rgba(255, 255, 255, .8);
    cursor: pointer;
    line-height: 1;
    margin: 0;
}

.ffwoo-clear-all-tags {
    border: 1px solid var(--ffwoo-accent);
    background: #fff;
    color: var(--ffwoo-accent);
    padding: 4px 8px;
    border-radius: 5px;
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
}

.ffwoo-clear-all-tags:hover {
    background: #fff4f4;
}

.ffwoo-sort-wrap {
    margin-left: auto;
}

#ffwoo-sort {
    min-width: 165px;
    padding: 5px 30px 5px 10px;
    border: 1px solid var(--ffwoo-border);
    border-radius: var(--ffwoo-radius);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") right 10px center / 8px no-repeat;
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

#ffwoo-grid {
    width: 100%;
    min-height: 420px;
}

.ffwoo-fade-in {
    animation: ffwoo-fade-in .26s ease both;
}

#ffwoo-grid ul.products {
    display: grid;
    gap: 5px;
    margin: 0 -10px;
    padding: 0;
    list-style: none;
}

#ffwoo-grid ul.products.columns-2 { grid-template-columns: repeat(2, 1fr); }
#ffwoo-grid ul.products.columns-3 { grid-template-columns: repeat(3, 1fr); }
#ffwoo-grid ul.products.columns-4 { grid-template-columns: repeat(4, 1fr); }
#ffwoo-grid ul.products.columns-5 { grid-template-columns: repeat(5, 1fr); }
#ffwoo-grid ul.products.columns-6 { grid-template-columns: repeat(6, 1fr); }

#ffwoo-grid li.product {
    position: relative;
    padding: 10px;
    box-sizing: border-box;    
    box-sizing: border-box;
    border: 1px solid var(--ffwoo-border);
    border-radius: var(--ffwoo-radius);
}

#ffwoo-grid .product-image-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    background: var(--ffwoo-bg);
}

#ffwoo-grid .product-image-wrapper img {
    width: 100%;
    display: block;
    transition: transform .3s ease;
}

#ffwoo-grid li.product:hover .product-image-wrapper img {
    transform: scale(1.04);
}

#ffwoo-grid .onsale {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    background: var(--ffwoo-accent);
    color: #fff;
    padding: 2px 7px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
}

#ffwoo-grid .ffwoo-discount-badge {
    min-width: 44px;
    min-height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    background: #e53935;
}

.ffwoo-oos-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(0, 0, 0, .58);
    color: #fff;
    padding: 2px 7px;
    border-radius: 2px;
    font-size: 11px;
}

#ffwoo-grid .product-details {
    padding: 10px 0 4px;
    text-align: center;
}

#ffwoo-grid .woocommerce-loop-product__title {
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 4px;
    font-weight: 400;
    color: var(--ffwoo-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#ffwoo-grid .price {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ffwoo-primary);
}

#ffwoo-grid .price del {
    color: var(--ffwoo-muted);
    font-size: 12px;
    font-weight: 400;
    margin-right: 4px;
}

#ffwoo-grid .price ins {
    text-decoration: none;
}

#ffwoo-grid .star-rating {
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 12px;
    width: 5.3em;
    margin-bottom: 5px;
}

#ffwoo-grid .star-rating::before,
#ffwoo-grid .star-rating span::before {
    content: '\2605\2605\2605\2605\2605';
    position: absolute;
    left: 0;
    top: 0;
    letter-spacing: .1em;
}

#ffwoo-grid .star-rating::before {
    color: #ddd;
}

#ffwoo-grid .star-rating span {
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    padding-top: 1.5em;
}

#ffwoo-grid .star-rating span::before {
    color: #f5a623;
}

#ffwoo-grid .button {
    display: block;
    width: 100%;
    padding: 3px 5px;
    background: var(--ffwoo-primary);
    color: #fff !important;
    border-radius: var(--ffwoo-radius);
    font-size: 12px;
    text-transform: uppercase;
    text-align: center;
    margin: 0;
}

#ffwoo-grid .button:hover {
    background: var(--ffwoo-primary);
}

#ffwoo-grid .button.disabled {
    background: #bbb;
    cursor: default;
}

#ffwoo-pagination {
    margin-top: 28px;
    text-align: center;
}

#ffwoo-pagination .woocommerce-pagination {
    display: inline-block !important;
}

#ffwoo-pagination ul.page-numbers {
    display: inline-flex;
    gap: 3px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

#ffwoo-pagination a.page-numbers,
#ffwoo-pagination span.page-numbers {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--ffwoo-border);
    border-radius: var(--ffwoo-radius);
    background: #fff;
    color: var(--ffwoo-text);
}

#ffwoo-pagination span.page-numbers.current {
    background: var(--ffwoo-primary);
    border-color: var(--ffwoo-primary);
    color: #fff;
    font-weight: 700;
}

#ffwoo-pagination span.page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

.ffwoo-loading,
.ffwoo-no-products {
    padding: 50px 20px;
    text-align: center;
    color: var(--ffwoo-muted);
}

#ffwoo-wrapper.ffwoo-is-loading #ffwoo-toolbar,
#ffwoo-wrapper.ffwoo-is-loading #ffwoo-filters-container,
#ffwoo-wrapper.ffwoo-is-loading #ffwoo-grid,
#ffwoo-wrapper.ffwoo-ready #ffwoo-toolbar,
#ffwoo-wrapper.ffwoo-ready #ffwoo-filters-container,
#ffwoo-wrapper.ffwoo-ready #ffwoo-grid {
    opacity: 1;
    transition: opacity .18s ease;
}

.ffwoo-spinner {
    width: 30px;
    height: 30px;
    margin: 0 auto 12px;
    border: 3px solid var(--ffwoo-border);
    border-top-color: var(--ffwoo-primary);
    border-radius: 50%;
    animation: ffwoo-spin .65s linear infinite;
}

.ffwoo-error {
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: var(--ffwoo-radius);
    padding: 14px 16px;
    color: #721c24;
    font-size: 13px;
}

.ffwoo-skeleton { padding: 4px 0; }
.ffwoo-sk-block {
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: ffwoo-shimmer 1.3s infinite;
    border-radius: 2px;
    height: 12px;
    margin-bottom: 8px;
}
.ffwoo-sk-block.h40 { height: 38px; }
.ffwoo-sk-block.w80 { width: 80%; }
.ffwoo-sk-block.w90 { width: 90%; }
.ffwoo-sk-block.w100 { width: 100%; }

@keyframes ffwoo-spin { to { transform: rotate(360deg); } }
@keyframes ffwoo-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes ffwoo-fade-in {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
    #ffwoo-wrapper,
    .ffwoo-layout-sidebar {
        flex-direction: column;
    }
    #ffwoo-sidebar {
        width: 100%;
    }
    .ffwoo-layout-top .ffwoo-filter-group,
    .ffwoo-layout-sidebar .ffwoo-filter-group {
        width: calc(50% - 6px);
        max-width: none;
    }
    #ffwoo-grid ul.products.columns-4,
    #ffwoo-grid ul.products.columns-5,
    #ffwoo-grid ul.products.columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 680px) {
    .ffwoo-filter-groups {
        flex-direction: column;
    }
    .ffwoo-layout-top .ffwoo-filter-group,
    .ffwoo-layout-sidebar .ffwoo-filter-group {
        width: 100%;
    }
    .ffwoo-filter-panel {
        width: 100%;
        max-width: 100%;
    }
    #ffwoo-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .ffwoo-sort-wrap {
        margin-left: 0;
        width: 100%;
    }
    #ffwoo-sort {
        width: 100%;
    }
    #ffwoo-grid ul.products.columns-3,
    #ffwoo-grid ul.products.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .ffwoo-price-options,
    .ffwoo-term-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    #ffwoo-grid ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .ffwoo-price-options,
    .ffwoo-term-options {
        grid-template-columns: 1fr;
    }
}
