/* Typography */
.tsfs-wrapper, .tsfs-wrapper * { font-family:'Montserrat', system-ui, Arial, sans-serif !important; font-weight:400 !important; }

/* Container */
.tsfs-wrapper{max-width:1200px;margin:0 auto}

/* Sections & headings (header removed per request) */
.tsfs-section{margin-bottom:2rem}

/* --- UPDATED: Headers are now uppercase and left-aligned --- */
.tsfs-title{
    margin:0 0 1rem 0;
    font-size:1.25rem;
    text-transform: uppercase !important; /* CAPITALIZE main headers */
    text-align: left; /* Ensure left alignment */
}

/* Subtitles (h4 inside render_subterm_products) - I'm adding this rule based on your PHP to style sub-headers */
.tsfs-subtitle {
    margin: 1.5rem 0 0.5rem 0; 
    font-size: 1rem;
    text-transform: uppercase; /* CAPITALIZE sub-headers */
    text-align: left; /* Ensure left alignment */
}

/* Grid: 2 mobile, 4 desktop */
.tsfs-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
@media (min-width:1024px){ .tsfs-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:1.25rem} }

/* Cards */
.tsfs-card{background:#fff;display:flex;flex-direction:column;border:none;box-shadow:none}
.tsfs-media{position:relative;aspect-ratio:1/1;overflow:hidden;background:#f7f7f7;border:none}
.tsfs-thumb{width:100%;height:100%;object-fit:cover;border-radius:0!important}

/* Button overlay (transparent, white text/border) */
.tsfs-add.tsfs-add--overlay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);opacity:0;visibility:hidden;transition:opacity .2s ease, transform .2s ease;pointer-events:none;
  background:transparent!important;border-radius:0!important;color:#fff!important;border:1px solid rgba(255,255,255,.9)!important;text-transform:uppercase;font-size:.85rem;letter-spacing:.03em;padding:.5rem .75rem;margin:0!important}
.tsfs-media:hover .tsfs-add--overlay, .tsfs-media:focus-within .tsfs-add--overlay{opacity:1;visibility:visible;transform:translate(-50%,-50%) scale(1.02);pointer-events:auto}
.tsfs-add.tsfs-add--overlay:hover{background:rgba(255,255,255,.1)!important}

/* Selected tick (centered) */
.tsfs-item.is-selected .tsfs-media::after{content:"";position:absolute;inset:0;background:url('https://www.millboard.com/themes/custom/millboard/svg/check-mark.svg') 50% 50%/77px 77px no-repeat;opacity:1;pointer-events:none}
.tsfs-item.is-selected .tsfs-media:hover::after, .tsfs-item.is-selected .tsfs-media:focus-within::after{opacity:0}

/* --- UPDATED: Product Name font size and alignment --- */
.tsfs-name{
    text-align:left;
    text-transform: uppercase !important; /* Removed !important as it wasn't necessary */
    font-size: 0.75rem; /* 12px for mobile (base) */
    color:#000;
    margin:.5rem 0 .75rem;
}
@media (min-width:1024px){ 
    .tsfs-name{
        font-size: 0.9375rem; /* 15px for desktop */
    }
}

/* Sticky footer with counts */
.tsfs-selected{position:sticky;bottom:1rem;z-index:20}
.tsfs-selected-inner{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:1rem;border:1px solid var(--wc-border,#e5e7eb);border-radius:12px;background:#fff}
.tsfs-counts{display:flex;gap:1rem;font-size:.95rem}
.tsfs-warning{color:#b91c1c}
.tsfs-empty{opacity:.7}