:root {
    --tsux-green: #1f6a36;
    --tsux-green-dark: #174f29;
    --tsux-soft: #f3f8f2;
    --tsux-border: #dce7dc;
    --tsux-ink: #1d2820;
}

/* Keep only eight useful category shortcuts on the main shop archive. */
.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card {
    display: none !important;
}

.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card:nth-child(2),
.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card:nth-child(6),
.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card:nth-child(8),
.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card:nth-child(16),
.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card:nth-child(20),
.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card:nth-child(24),
.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card:nth-child(27),
.post-type-archive-product:not(.search-results) .tscig-grid .tscig-card:nth-child(32) {
    display: flex !important;
}

.post-type-archive-product:not(.search-results) .tscig-section {
    margin-top: 16px !important;
    margin-bottom: 22px !important;
    padding: 18px !important;
}

.post-type-archive-product:not(.search-results) .tscig-section__head {
    margin-bottom: 14px !important;
}

.post-type-archive-product:not(.search-results) .tscig-grid {
    gap: 12px !important;
}

/* Search results must appear immediately below the compact category selector. */
.search-results .tscig-section {
    display: none !important;
}

.search-results .woocommerce-result-count,
.search-results .trelo-products-per-page,
.search-results .woocommerce-ordering {
    margin-top: 14px !important;
}

/* The old theme pill was always visible; the plugin renders a real 30-day badge. */
.ts-product-pill--new {
    display: none !important;
}

.tsux-new-badge {
    position: absolute;
    z-index: 3;
    top: 12px;
    left: 12px;
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--tsux-green);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
}

.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce ul.products li.product a img,
.home .products li.product img,
.shop-products li.product img {
    width: 100% !important;
    height: 230px !important;
    object-fit: contain !important;
}

/* Autosuggest. */
.tsux-search-results {
    position: absolute;
    z-index: 99999;
    top: calc(100% + 7px);
    right: 0;
    left: 0;
    max-height: min(520px, 72vh);
    overflow-y: auto;
    border: 1px solid var(--tsux-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(22, 46, 27, .18);
}

.tsux-search-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid #edf1ed;
}

.tsux-search-result:last-child {
    border-bottom: 0;
}

.tsux-search-result__link {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--tsux-ink) !important;
    text-decoration: none !important;
}

.tsux-search-result__link img {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: contain;
    background: #f8faf8;
}

.tsux-search-result__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.tsux-search-result__copy strong {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tsux-search-result__price {
    color: var(--tsux-green-dark);
    font-size: 14px;
    font-weight: 800;
}

.tsux-search-result__add {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: var(--tsux-green);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
}

.tsux-search-result__add:hover,
.tsux-search-result__add:focus-visible {
    background: var(--tsux-green-dark);
}

.tsux-search-results__empty {
    margin: 0;
    padding: 18px;
    color: #59645b;
    text-align: center;
}

/* Archive quantity control and clear post-add action. */
.tsux-qty-control {
    display: grid;
    grid-template-columns: 42px minmax(38px, 1fr) 42px;
    align-items: center;
    width: 100%;
    max-width: 180px;
    min-height: 42px;
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid var(--tsux-green);
    border-radius: 10px;
    background: #fff;
}

.tsux-qty-control__button {
    align-self: stretch;
    border: 0;
    background: var(--tsux-soft);
    color: var(--tsux-green-dark);
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
}

.tsux-qty-control__value {
    text-align: center;
    font-weight: 900;
}

.tsux-qty-control.is-loading,
.tsux-fulfillment.is-loading {
    opacity: .58;
    pointer-events: none;
}

.woocommerce a.added_to_cart.wc-forward {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-top: 8px;
    padding: 9px 14px;
    border-radius: 9px;
    background: var(--tsux-green);
    color: #fff !important;
    font-weight: 800;
    text-decoration: none;
}

.tsux-toast {
    position: fixed;
    z-index: 999999;
    right: 18px;
    bottom: 22px;
    display: flex;
    max-width: min(420px, calc(100vw - 36px));
    align-items: center;
    gap: 16px;
    padding: 13px 16px;
    transform: translateY(24px);
    border-radius: 12px;
    background: #17231a;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.tsux-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.tsux-toast a {
    flex: 0 0 auto;
    border-bottom: 1px solid currentColor;
    color: #fff !important;
    font-weight: 900;
    text-decoration: none;
}

/* Cart fulfillment and free-delivery progress. */
.tsux-fulfillment {
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid var(--tsux-border);
    border-radius: 14px;
    background: #fff;
}

.wc-block-cart__sidebar .tsux-fulfillment--block {
    box-sizing: border-box;
    width: 100%;
}

.tsux-fulfillment h3 {
    margin: 0 0 13px;
    font-size: 18px;
}

.tsux-fulfillment__choices {
    display: grid;
    gap: 9px;
}

.tsux-fulfillment__choices label {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dfe7df;
    border-radius: 11px;
    cursor: pointer;
}

.tsux-fulfillment__choices label:has(input:checked) {
    border-color: var(--tsux-green);
    background: var(--tsux-soft);
    box-shadow: inset 0 0 0 1px var(--tsux-green);
}

.tsux-fulfillment__choices input {
    margin-top: 3px;
}

.tsux-fulfillment__choices span,
.tsux-fulfillment__choices small {
    display: block;
}

.tsux-fulfillment__choices small {
    margin-top: 2px;
    color: #657066;
    font-size: 12px;
}

.tsux-delivery-progress {
    margin-top: 14px;
}

.tsux-delivery-progress__bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eee8;
}

