/*
 * Archivo custom-carousel-styles.css
 * Estilos personalizados para el carrusel de productos de WooCommerce
 * y elementos dentro de las tarjetas de producto.
 */

/* =======================================
    Estilos base del contenedor del carrusel Swiper
    ======================================= */
.divi-woocommerce-product-carousel {
    width: 100%;
    padding: 20px 0;
}

/* =======================================
    Estilos de las tarjetas de producto (swiper-slide)
    ======================================= */
.divi-woocommerce-product-carousel .swiper-slide.product-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 15px; /* Added consistent padding to the card*/
    text-align: center;
    display: flex;
    flex-direction: column;
    /* Removed justify-content: space-between; to allow consistent vertical alignment*/
    height: auto; /* Allow height to adjust based on content*/
    overflow: hidden;
    position: relative;
}

/* Contenedor de la imagen y la etiqueta superior */
.divi-woocommerce-product-carousel .product-card .product-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    line-height: 0;
}

.divi-woocommerce-product-carousel .product-card .product-image-link {
    display: block;
    height: auto;
    max-height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.divi-woocommerce-product-carousel .product-card .product-image-link img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    object-fit: contain;
}

/* =======================================
    Estilos de los elementos de la tarjeta (AJUSTADOS PARA ALINEACIÓN)
    ======================================= */

.divi-woocommerce-product-carousel .product-card .product-title {
    font-size: 16px;
    margin-top: 0; /* Remove top margin, handled by card padding*/
    margin-bottom: 10px; /* Consistent spacing below title*/
    min-height: 2.6em; /* Example: Ensure at least two lines for titles if they wrap*/
    display: flex; /* Use flex to vertically center title text if it's one line*/
    align-items: center; /* Center text vertically within min-height*/
    justify-content: center; /* Center text horizontally*/
}

.divi-woocommerce-product-carousel .product-card .product-title a {
    color: #333;
    text-decoration: none;
}

.divi-woocommerce-product-carousel .product-card .product-title a:hover {
    color: #0073e6;
}

.divi-woocommerce-product-carousel .product-card .price {
    font-size: 1.2em;
    color: #333;
    margin-top: 10px; /* Consistent spacing above price*/
    margin-bottom: 10px; /* Consistent spacing below price*/
}

/* Estilos para la descripción corta del producto */
.divi-woocommerce-product-carousel .product-card .product-short-description {
    font-size: 0.9em;
    color: #666;
    margin-top: 0; /* Remove specific top margin, handled by price margin-bottom or card padding*/
    margin-bottom: 15px; /* Spacing before the button*/
    line-height: 1.4;
    overflow: hidden;
    max-height: 9.2em; /* Limita a unas 3 líneas (ajusta según tu font-size y line-height) */
    text-overflow: ellipsis;
    flex-grow: 1; /* This is key: makes the description element fill available vertical space*/
    display: flex; /* Use flex to vertically align content if it doesn't fill max-height*/
    align-items: flex-start; /* Aligns text to the top within its flex item*/
    justify-content: center; /* Center text horizontally*/
    text-align: center; /* Ensure text itself is centered*/
}


