:root {
    --primary-color: #3bb77e;
    --cta-color: #2e3091;
    --danger-color: #fd6e6e;
    --text-color: #253D4E;
    --text-muted: #adadad;
    --border-color: #ececec;
    --bg-color: #ffffff;
    --star-color: #fdc040;
    --organic-bg: #def9ec;
    --organic-text: #3bb77e;
    --discount-bg: #ea4b48;
}

/* WooCommerce product grid (equivalente a .product-grid del HTML original) */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto !important;
    padding: 0 !important;
    list-style: none;
    gap: 0 !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
    display: none !important;
}

.woocommerce ul.products li.product.product-card,
.woocommerce-page ul.products li.product.product-card {
    padding: 20px !important;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background: var(--bg-color);
    display: flex !important;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
    width: auto !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    min-height: 100%;
}

.woocommerce ul.products li.product.product-card:nth-child(5n),
.woocommerce-page ul.products li.product.product-card:nth-child(5n) {
    border-right: none;
}

.woocommerce ul.products li.product.product-card:nth-last-child(-n+5),
.woocommerce-page ul.products li.product.product-card:nth-last-child(-n+5) {
    border-bottom: none;
}

.woocommerce ul.products li.product.product-card:hover,
.woocommerce-page ul.products li.product.product-card:hover {
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    z-index: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 2;
}

.discount-badge {
    background-color: var(--discount-bg);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1;
}

.heart-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    margin-left: auto;
    text-decoration: none;
    line-height: 1;
}

.heart-btn:hover {
    color: var(--primary-color);
}

.product-image {
    position: relative;
    margin-bottom: 15px;
    margin-top: 25px;
    text-align: center;
}

.image-placeholder {
    width: 100%;
    overflow: hidden;
}

.image-placeholder img {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.product-card:hover .image-placeholder img {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    bottom: -10px;
    left: 0;
    background-color: #f4f5f9;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    line-height: 1;
}

.product-details { 
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-top: 0px;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text-color);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover {
    color: var(--primary-color);
}

.price-section {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.current-price.red-price {
    color: var(--discount-bg);
}

.current-price.black-price {
    color: var(--text-color);
}

.original-price {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: line-through;
    line-height: 1;
}

.action-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.add-to-cart-btn {
    width: 100%;
    background-color: #fff;
    color: var(--cta-color) !important;
    border: 1.5px solid var(--cta-color);
    border-radius: 999px;
    min-width: 170px;
    height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
    padding: 0 14px !important;
    min-height: 38px;
    gap: 12px;
}

.add-to-cart-btn:hover {
    background-color: var(--cta-color);
    color: #fff !important;
}

.add-to-cart-btn:focus-visible {
    outline: 2px solid var(--cta-color);
    outline-offset: 2px;
}

.add-to-cart-label {
    font-size: 12px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.add-to-cart-plus {
    font-size: 20px;
    line-height: 1;
    font-weight: 400;
}

.stock-status {
    font-size: 12px;
    font-weight: 700;
}

.stock-status.in-stock {
    color: var(--primary-color);
}

/* Ocultar elementos Woo por defecto que interfieren */
.woocommerce ul.products li.product.product-card .star-rating,
.woocommerce ul.products li.product.product-card .button.loading::after,
.woocommerce ul.products li.product.product-card .added_to_cart {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(4, 1fr);
    }
    .woocommerce ul.products li.product.product-card:nth-child(5n),
    .woocommerce-page ul.products li.product.product-card:nth-child(5n) {
        border-right: 1px solid var(--border-color);
    }
    .woocommerce ul.products li.product.product-card:nth-child(4n),
    .woocommerce-page ul.products li.product.product-card:nth-child(4n) {
        border-right: none;
    }
}

@media (max-width: 992px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
    .woocommerce ul.products li.product.product-card:nth-child(4n),
    .woocommerce-page ul.products li.product.product-card:nth-child(4n) {
        border-right: 1px solid var(--border-color);
    }
    .woocommerce ul.products li.product.product-card:nth-child(3n),
    .woocommerce-page ul.products li.product.product-card:nth-child(3n) {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
    .woocommerce ul.products li.product.product-card:nth-child(3n),
    .woocommerce-page ul.products li.product.product-card:nth-child(3n) {
        border-right: 1px solid var(--border-color);
    }
    .woocommerce ul.products li.product.product-card:nth-child(2n),
    .woocommerce-page ul.products li.product.product-card:nth-child(2n) {
        border-right: none;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: 1fr;
    }
    .woocommerce ul.products li.product.product-card,
    .woocommerce-page ul.products li.product.product-card {
        border-right: none;
    }
}
