/* TXED Bikes - Custom WooCommerce Loop Item */

.txed-loop-product {
    position: relative;
    text-align: center;
    padding: 30px;
    box-shadow: 0px 14px 24.1px -10px #00000040;
    border-radius: 10px;
    background: #FFF;
    font-family: 'FunnelDisplay', sans-serif;
}

/* Attribute options (color images) - absolute top-left over image */
.txed-loop-product .txed-tax-options {
	position: absolute;
	top: 33px;
	left: 34px;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: 0;
	padding: 4px;
	max-width: calc(100% - 32px);
	border-radius: 4px;
}

.txed-loop-product .txed-tax-option--image {
	width: 28px;
	height: 28px;
	object-fit: contain;
	border-radius: 14px;
    background: #fff;
}

/* Product image link */
.txed-loop-image-link {
	display: block;
	position: relative;
	margin-top: 36px;
	margin-bottom: 16px;
}

.woocommerce ul.products li.product .txed-loop-image-link img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: contain;
	object-position: center;
	display: block;
}

/* Title */
.txed-loop-product .txed-loop-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1D2088;
    text-align: left;
}

/* Price */
.txed-loop-price {
    font-weight: 700;
    color: #1d2088;
    margin-bottom: 8px;
    font-size: 24px;
    line-height: 1.2;
    text-align: left;
}

.txed-loop-price .woocommerce-Price-amount {
	color: inherit;
}

.txed-loop-footer-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* Quick specs row */
.txed-loop-specs {
	display: flex;
	justify-content: center;
	gap: 15px;
    color: #1D2088;
}

.txed-loop-spec {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.txed-loop-spec svg {
    height: 1.8em;
    width: 1.8em;
    object-fit: contain;
    fill: #1D2088;
}

/* Compare toggle icon (top-right of loop card) */
body button.txed-loop-compare-icon {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #1d2088;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, color 0.2s;
}

body button.txed-loop-compare-icon:hover,
body button.txed-loop-compare-icon:focus {
	background: #1d2088;
	color: #fff;
}
button.txed-loop-compare-icon:hover svg.txed-compare-icon-svg path,
button.txed-loop-compare-icon:focus svg.txed-compare-icon-svg path {
    color: #fff;
    fill: #FFF;
}

.txed-loop-compare-icon .txed-compare-icon-svg {
	width: 18px;
	height: 18px;
}

.txed-loop-compare-icon.comparing .txed-compare-check {
	display: flex;
}

/* Buy link */
.txed-loop-buy-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 18px;
	border: 2px solid #1d2088;
	background: #1d2088 !important;
	color: #fff !important;
	border-radius: 6px;
	font-weight: 700 !important;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}

.txed-loop-buy-btn:hover,
.txed-loop-buy-btn:focus {
	background: #fff !important;
	color: #1d2088 !important;
}


/** Tablet adjustments */
@media (max-width: 1024px) {
    .txed-loop-product .txed-loop-title {
        font-size: 18px;
    }

    .txed-loop-product .txed-loop-price {
        font-size: 20px;
    }

    /* button */
    .txed-loop-compare-btn,
    .txed-loop-buy-btn {
        padding: 6px 12px;
        font-size: 16px;
    }
}



/** Mobile adjustments */
@media (max-width: 768px) {
    .txed-loop-product .txed-loop-title {
        font-size: 16px;
    }
    .txed-loop-product .txed-loop-price {
        font-size: 18px;
    }
    /* button */
    .txed-loop-compare-btn,
    .txed-loop-buy-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    .txed-loop-footer-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .txed-loop-specs {
        justify-content: flex-start;
        gap: 10px;
        margin-bottom: 10px;
    }

    .txed-loop-compare-btn,
    .txed-loop-buy-btn {
        width: 100%;
        text-align: center;
    }
}
/* Shop catalog: one complete product per row on phones. */
@media (max-width: 767px) {
    body.post-type-archive-product.woocommerce ul.products,
    body.tax-product_cat.woocommerce ul.products,
    body.tax-product_tag.woocommerce ul.products {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    body.post-type-archive-product.woocommerce ul.products::before,
    body.post-type-archive-product.woocommerce ul.products::after,
    body.tax-product_cat.woocommerce ul.products::before,
    body.tax-product_cat.woocommerce ul.products::after,
    body.tax-product_tag.woocommerce ul.products::before,
    body.tax-product_tag.woocommerce ul.products::after { display: none; }
    body.post-type-archive-product.woocommerce ul.products li.product,
    body.tax-product_cat.woocommerce ul.products li.product,
    body.tax-product_tag.woocommerce ul.products li.product {
        width: 100%;
        min-width: 0;
        margin: 0;
        float: none;
    }
}

/* TXED catalog controls: aligned count and accessible native select. */
.woocommerce .txed-catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
    margin: 16px 0 28px;
    padding: 0 0 20px;
    border-bottom: 1px solid #d7d8e8;
    clear: both;
}
.woocommerce .txed-catalog-toolbar .woocommerce-result-count {
    float: none;
    margin: 0;
    color: #1d2088;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500;
}
.woocommerce .txed-catalog-toolbar .woocommerce-ordering {
    position: relative;
    float: none;
    margin: 0;
    width: 330px;
    max-width: 100%;
    flex-shrink: 0;
}
.woocommerce .txed-catalog-toolbar .woocommerce-ordering::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #1d2088;
    border-bottom: 2px solid #1d2088;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}
.woocommerce .txed-catalog-toolbar select.orderby {
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 12px 48px 12px 16px;
    border: 1px solid #1d2088;
    border-radius: 4px;
    background: #fff;
    background-image: none;
    color: #1d2088;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: none;
    transition: border-color .18s, box-shadow .18s;
}
.woocommerce .txed-catalog-toolbar select.orderby:hover { border-color: #3986c1; }
.woocommerce .txed-catalog-toolbar select.orderby:focus-visible {
    outline: 2px solid #3986c1;
    outline-offset: 3px;
}
@media (max-width: 767px) {
    .woocommerce .txed-catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin: 16px 0 24px;
        padding-bottom: 20px;
    }
    .woocommerce .txed-catalog-toolbar .woocommerce-ordering { width: 100%; }
}