.divi-woocommerce-product-carousel .product-card .button.info-popup-button {
    display: inline-block;
    background-color: #FCC116;
    color: #301A06;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    margin-top: auto; /* Will push the button to the bottom if there's extra space, good for consistency */
    transition: background-color 0.3s ease, color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.divi-woocommerce-product-carousel .product-card .button.info-popup-button:hover {
    background-color: #e0ac00;
    color: #fff;
}

/* =======================================
    Estilos de las etiquetas destacadas (highlight-tag)
    ======================================= */

/* Estilos base de la etiqueta destacada (comunes para top y bottom) */
.divi-woocommerce-product-carousel .product-card .highlight-tag {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* Estilos específicos para la etiqueta TOP (como "Más pedido") */
.divi-woocommerce-product-carousel .product-card .highlight-tag-top {
    top: 10px;
}

/* Estilos específicos para la etiqueta BOTTOM (como "Únicamente para llevar") */
.divi-woocommerce-product-carousel .product-card .highlight-tag-bottom {
    bottom: 10px;
    width: calc(100% - 10px);
    text-align: center;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 1em;
}

/* Estilos para la etiqueta "Más pedido" (basado en highlight-tag-mas-pedido) */
.divi-woocommerce-product-carousel .product-card .highlight-tag-mas-pedido {
    background-color: #5D262F;
    color:#FFD700;
    padding:10px;
}

/* Estilo para el icono de estrella dentro de "Más pedido" */
.divi-woocommerce-product-carousel .product-card .highlight-tag-mas-pedido .star-icon {
    font-size: 1.2em;
    color: #FFD700;
    line-height: 1;
}

/* Estilos para la etiqueta "Únicamente para llevar" (basado en highlight-tag-para-llevar) */
.divi-woocommerce-product-carousel .product-card .highlight-tag-para-llevar {
    background-color: #5D262F;
    color: #FFD700;
}

.divi-woocommerce-product-carousel .product-card .highlight-tag-nuevo {
 background-color: #5D262F;
    color: #FFD700;
}


/* =======================================
    Estilos de los botones de navegación Swiper (flechas)
    ======================================= */
.divi-woocommerce-product-carousel .swiper-button-next,
.divi-woocommerce-product-carousel .swiper-button-prev {
    color: #333;
}

/* =======================================
    Estilos de la paginación Swiper (puntos)
    ======================================= */
.divi-woocommerce-product-carousel .swiper-pagination-bullet {
    background-color: #ccc;
    opacity: 1;
}

.divi-woocommerce-product-carousel .swiper-pagination-bullet-active {
    background-color: #f7a700;
}

/* =======================================
    Estilos del Pop-up de Información del Producto
    ======================================= */

/* Overlay oscuro de fondo */
.product-info-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none !important;
    justify-content: center;
    align-items: center;
    z-index: 9999999;
    opacity: 0;
    /*visibility: hidden;*/
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.product-info-popup-overlay.active {
    opacity: 1;
    /*visibility: visible;*/
    display: flex !important; 
}

/* Caja de contenido del pop-up */
.product-info-popup-content {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    position: relative;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-info-popup-overlay.active .product-info-popup-content {
    transform: translateY(0);
}

/* Botón de cerrar (X) */
.product-info-popup-content .close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    color: #333;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.product-info-popup-content .close-popup:hover {
    color: #FCC116;
}

/* Contenido del pop-up */
.product-info-popup-content .popup-header {
    text-align: center;
    margin-bottom: 20px;
}

.product-info-popup-content .popup-product-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px auto;
    display: block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.product-info-popup-content .popup-product-title {
    font-size: 1.8em;
    color: #301A06;
    margin-bottom: 5px;
    line-height: 1.2;
}

.product-info-popup-content .popup-product-price {
    font-size: 1.5em;
    color: #301A06;
    font-weight: bold;
    margin-bottom: 15px;
}

.product-info-popup-content .popup-body {
    flex-grow: 1;
    margin-bottom: 20px;
}

.product-info-popup-content .popup-product-long-description {
    font-size: 1em;
    color: #555;
    line-height: 1.6;
    text-align: left;
}

/* Asegurar que las etiquetas HTML dentro de la descripción se vean bien */
.product-info-popup-content .popup-product-long-description p {
    margin-bottom: 1em;
}
.product-info-popup-content .popup-product-long-description ul,
.product-info-popup-content .popup-product-long-description ol {
    margin-left: 20px;
    margin-bottom: 1em;
}

.product-info-popup-content .popup-footer {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.product-info-popup-content .popup-view-product-button {
    display: inline-block;
    background-color: #301A06;
    color: #FFFFFF;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.product-info-popup-content .popup-view-product-button:hover {
    background-color: #4A2B14;
}

/* Deshabilitar scroll del body cuando el pop-up está activo */
body.no-scroll {
    overflow: hidden;
}

/* Responsive para el pop-up */
@media (max-width: 767px) {
    .product-info-popup-content {
        padding: 15px;
        width: 95%;
    }
    .product-info-popup-content .popup-product-image {
        width: 120px;
        height: 120px;
    }
    .product-info-popup-content .popup-product-title {
        font-size: 1.5em;
    }
    .product-info-popup-content .popup-product-price {
        font-size: 1.2em;
    }
    .product-info-popup-content .close-popup {
        font-size: 1.8em;
        top: 5px;
        right: 10px;
    }
}
/**********************************/
/* =======================================
   Estilos para el Grid de Productos
   (Manteniendo todos los estilos de cards del carrusel)
   ======================================= */
.divi-woocommerce-product-grid {
    display: grid;
    gap: 10px;
    width: 100%;
    padding: 20px 0;
}

/* Columnas responsivas - Desktop */
.grid-columns-desktop-1 { grid-template-columns: repeat(1, 1fr); }
.grid-columns-desktop-2 { grid-template-columns: repeat(2, 1fr); }
.grid-columns-desktop-3 { grid-template-columns: repeat(3, 1fr); }
.grid-columns-desktop-4 { grid-template-columns: repeat(4, 1fr); }
.grid-columns-desktop-5 { grid-template-columns: repeat(5, 1fr); }
.grid-columns-desktop-6 { grid-template-columns: repeat(6, 1fr); }

/* Media queries para Tablet */
@media (max-width: 1199px) {
    .grid-columns-tablet-1 { grid-template-columns: repeat(1, 1fr); }
    .grid-columns-tablet-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-columns-tablet-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-columns-tablet-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Media queries para Mobile */
@media (max-width: 767px) {
    .grid-columns-mobile-1 { grid-template-columns: repeat(1, 1fr); }
    .grid-columns-mobile-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-columns-mobile-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Media queries para Mobile Small */
@media (max-width: 575px) {
    .grid-columns-mobile-small-1 { grid-template-columns: repeat(1, 1fr); }
    .grid-columns-mobile-small-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-columns-mobile-small-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Ajustar estilos de las tarjetas para grid */
.divi-woocommerce-product-grid .product-card {
    margin-bottom: 0; /* Eliminar margen inferior ya que el gap del grid lo maneja */
    height: 100%; /* Asegurar que todas las cards tengan la misma altura */
    box-sizing: border-box; /* Incluir padding en el cálculo de dimensiones */
}

/* Asegurar consistencia en la altura de los elementos */
.divi-woocommerce-product-grid .product-card .product-title {
    min-height: 3.2em; /* Ajustar para grid */
}

.divi-woocommerce-product-grid .product-card .product-short-description {
    max-height: 6.9em; /* Ajustar para grid */
}

/* =======================================
    Estilos de las etiquetas destacadas (highlight-tag)
    ======================================= */

/* Estilos base de la etiqueta destacada (comunes para top y bottom) */
.divi-woocommerce-product-grid .product-card .highlight-tag {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* Estilos específicos para la etiqueta TOP (como "Más pedido") */
.divi-woocommerce-product-grid .product-card .highlight-tag-top {
    top: 10px;
}

/* Estilos específicos para la etiqueta BOTTOM (como "Únicamente para llevar") */
.divi-woocommerce-product-grid .product-card .highlight-tag-bottom {
    bottom: 10px;
    width: calc(100% - 10px);
    text-align: center;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 1em;
}

/* Estilos para la etiqueta "Más pedido" (basado en highlight-tag-mas-pedido) */
.divi-woocommerce-product-grid .product-card .highlight-tag-mas-pedido {
    background-color: #5D262F;
    color:#FFD700;
    padding:10px;
}

/* Estilo para el icono de estrella dentro de "Más pedido" */
.divi-woocommerce-product-grid .product-card .highlight-tag-mas-pedido .star-icon {
    font-size: 1.2em;
    color: #FFD700;
    line-height: 1;
}

/* Estilos para la etiqueta "Únicamente para llevar" (basado en highlight-tag-para-llevar) */
.divi-woocommerce-product-grid .product-card .highlight-tag-para-llevar {
    background-color: #5D262F;
    color: #FFD700;
}

.divi-woocommerce-product-grid .product-card .highlight-tag-nuevo {
 background-color: #5D262F;
    color: #FFD700;
}


