/*!
Theme Name: Divi Child
Theme URI: https://andreasuarez.es
Version: 1.00.0
Description: Tema hijo de Divi para personalizaciones de la web de Andrea Suárez.
Author: Elegant Themes
Author URI: https://andreasuarez.es
Template: Divi
License: GNU General Public License v2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ================================
   Personalizaciones Andrea Suárez
   ================================ */

/* ✅ Ocultar la tabla de variaciones SOLO en el producto con ID 9385 (talleres) */
body.postid-9385 .variations_form .variations {
  display: none !important;
}

/* Contenedor del calendario */
#custom-calendar-container {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 350px;
  margin-bottom: 20px;

  /* centrado en escritorio y móvil */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Input del calendario */
#custom-date {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.3s;
}
#custom-date:focus {
  border-color: #ff5a5f; /* color destacado tipo Fever */
  outline: none;
}

/* Select de horario */
#custom-time {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  cursor: pointer;
  transition: border-color 0.3s;
}
#custom-time:focus {
  border-color: #ff5a5f;
  outline: none;
}

/* Ajuste para el desplegable de horas */
#custom-time-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

/* Estilos Flatpickr calendario */
.flatpickr-calendar {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-family: inherit;

  /* centrado también en escritorio */
  left: 50% !important;
  transform: translateX(-50%) !important;
  right: auto !important;
  margin: 0 auto;
}
.flatpickr-day.selected {
  background: #ff5a5f;
  border-color: #ff5a5f;
  color: #fff;
}
.flatpickr-day:hover {
  background: #ffe5e6;
  border-color: #ff5a5f;
  color: #000;
}
.flatpickr-months .flatpickr-month {
  font-size: 16px;
  font-weight: bold;
}
.flatpickr-weekdays {
  font-size: 14px;
  font-weight: 500;
}

/* Ajustar el contenedor del calendario en móviles */
@media (max-width: 768px) {
  .flatpickr-calendar {
    width: 95% !important;
    min-width: 320px !important;
    max-width: 400px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    box-sizing: border-box;
  }

  .flatpickr-days,
  .dayContainer {
    max-width: 100% !important;
    min-width: unset !important;
  }

  .flatpickr-months {
    padding: 0 8px !important;
  }

  .flatpickr-month {
    font-size: 16px !important;
  }

  .flatpickr-weekday {
    font-size: 13px !important;
  }
}

/* Mostrar siempre el nombre del producto en el carrito en móvil */
@media (max-width: 768px) {
  table.shop_table.cart td.product-name,
  table.shop_table.cart th.product-name {
    display: table-cell !important;
  }

  table.shop_table.cart td.product-name {
    text-align: left;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 4px;
    white-space: normal !important;
  }
}


/* Ocultar el título dentro de la pestaña de WooCommerce */
.et_pb_tab_content h2 {
    display: none !important;
}



/* Personalización de pestañas WooCommerce */
.woocommerce-tabs ul.tabs {
  border: none;
  background: none;
  display: flex;
  gap: 20px;
}

.woocommerce-tabs ul.tabs li {
  border: none;
  background: none;
  padding: 10px 0;
}

.woocommerce-tabs ul.tabs li.active {
  border-bottom: 2px solid black;
  font-weight: bold;
}


/* Oculta las miniaturas de la galería de producto en WooCommerce */
.woocommerce-product-gallery .flex-control-thumbs {
    display: none !important;
}





.variations_form .variations select {
  appearance: none; /* quita la flecha nativa */
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fff url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat calc(100% - 12px) center/16px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 40px 10px 12px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  max-width: 250px; /* ajusta el ancho */
}

.variations_form .variations select:hover {
  border-color: #999;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.variations_form .variations select:focus {
  outline: none;
  border-color: #000; /* color destacado */
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}


/* Eliminar color de fondo de todas las filas en móviles en la pestaña de Información adicional */
@media screen and (max-width: 768px) {
  .woocommerce-product-attributes tr {
    background-color: transparent !important;
  }
}


/* Carrusel producto */
@media screen and (max-width: 768px) {

.galeria-carrusel.swiper {
    position: relative;
    padding: 2rem 0;
}

.galeria-carrusel .et_pb_gallery_items {
    display: flex;
}

.galeria-carrusel .et_pb_gallery_item {
    width: auto !important;
    margin: 0 !important;
}

.swiper-button-prev,
.swiper-button-next {
    color: black;
    top: 40%;
    z-index: 10;
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 24px;
}
}

/* Carrusel producto acercar numeración a imágenes*/
@media (min-width: 981px) {
  /* Quita espacio inferior de la galería */
  .et_pb_gallery .et_pb_gallery_items {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* También asegúrate de que los elementos individuales no estén dejando margen */
  .et_pb_gallery_item {
    margin-bottom: 0 !important;
  }

  /* Y ajusta la paginación por si acaso */
  .et_pb_gallery_pagination {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Elimina posible separación desde la fila o wrapper */
  .et_pb_module.et_pb_gallery {
    margin-bottom: 0 !important;
  }
}


/* =========================================
   BLOG CAROUSEL – 3 items visibles (Divi)
   Requiere agregar clase "posts-carousel" al módulo Blog
   ========================================= */

/* Contenedor horizontal con snapping */
.posts-carousel .et_pb_posts,
.posts-carousel .et_pb_blog_grid,
.posts-carousel .et_pb_ajax_pagination_container,
.posts-carousel .et_pb_salvattore_content {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 6px;
}

/* Normalizar columnas internas del grid de Divi (salvattore) */
.posts-carousel .et_pb_salvattore_content .column {
  display: contents;
}

/* Cada artículo ocupa 1/3 */
.posts-carousel article.et_pb_post {
  flex: 0 0 calc(33.333% - 16px);
  scroll-snap-align: start;
  min-width: 0; /* evita desbordes por títulos largos */
}

/* Imagen a ancho completo dentro de la tarjeta */
.posts-carousel .entry-featured-image-url,
.posts-carousel .et_pb_image_container {
  width: 100%;
}

/* Ocultar la barra de scroll (opcional) */
.posts-carousel .et_pb_posts::-webkit-scrollbar { display: none; }
.posts-carousel .et_pb_posts { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== Navegación (flechas) ===== */
.pcarousel-nav {
  position: relative;
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 12px;
}
.pcarousel-btn {
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  border-radius: 8px;
  transition: opacity .2s ease;
}

/* Responsive: 2 cards en tablet, 1 en móvil */
@media (max-width: 980px) {
  .posts-carousel article.et_pb_post { flex: 0 0 calc(50% - 14px); }
}
@media (max-width: 600px) {
  .posts-carousel article.et_pb_post { flex: 0 0 100%; }
}


