.count-box {
    display: none; /* Hide by default, will be shown by JS if count > 0 */
}

.count-box.has-items {
    display: inline-block !important;
}

/* Quantity Controls (+ - buttons) */
.wg-quantity {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.wg-quantity.small {
    height: 32px;
    max-width: 100px;
}

.wg-quantity .btn-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 100%;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
    user-select: none;
}

.wg-quantity .btn-quantity:hover {
    background: #e9ecef;
    color: #000;
}

.wg-quantity .btn-quantity:active {
    background: #dee2e6;
}

.wg-quantity input[type="text"] {
    border: none;
    outline: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    width: 44px;
    height: 100%;
    background: white;
    color: #333;
}

.wg-quantity input[type="text"]:focus {
    outline: none;
    box-shadow: none;
}

/* Remove button styling */
.tf-mini-cart-remove {
    color: #999;
    font-size: 12px;
    cursor: pointer;
    margin-top: 4px;
    transition: color 0.2s ease;
}

.tf-mini-cart-remove:hover {
    color: #dc3545;
}

/* Mini cart buttons container */
.tf-mini-cart-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

/* Breadcrumb divider override (avoid URL showing as divider) */
.breadcrumb {
    --bs-breadcrumb-divider: "/";
}

/* Modern categories circle - one line, no scroll */
.modern-categories .modern-categories-wrap {
    overflow: hidden;
    align-items: center;
    gap: 8px;
}

.modern-categories .modern-categories-container {
    overflow: hidden;
    flex-wrap: nowrap;
    gap: 8px;
}

.modern-categories .collection-item-circle {
    min-width: 98px;
}

.modern-categories .collection-item-circle .has-saleoff-wrap,
.modern-categories .collection-item-circle .collection-image {
    width: 62px;
    height: 62px;
}

.modern-categories .collection-item-circle img {
    max-width: 64px;
}

.modern-categories .collection-content {
    margin-top: 10px !important;
}

.modern-categories .collection-content a {
    font-size: 12px !important;
    line-height: 14px !important;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 92px;
}

/* Mini cart item compact style */
.modal-shopping-cart .tf-mini-cart-item {
    padding: 10px 0;
}

.modal-shopping-cart .tf-mini-cart-image img {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.modal-shopping-cart .tf-mini-cart-image {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
}

.modal-shopping-cart .tf-mini-cart-info .title,
.modal-shopping-cart .tf-mini-cart-info .title.link {
    font-size: 13px;
    line-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-shopping-cart .tf-mini-cart-info .price {
    font-size: 12px;
    line-height: 14px;
}

.modal-shopping-cart .tf-mini-cart-info .meta-variant {
    font-size: 11px;
    line-height: 13px;
}

.modal-shopping-cart .tf-mini-cart-btns {
    gap: 6px;
}

.modal-shopping-cart .wg-quantity.small {
    height: 26px;
}

.modal-shopping-cart .wg-quantity .btn-quantity {
    width: 22px;
    font-size: 12px;
}

.modal-shopping-cart .wg-quantity input[type="text"] {
    width: 34px;
    font-size: 12px;
}

.modal-shopping-cart .tf-mini-cart-remove {
    font-size: 11px;
}

.modern-categories .tf-shopall .icon,
.modern-categories .tf-shopall .icon-arrow1-top-left {
    font-size: 16px;
}

.modern-categories .tf-shopall .collection-image {
    width: 62px;
    height: 62px;
}

/* Cart modal brand icons - small 4 per row */
.modal-shopping-cart .tf-minicart-brands-grid .collection-item-circle {
    min-width: auto;
}

.modal-shopping-cart .tf-minicart-brands-grid .collection-item-circle .has-saleoff-wrap,
.modal-shopping-cart .tf-minicart-brands-grid .collection-item-circle .collection-image {
    width: 48px;
    height: 48px;
}

.modal-shopping-cart .tf-minicart-brands-grid .collection-item-circle img {
    max-width: 48px;
    max-height: 48px;
    border-radius: 50%;
}

.modal-shopping-cart .tf-minicart-brands-grid .collection-content {
    margin-top: 6px !important;
}

.modal-shopping-cart .tf-minicart-brands-grid .collection-content a {
    font-size: 10px !important;
    line-height: 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ===================================================
   GLOBAL PRODUCT CARD IMAGE FIX
   Applied to all pages via custom-layout.css
   =================================================== */

/* Consistent aspect-ratio box so images never stretch cards */
.card-product-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: #f5f5f5;
    width: 100%;
    flex-shrink: 0;
}

/* product-img link fills the wrapper */
.card-product-wrapper .product-img,
.card-product-wrapper > a.product-img {
    display: block;
    width: 100%;
    height: 100%;
}

/* Both images fill the box and cover it */
.card-product-wrapper .img-product,
.card-product-wrapper .img-hover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: opacity 0.4s ease, transform 0.5s ease;
}

/* Hover image sits on top, hidden by default */
.card-product-wrapper .img-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}

/* Hover effects */
.card-product:hover .card-product-wrapper .img-product {
    transform: scale(1.05);
}

.card-product:hover .card-product-wrapper .img-hover {
    opacity: 1;
}

/* Card body fills remaining height */
.card-product {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-product-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Title 2-line clamp */
.card-product-info .title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}