/**
 * Product Card Styles
 * 
 * This stylesheet provides modern, premium styles for WooCommerce product cards.
 */

/* Product Card Container */

/* ----- дополнительная информация о продукте ----- */
.product-card-wrapper .type-product .e-con-boxed, .product-card-wrapper .type-product{
    height: 100%;
    font-family: "Google Sans", sans-serif;
}

/* Badges should be anchored to the image container, not the whole card */
.product-card-wrapper{
    position: static;
}

.product-card-wrapper .product-card-image,
.product-card-wrapper .elementor-widget-theme-post-featured-image,
.product-card-wrapper .elementor-widget-theme-post-featured-image .elementor-widget-container,
.product-card-wrapper .tespi-badges-anchor{
    position: relative;
}

/* ----- badges: New / Discount / Popular ----- */
.tespi-product-badges{
    position: absolute;
    left: 8px;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
    pointer-events: none;
}

.tespi-product-badges--center{
    left: 50%;
    transform: translateX(-50%);
}

.tespi-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: "Google Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 16px;
    color: #fff;
    white-space: nowrap;
    width: fit-content;
}

.tespi-badge--new{ 
    background: #48AC4A;
    text-transform: uppercase;
}
.tespi-badge--discount{ background: #EE922B; }
.tespi-badge--popular{ background: #E11D48; }

.product-quantity table,
.product-quantity th,
.product-quantity td {
    margin: 0 !important;
    border: none !important;
    text-align: left !important;
    font-weight: 400 !important;
}

.product-quantity .woocommerce-product-attributes-item__label,
.product-quantity p {
    padding: 0 !important;
}

.product-quantity h2{
    display: none !important;
}

.woocommerce .product-quantity table.shop_attributes th {
    width: auto;
}

.woocommerce .product-quantity table.shop_attributes td {
    font-style: normal;
}


/* ----- кастомное наличие продукта ----- */
.custom-stock-status {
    display: inline-flex;
    align-items: center;
    padding-left: 8px;
    font-weight: 400;
    font-size: 12px;
    font-family: "Google sans", Sans-Serif;
    line-height: 16px;
    margin-bottom: auto !important;
}

.custom-stock-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    position: absolute;
    left: 0;
    top: 5px;
}

.custom-stock-status.in-stock {
    color: #48AC4A;
}

.custom-stock-status.in-stock::before {
    background-color: #48AC4A;
}

.custom-stock-status.out-of-stock {
    color: #E11D48;
}

.custom-stock-status.out-of-stock::before {
    background-color: #E11D48;
}


/* ----- стили для цены продукта ----- */
.product-price .price {
    display: flex;
    flex-direction: row-reverse;
    justify-content: left;
    gap: 8px;
}

.product-price ins {
    text-decoration: none !important;
}

.product-price del {
    color: #969696;
    text-decoration-color: #969696;
    font-weight: 400;
    font-size: 14px;
}

/* ----- Кастомная кнопка карточки продукта ----- */
.custom-card-cart {
    width: 100%;
    font-size: 16px;
    font-weight: 600;
}

.custom-card-cart-add,
.custom-card-cart-qty,
.custom-card-cart-link {
    width: 100%;
    min-height: 46px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
    white-space: nowrap;
}

.custom-card-cart-add,
.custom-card-cart-link {
    background: #F4F4F4 !important;
    color: #1E1E1E !important;
    cursor: pointer;
    padding: 12px 16px !important;
    gap: 8px;
    flex-direction: row-reverse;
    transition: all 0.3s;
}


.custom-card-cart-add:hover,
.custom-card-cart-link:hover {
    color: #ffffff !important;
    background-color: #EE922B !important;
    text-decoration: none;
}

.custom-card-cart-icon svg path {
    transition: all 0.3s;
}

.custom-card-cart-add:hover .custom-card-cart-icon svg path {
    stroke: #ffffff;
    transition: all 0.3s;
}

.custom-card-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.custom-card-cart-qty {
    background: #EE922B;
    color: #FFFFFF;
    padding: 6px;
    justify-content: space-between;
    gap: 10px;
}

.custom-card-cart-minus,
.custom-card-cart-plus {
    width: 36px;
    min-width: 36px;
    height: 32px;
    border: none;
    background: transparent;
    color: #FFFFFF;
    font-size: 24px !important;
    font-weight: 400 !important;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-card-cart-minus:hover,
.custom-card-cart-plus:hover,
.custom-card-cart-minus:focus,
.custom-card-cart-plus:focus {
    background-color: rgba(255, 255, 255, 0) !important;
    text-align: center;
}

.custom-card-cart-qty-num {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    font-family: "Google Sans", Sans-Serif;
}

.custom-card-cart-add.loading,
.custom-card-cart-minus.is-busy,
.custom-card-cart-plus.is-busy {
    opacity: 0.7;
    pointer-events: none;
}

/* ----- Out of stock styles ----- */
.is-out-of-stock .custom-card-cart-add,
.is-out-of-stock .custom-card-cart-link,
.product.out-of-stock .custom-card-cart-add,
.product.out-of-stock .custom-card-cart-link,
.tespi-product-card-out-of-stock .custom-card-cart-add,
.tespi-product-card-out-of-stock .custom-card-cart-link {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* Use :has() only on very specific loop item containers if they exist */
.elementor-loop-item:has(.is-out-of-stock) img,
.product:has(.is-out-of-stock) img {
    opacity: 0.5 !important;
}