.tsux-delivery-progress__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tsux-green);
}

.tsux-delivery-progress p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Product page. */
.tsux-breadcrumb {
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto 14px !important;
    color: #637064;
    font-size: 13px;
}

.single-product .product_title {
    margin-bottom: 18px !important;
    font-size: clamp(30px, 2.6vw, 42px) !important;
    line-height: 1.12 !important;
    letter-spacing: -.02em !important;
}

.single-product .woocommerce-product-gallery,
.single-product div.product div.images,
.single-product .woocommerce-product-gallery__wrapper,
.single-product .woocommerce-product-gallery__image {
    min-height: 0 !important;
    height: auto !important;
}

.single-product .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    max-height: 500px !important;
    object-fit: contain !important;
}

.single-product .product_meta {
    margin-top: 20px !important;
    line-height: 1.7 !important;
}

.single-product form.cart {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.single-product form.cart .quantity {
    display: grid;
    grid-template-columns: 38px 54px 38px;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #ccd7cd;
    border-radius: 9px;
}

.single-product form.cart .quantity .qty {
    width: 54px !important;
    min-height: 43px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    text-align: center;
}

.tsux-product-qty {
    border: 0;
    background: var(--tsux-soft);
    color: var(--tsux-green-dark);
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
}

.tsux-product-delivery-note {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 11px;
    background: var(--tsux-soft);
    color: #285a31;
    font-size: 13px;
    font-weight: 750;
}

.tsux-product-delivery-note a {
    width: 100%;
    color: var(--tsux-green-dark);
    font-weight: 800;
}

.single-product .related.products {
    margin-top: 38px !important;
}

/* Checkout timing choice. */
.tsux-delivery-choice {
    display: grid;
    gap: 8px;
    margin: 14px 0 18px;
    padding: 15px;
    border: 1px solid var(--tsux-border);
    border-radius: 12px;
    background: #fff;
}

.tsux-delivery-choice legend {
    padding: 0 5px;
    font-weight: 900;
}

.tsux-delivery-choice label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.wc-block-checkout .tsux-delivery-choice {
    grid-column: 1 / -1;
    width: 100%;
}

@media (max-width: 782px) {
    .post-type-archive-product:not(.search-results) .tscig-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .tsux-toast {
        right: 10px;
        bottom: 82px;
        left: 10px;
        max-width: none;
    }

    .tsux-search-results {
        position: fixed;
        top: 104px;
        right: 10px;
        left: 10px;
        max-height: calc(100vh - 190px);
    }

    .tsux-breadcrumb {
        width: calc(100% - 24px);
    }
}
