@keyframes slideInUp {
    0% {
        height: 0;
    }
    100% {
        height: auto;
    }
}

form.cart .quantity {
    display: none;
}

.ct-cart-actions .tiered-buy-btn {
    max-width: 100%;
}

/* Rowed tier list to mirror reference UI */
div#wtp-discount-list-container ul:not(.wtp-table) {
    padding: 0;
    border: 1px solid #dcdfe5;
    border-radius: 12px;
    list-style: none;
    display: block;
    margin: 0;
    overflow: hidden;
    background: #fff;
}

div#wtp-discount-list-container ul:not(.wtp-table) li {
    position: relative;
    border: 0;
    border-bottom: 1px solid #e8ebf1;
    border-radius: 0;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 32px;
    align-items: center;
    column-gap: 10px;
    background: #fff;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

div#wtp-discount-list-container ul:not(.wtp-table) li:last-child {
    border-bottom: 0;
}

div#wtp-discount-list-container ul:not(.wtp-table) li:hover {
    background: #a8d59c36;
}

div#wtp-discount-list-container ul li.wtp-selected {
    background: #a8d59c;
}

div#wtp-discount-list-container ul:not(.wtp-table) li > span {
    display: block;
    line-height: 1.3;
    margin: 0;
}

div#wtp-discount-list-container ul li > span.ma-quantity-range {
    font-weight: 700;
    color: #2c2f33;
}

div#wtp-discount-list-container ul li > span.pre-inquiry-price {
    /* font-weight: 800;
    font-size: 1.05em; */
    color: #1d232a;
}

div#wtp-discount-list-container ul li > span.wtp-unit-price {
    text-align: left;
    color: #3c4047;
    font-size: 0.92em;
}

div#wtp-discount-list-container ul:not(.wtp-table) li:after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #c3c8d4;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
}

div#wtp-discount-list-container ul:not(.wtp-table) li.wtp-selected:after {
    border-color: #5f9c53;
    background: #5f9c53;
    box-shadow: inset 0 0 0 4px #a8d59c;
}

div#wtp-discount-list-container ul.wtp-table {
    min-width: 300px;
}

.tiered-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

[data-products=type-2] .tiered-product-card {
    border: 1px solid #dcdfe5;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    position: relative;
}

.tiered-product-card .product-title {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1e2a3a;
    margin-bottom: 6px;
    min-height: 3.2em;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tiered-product-card .tiered-price {
    font-weight: 700;
    color: #1d232a;
}

.tiered-product-card .tiered-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tiered-product-card .tiered-product-thumb img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tiered-price-toggle {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #dcdfe5;
    border-radius: 4px;
    background: #f6f7f9;
    cursor: pointer;
    font-size: 14px;
}

.product-link-wrap.blur {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.tiered-price-toggle .toggle-pack {
    text-align: left;
    line-height: 16px;
}

.tiered-price-toggle .pack-label {
    font-weight: 600;
    color: #2c2f33;
}

.tiered-price-toggle .toggle-icon {
    font-size: 1.05em;
    line-height: 16px;
}

.tiered-price-toggle .toggle-prices {
    text-align: right;
    line-height: 16px;
}

.tiered-price-toggle .pack-price {
    font-weight: 700;
    color: #1d232a;
}

.tiered-price-toggle .unit-price {
    font-size: 0.9em;
    color: #555;
}

.tiered-price-wrap {
    position: relative;
    width: 100%;
}

.tiered-table-wrap {
    cursor: pointer;
    background: #f6f7f9;
    border: 1px solid #dcdfe5;
    border-radius: 4px;
    position: absolute;
    left: 0;
    bottom: 0px;
    padding: 0 10px 10px;
    margin: 0;
    width: 100%;
    animation: slideInUp .2s forwards;
    overflow: hidden;
}

.tiered-table-wrap.collapsed {
    display: none;
}

.tiered-table-minimise {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.tiered-table-minimise .toggle-icon {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.tiered-add-to-cart {
    width: 100%;
}

.tiered-add-to-cart button {
    width: 100%;
    color: #fff;
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.tiered-add-to-cart button:hover {
    background: #0f2d4f;
}

/* .tiered-add-to-cart button.added {
    display: none;
} */
.tiered-add-to-cart .added_to_cart.wc-forward {
    display: none;
}

.tiered-add-to-cart a {
    border-radius: 6px;
    width: 100%;    
}

.tiered-table-wrap h4 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
}

.tiered-table-wrap div#wtp-discount-list-container {
    margin: 0;
}

.tiered-table-wrap div#wtp-discount-list-container ul:not(.wtp-table) {
    border: 0;
    border-radius: 4px;
}

.tiered-table-wrap div#wtp-discount-list-container ul:not(.wtp-table) li {
    grid-template-columns: 1.2fr 1.2fr;
    padding-right: 40px;
}

.tiered-table-wrap div#wtp-discount-list-container ul li > span.wtp-unit-price  {
    display: none;
}

.product-brand,
.product-cats {
    font-size: 0.9rem;
    color: #666;
}

/* Floating bar specific styles */
.ct-floating-bar section {
    position: relative;
}
.ct-floating-bar form.cart {
    display: flex;
    align-items: end;
    justify-content: space-between;
    position: absolute;
    bottom: 0;
    right: 0;
    width: 350px;
    text-align: right;
}
.ct-floating-bar #wtp-discount-list-container {
    margin: 0;
}

.ct-drawer-canvas .ct-floating-bar .wtp-product-based-tier {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.ct-drawer-canvas .ct-floating-bar .tiered-price-toggle {
    width: 170px;
}

.ct-drawer-canvas .ct-floating-bar .tiered-table-wrap {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    left: auto;
    top: auto;
    transform: none;
    width: 250px;
    max-width: 420px;
}

.ct-drawer-canvas .ct-floating-bar #wtp-discount-list-container ul:not(.wtp-table) li {
    grid-template-columns: 1fr 1fr 32px;
}

.ct-drawer-canvas .ct-floating-bar div#wtp-discount-list-container ul li > span.wtp-unit-price  {
    display: none;
}

.ct-floating-bar .added_to_cart {
    display: none;
}

@media screen and (max-width: 575px) {
    div#wtp-discount-list-container ul:not(.wtp-table) li {
        grid-template-columns: 1fr 1fr 1fr 20px;
    }
    div#wtp-discount-list-container ul li > span.wtp-unit-price {
        text-align: left;
    }

    /* Adjust floating bar height for tiered pricing on mobile */
    .ct-drawer-canvas[data-floating-bar] {
        --floating-bar-height: 110px;
    }
    
    .ct-drawer-canvas[data-floating-bar] .ct-floating-bar {
        height: 110px;
    }

    .ct-drawer-canvas[data-floating-bar] .ct-floating-bar .ct-container, .ct-floating-bar section:last-child {
        display: block;
    }
    
    .ct-floating-bar form.cart {
        position: static;
        width: 100%;
        text-align: center;
        gap: 10px;
        margin-top: 10px;
    }
    
    .ct-drawer-canvas .ct-floating-bar #wtp-tier-data, 
    .ct-drawer-canvas .ct-floating-bar .tiered-price-toggle,
    .ct-drawer-canvas .ct-floating-bar .tiered-table-wrap {
        width: 100%;
    }
}
