/* Estilos para el patrón Huertobio Custom Post Query Loop */

ul.cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(165px, 0.2fr));
    justify-content: start;
    gap: 1.8em;
    margin: 0 0 2em 0 !important;
    padding: 0;
    overflow: visible !important;
    position: relative;
}

ul.cards::before,
ul.cards::after {
    content: none !important;
}

/* Tarjeta de Post */
ul.cards li {
    display: flex !important;
    flex-flow: column wrap;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    border-radius: 1.25em;
    background-color: white;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    transition: all 0.5s ease !important;
    position: relative;
    margin: 0 !important;
    width: auto !important;
    height: fit-content;
}

ul.cards li.product-separator {
    height: auto;
    background-color: var(--background-middle);
    padding: 1.15em 1.25em !important;
    justify-content: space-between;
    align-content: flex-end;
    flex-direction: row;
    /* grid-column: 1; */
}

ul.cards li.product-separator h3 {
    color: var(--front-middle);
    margin: 0;
    font-size: 1.5em !important;
    font-weight: 600;
    line-height: 1em;
    padding-bottom: 0;
}

ul.cards li.is-hidden {
    display: none !important;
}

ul.cards li>* {
    /* flex: 0 0 auto; */
    /* width: 100%; */
}

/* Cabecera Tarjeta */
ul.cards li .head {
    position: relative;
    width: 100%;
    background: white;
    border-radius: 1em 1em 0 0;
    padding: 0.75em 0.75em 0 0.75em;
}

ul.cards li .seasonal_task_info,
ul.cards li .nutrient_info,
ul.cards li .property_info,
ul.cards li .lunar_phase_info {
    font-size: 0.75em;
    text-align: left;
    font-weight: bold;
    line-height: 1.45;
}

/* Imagen Post */
ul.cards li .image,
ul.cards li .product-image {
    margin-bottom: 1em;
}

ul.cards li .image_box {
    /* Mantener por si se usa en otro contexto */
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    position: relative;
}

ul.cards li .image_box::before,
/* Fondo gris */
ul.cards li .image_box::after {
    /* Círculo blanco */
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 50% 50% 0 0;
    background-color: #fbf9f6;
    z-index: 1;
}

ul.cards li .image_box::after {
    /* Círculo blanco interior */
    width: calc(100% - 1.5em);
    height: calc(100% - 1.5em);
    left: 0.75em;
    top: 0.75em;
    border-radius: 50%;
    background-color: white;
    z-index: 2;
}

ul.cards li .image_container {
    /* Mantener por si se usa en otro contexto */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 3;
}

ul.cards li .cropper {
    /* Mantener por si se usa en otro contexto */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: calc(100% - 1.25em);
    height: calc(100% - 1.25em);
    overflow: hidden;
    border-radius: 50%;
    z-index: 3;
}

ul.cards li img {
    display: block;
    background-color: white;
    max-height: 100%;
    width: auto;
    height: 100% !important;
    object-fit: contain;
    margin: auto !important;
    position: relative;
    z-index: 3;
}

/* Info Post */
ul.cards li .custom-post-info,
ul.cards li .product-info {
    padding: 0 0.5em;
}

ul.cards li .custom-post-info .price_container {
    /* Mantener por si se usa en otro contexto */
    min-height: 2em;
}


ul.cards li .title,
ul.cards li .woocommerce-loop-product__title {
    text-align: left !important;
    margin: 0.5em 0 0.1em 0 !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    line-height: 1.3;
    padding: 0 !important;
}


/* Pie Tarjeta */
ul.cards li .foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 14px;
    margin-top: 10px;
    width: 100%;
    padding: 0 0.25em;
    box-sizing: border-box;
    margin-top: 0;
    padding: 1em;
    border-radius: 0 0 1em 1em;
}

ul.cards li .brands {
    font-size: 0.69em;
    color: gray;
}


/* Estilos específicos indicadores en huerto-indicators.css */

.woocommerce ul.products li.product .star-rating {
    font-size: .75em;
    margin: -1px 0 0 0;
}

/* Contenido Desplegable */
ul.cards li .custom-post_content,
ul.cards li .product_content {
    display: flex !important;
    flex-flow: column;
    align-items: center;
    overflow: hidden;
    position: absolute;
    top: calc(100% - 1em);
    left: 0;
    width: 100%;
    background-color: white;
    z-index: -1;
    max-height: 0;
    padding: 1em;
    box-shadow: 0 0 0 0 transparent;
    transform: translate(0px, 0px);
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out, transform 0.5s ease, box-shadow 0.5s ease;

    border-radius: 0 0 1em 1em;
}

/* Variaciones */
ul.cards li .variations_form {
    width: 100%;
    box-sizing: border-box;
}

ul.cards li .variations .variation {
    margin-bottom: 0.75em;
}

ul.cards li .variation .label {
    font-weight: bold;
    margin-bottom: 0.25em;
    display: block;
}


ul.cards li:not(.product-separator):hover {
    z-index: 10;
    box-shadow: 4px 4px 0px 0 #bdb8af;
    transform: translate(-2px, -2px);
}

