/* Card de producto unificada (Home / Tienda / Categoria / Relacionados / Wishlist / Carrito) */

.home-product-card,
ul.products li.product.home-product-card {
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition);
    background: var(--color-white);
    list-style: none;
    margin: 0;
    padding: 0;
    width: auto;
    float: none;
    text-align: left;
}

.home-product-card:hover,
ul.products li.product.home-product-card:hover {
    box-shadow: var(--shadow-md);
}

.home-product-card__image-wrap {
    position: relative;
    aspect-ratio: 1;
    background: var(--color-grey-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.home-product-card__image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.home-product-card__image-wrap img,
.home-product-card__image-wrap .wp-post-image {
    max-height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin: 0;
}

.home-product-card__cart-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    color: var(--color-dark);
    text-decoration: none;
    padding: 0;
    transition: border-color var(--transition), background var(--transition);
}

.home-product-card__wish-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: var(--color-white);
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    color: var(--color-dark);
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.home-product-card__wish-btn:hover,
.home-product-card__wish-btn.is-active {
    border-color: var(--color-orange);
    color: var(--color-orange);
}

.home-product-card__wish-btn.is-active svg path {
    fill: var(--color-orange);
    stroke: var(--color-orange);
}

.home-product-card__wish-btn svg,
.home-product-card__cart-btn svg {
    width: 16px;
    height: 16px;
}

.home-product-card__cart-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.home-product-card__cart-btn.added {
    border-color: var(--color-orange);
    background: #fff7ed;
}

.home-product-card__cart-btn:hover {
    border-color: var(--color-orange);
}

.home-product-card__info {
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
}

.product-sale-save {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
}

.product-sale-save__amount {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.product-sale-save__ends {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #e53935;
    background: #fff;
    color: #e53935;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.home-product-card__price {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: #e53935;
    margin-bottom: 4px;
}

.home-product-card__price del {
    font-size: var(--font-size-sm);
    color: var(--color-grey-text);
    font-weight: 400;
    margin-left: 6px;
}

.home-product-card__price ins {
    text-decoration: none;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
}

.product-rating__star {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
    color: #cfcfcf;
    line-height: 0;
}

.product-rating__star-empty {
    display: block;
}

.product-rating__star-fill {
    position: absolute;
    inset: 0 auto 0 0;
    overflow: hidden;
    color: var(--color-orange);
}

.product-rating__star-fill svg {
    display: block;
}

.home-product-card__name,
.home-product-card__name.woocommerce-loop-product__title {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--color-grey-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.home-product-card__name a {
    color: inherit;
}

/* Ocultar botones WC nativos si algun plugin los inyecta */
.home-product-card > .button,
.home-product-card > a.button,
ul.products li.product.home-product-card > .button {
    display: none !important;
}

/* Alias: cualquier doro-product-card antiguo se comporta como home */
.doro-product-card {
    border: 1px solid var(--color-grey-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-white);
}

@media (max-width: 1100px) {
    .home-product-card__image-wrap {
        padding: var(--spacing-sm);
        max-height: 200px;
    }

    .home-product-card__info {
        padding: 10px 12px 12px;
    }

    .home-product-card__price {
        font-size: var(--font-size-base);
    }
}

@media (max-width: 768px) {
    .home-product-card__image-wrap {
        max-height: 150px;
        padding: 8px;
    }

    .home-product-card__cart-btn,
    .home-product-card__wish-btn {
        width: 28px;
        height: 28px;
        bottom: 6px;
    }

    .home-product-card__cart-btn {
        right: 6px;
    }

    .home-product-card__wish-btn {
        left: 6px;
    }

    .home-product-card__cart-btn svg,
    .home-product-card__wish-btn svg {
        width: 14px;
        height: 14px;
    }

    .home-product-card__info {
        padding: 8px 10px 10px;
    }

    .home-product-card__price {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .home-product-card__name,
    .home-product-card__name.woocommerce-loop-product__title {
        font-size: 11px;
    }

    .product-sale-save__amount {
        font-size: 10px;
        padding: 2px 6px;
    }

    .product-sale-save__ends {
        font-size: 10px;
    }

    .product-rating__star {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .home-product-card__image-wrap {
        max-height: 120px;
        padding: 6px;
    }
}