ul.cards li:hover .custom-post_content,
ul.cards li:hover .product_content {
    max-height: 670px;
    padding: 1em;
    opacity: 1;
    visibility: visible;
    box-shadow: 4px 4px 0 0 #bdb8af;
    transform: translate(0px, -2px);
}

/* Animaciones Filtro AJAX */
ul.cards li {
    transition: background-color 0.5s ease, opacity 0.5s ease;
}

ul.cards li>* {
    transition: opacity 0.5s ease;
}

ul.cards li.anim-out {
    background-color: var(--background-middle, #f0f0f0);
    opacity: 0.5;
}

ul.cards li.anim-out>* {
    opacity: 0;
}

ul.cards li .price {
    display: block;
    font-weight: 400;
    margin-bottom: .5em;
    font-size: .857em;
}


.small-cards ul.cards {
    grid-template-columns: repeat(auto-fit, minmax(280px, 0.5fr));
    gap: 1em;
    margin: 0 !important;
}

.small-cards ul.cards.columns-3 {
    grid-template-columns: repeat(auto-fit, minmax(387px, 0.3fr));
}

.small-cards ul.cards.columns-5 {
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}

.small-cards ul.cards li {
    display: flex !important;
    flex-wrap: wrap;
    margin-right: 0 !important;
    border-radius: 1em;
    align-items: stretch;
    width: auto !important;
}

.small-cards ul.cards li>* {
    /* width: auto; */
}

.small-cards ul.cards li:last-child {
    margin-bottom: 0;
}

.small-cards ul.cards li .head {
    display: flex;
    padding: 0.5em;
    border-radius: 0.75em;
    align-items: stretch;
}

.small-cards ul.cards li .image,
.small-cards ul.cards li .product-image {
    margin: 0;
    width: auto;
}

.small-cards ul.cards li .image_box {
    width: 94px;
}

.small-cards ul.cards.columns-5 li .image_box {
    width: 86px;
}

.small-cards ul.cards.columns-4 li .image_box {
    width: 112px;
}

.small-cards ul.cards li .image_box::before {
    /* Mantener por si se usa en otro contexto */
    border-radius: 50% 0 0 50%;
    background-color: #fbf9f6;
}

.small-cards ul.cards li .image_box::after {
    /* Mantener por si se usa en otro contexto */
    background-color: #fbf9f6;
    width: calc(100% - 0.6em);
    height: calc(100% - 0.6em);
    left: 0.3em;
    top: 0.3em;
}

.small-cards ul.cards li .cropper {
    /* Mantener por si se usa en otro contexto */
    width: calc(100% - 0.75em);
    height: calc(100% - 0.75em);
}


.small-cards ul.cards li .custom-post-info,
.small-cards ul.cards li .product-info {
    display: flex;
    position: relative;
    flex-direction: column;
    width: 100%;
    justify-content: flex-start;
    min-height: 80px;
}

.small-cards ul.cards li .woocommerce-loop-product__title {
    margin: 0.25em 0 0 0 !important;
    font-size: 1em !important;
}

.small-cards ul.cards.columns-5 li .woocommerce-loop-product__title,
.small-cards ul.cards.columns-5 li .price {
    font-size: 0.8em !important;
}

.small-cards ul.cards li .price {
    margin: 0;
}

.small-cards ul.cards li .woocommerce-Price-amount {
    /* Mantener por si se usa en otro contexto */
    margin-left: 0;
}


.small-cards ul.cards li .custom-post_content {
    margin: 0;
    width: 100%;
}

.small-cards ul.cards li .custom-post_content a.button {
    margin: 0.5em auto;
    padding: 0.35em 0.75em !important;
    width: calc(100% - 1em);
}

.small-cards ul.cards li .foot {
    position: absolute;
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    padding: 0;
    bottom: 0.5em;
    right: 0.5em;
}


.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em !important;
    margin-top: 2em !important;
    gap: 2em;
    flex-wrap: wrap;
}

.products-header h2 {
    margin-bottom: 0;
}

.products-header .woocommerce-products-header__title,
.products-header .page-title {}

.products-header .result-count {
    display: contents;
    font-size: 0.8em;
    color: var(--front-middle);
    font-weight: 200;
}


.circle-container,
.semicircle-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 5px;
    margin: 0 0 0 auto;
}

.semicircle {
    width: 14px;
    height: 14px;
    border-radius: 1em;
    border-width: 2px;
    border-style: solid;
    overflow: hidden;
    position: relative;
}

.semicircle.sun {
    border-color: var(--sun);
}

.semicircle.moon {
    border-color: var(--moon);
}

.semicircle.property {
    border-color: var(--property);
}

.semicircle.nutrition {
    border-color: var(--nutrition);
}


.semicircle.moon::before,
.semicircle.moon::after {
    background-color: var(--moon);
}

.semicircle.moon.sembrar.plantar,
.semicircle.moon.cosechar.plantar,
.semicircle.moon.cosechar.plantar.cosechar {
    background-color: var(--moon);
}

/* Estilos para móviles */
@media (max-width: 768px) {
    .products-header {
        gap: 1em;
    }

    ul.cards {
        grid-template-columns: repeat(auto-fit, minmax(125px, 0.5fr));
        gap: 1em;
    }

    .small-cards ul.cards.columns-3,
    .small-cards ul.cards.columns-4 {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}