/*
Theme Name: Piscinas Fibra
Author: Javier
Description: Tema personalizado para venta de piscinas de fibra de vidrio, preparado para WooCommerce + Transbank.
Version: 1.2
License: GNU General Public License v2 or later
Text Domain: piscinas-fibra
*/

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2933;
    background-color: #f5f7fa;
}

a {
    color: #0ea5e9;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

header,
footer {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-header {
    padding: 16px 0;
}

.site-branding a {
    font-weight: 700;
    font-size: 20px;
    color: #0b7285;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 16px;
}

.main-navigation a {
    font-weight: 500;
    color: #1f2933;
}

.hero {
    position: relative;
    padding: 100px 0;
    color: #ffffff;
    text-align: left;
    background-size: cover;
    background-position: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        rgba(15, 118, 178, 0.8),
        rgba(6, 182, 212, 0.7)
    );
}

.hero.hero-slider::before {
    display: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 40px;
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #0ea5e9;
    color: #ffffff;
}

.btn-secondary {
    background-color: #ffffff;
    color: #0ea5e9;
}

.btn-home {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background-color: #ffffff;
    color: #0ea5e9;
}

.section {
    padding: 60px 0;
    background-color: #f5f7fa;
}

.section.alt {
    background-color: #ffffff;
}

.section-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 24px;
}

.section-subtitle {
    text-align: center;
    font-size: 16px;
    color: #4b5563;
    max-width: 720px;
    margin: 0 auto 32px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: 24px;
}

.card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.08);
}

.card img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 12px;
}

.card h3 {
    margin: 8px 0;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 999px;
    background-color: #e0f2fe;
    color: #0369a1;
    margin-right: 4px;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 20px;
}

.process-step-number {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0ea5e9;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 700;
}

.faq-item {
    margin-bottom: 12px;
}

.faq-question {
    font-weight: 600;
}

.faq-answer {
    font-size: 14px;
    color: #4b5563;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 16px;
}

input[type="text"],
input[type="email"],
input[type="tel"],


textarea {
    min-height: 120px;
}

.site-footer {
    padding: 32px 0;
    font-size: 14px;
    color: #6b7280;
}

.site-footer .footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 24px;
}

.header-social {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.header-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background-color: #e0f2fe;
    color: #0369a1;
}

.header-social svg {
    width: 14px;
    height: 14px;
}


/* === Paleta general azul para botones y WooCommerce === */

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.single-product-page .button {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 999px;
    background-color: #0ea5e9;
    color: #ffffff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(14,165,233,0.3);
    transition: all .2s ease;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
    background-color: #0284c7;
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-secondary,
.woocommerce a.button.alt {
    background-color: #e0f2fe;
    color: #0284c7;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: #bae6fd;
}

/* Icono del carrito en header */

.header-cart .cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background-color: #e0f2fe;
    color: #0284c7;
}

.header-cart .cart-icon svg {
    width: 20px;
    height: 20px;
}

.header-cart .cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background-color: #0ea5e9;
    color: #ffffff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* WooCommerce tienda / grid productos */

.woocommerce-breadcrumb {
    font-size: 13px;
    margin-bottom: 16px;
    color: #6b7280;
}

.woocommerce-breadcrumb a {
    color: #0ea5e9;
}

.woocommerce ul.products {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: 24px;
}

.woocommerce ul.products li.product {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.08);
    text-align: left;
    width: 80%;
}

.woocommerce ul.products li.product a img {
    border-radius: 12px;
    margin-bottom: 12px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 18px;
    margin: 8px 0;
}

.woocommerce ul.products li.product .price {
    font-weight: 600;
    color: #0284c7;
    margin-bottom: 8px;
    font-size: 17px;
}

/* Single product layout */

.single-product-page .single-product-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
}

.single-product-page .single-product-gallery {
    flex: 1 1 50%;
    min-width: 280px;
}

.single-product-page .single-product-summary {
    flex: 1 1 40%;
    min-width: 280px;
}

.single-product-page .product_title {
    font-size: 28px;
    margin-bottom: 8px;
}

.single-product-page .price {
    font-size: 22px;
    font-weight: 700;
    color: #0ea5e9;
    margin-bottom: 12px;
}

.single-product-page .woocommerce-product-details__short-description {
    margin-bottom: 16px;
    color: #4b5563;
}

.single-product-page form.cart {
    margin-bottom: 16px;
}

/* Tabs / related */

.single-product-page .single-product-tabs {
    margin-top: 40px;
}

.single-product-page .woocommerce-Tabs-panel {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.06);
}

/* Carrito y checkout básicos */

.woocommerce-cart .section,
.woocommerce-checkout .section {
    padding: 60px 0;
}

.woocommerce-cart table.shop_table,
.woocommerce-checkout table.shop_table {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 5px 15px rgba(15,23,42,.06);
}

.woocommerce-checkout #order_review {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(15,23,42,.06);
}

/* Responsive */

@media (max-width: 768px) {
    .single-product-page .single-product-layout {
        flex-direction: column;
    }

    header .container {
        flex-wrap: wrap;
    }
}


/* === Home video === */
.home-video-wrap{
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.home-video-wrap::before{
    content:"";
    display:block;
    padding-top: 56.25%; /* 16:9 */
}
.home-video-iframe{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:0;
}

/* Eliminar padding del hero para evitar espacios */
.hero{
    padding: 0 !important;
}

.home-video-wrap{
    pointer-events: none;
}

/* === Corrección Ficha de Producto === */

/* Alinear Input Cantidad y Botón Comprar */
.single-product-page form.cart {
    display: flex;
    align-items: center;
    gap: 10px; /* Espacio entre cantidad y botón */
    margin-bottom: 20px;
}

/* Estilo del Input de Cantidad */
.woocommerce .quantity .input-text {
    width: 40px;
    height: 34px; /* Misma altura que el botón */
    padding: 0 5px;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 999px; /* Redondeado igual que los botones */
    font-weight: 600;
    color: #0b7285;
    background-color: #fff;
}

/* Eliminar flechas feas del input number en Chrome/Safari */
.woocommerce .quantity .input-text::-webkit-inner-spin-button, 
.woocommerce .quantity .input-text::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

/* Botón WhatsApp */
.btn-whatsapp {
    background-color: #25D366; /* Verde WhatsApp */
    color: #ffffff !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: transform 0.2s;
}
.btn-whatsapp:hover {
    background-color: #1ebc57;
    transform: translateY(-2px);
    text-decoration: none;
}

/* === CORRECCIÓN GALERÍA DE PRODUCTO WOOCOMMERCE === */

/* Contenedor principal de la galería */
.woocommerce-product-gallery {
    position: relative;
    opacity: 1 !important; /* Asegura que se vea */
    margin-bottom: 30px;
}

/* Imagen Principal (la grande) */
.woocommerce-product-gallery__wrapper {
    margin: 0;
    padding: 0;
}

.woocommerce-product-gallery__image {
    border: 1px solid #e2e8f0; /* Borde sutil gris */
    border-radius: 16px; /* Bordes redondeados modernos */
    overflow: hidden;
    margin-bottom: 15px; /* Espacio antes de las miniaturas */
}

/* Botón de lupa (zoom/lightbox) */
.woocommerce-product-gallery__trigger {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: #0ea5e9;
    font-weight: bold;
    text-decoration: none;
}
.woocommerce-product-gallery__trigger:hover {
    background: #f1f5f9;
}

/* Lista de Miniaturas (Thumbnails) */
.flex-control-nav.flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0 -8px; /* Compensación negativa para el gap */
    list-style: none;
}

.flex-control-nav.flex-control-thumbs li {
    width: 25%; /* Muestra 4 miniaturas por fila */
    padding: 0 8px; /* Espacio entre miniaturas */
    box-sizing: border-box;
    cursor: pointer;
    margin-bottom: 10px;
}

.flex-control-nav.flex-control-thumbs li img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    opacity: 0.6; /* Un poco transparentes si no están seleccionadas */
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

/* Miniatura activa o al pasar el mouse */
.flex-control-nav.flex-control-thumbs li img.flex-active, 
.flex-control-nav.flex-control-thumbs li img:hover {
    opacity: 1;
    border-color: #0ea5e9; /* Borde azul al seleccionar */
}

/* === CORRECCIONES PARA CELULARES (Móvil) === */

@media (max-width: 768px) {

    /* 1. Arreglar Resumen de Producto (Caja de precio/botón) */
    .single-product-page .single-product-summary.entry-summary {
        width: 100% !important;
        min-width: 0 !important; /* Elimina el bloqueo de ancho mínimo */
        flex: 0 0 100% !important;
        margin-top: 20px;
        padding: 15px; /* Reducir un poco el relleno en celular */
        box-sizing: border-box;
    }

    /* 2. Arreglar Grid de Productos (Relacionados y Tienda) */
    /* Forzamos a que se vean en 1 sola columna o 2 como máximo si cabe */
    .woocommerce ul.products,
    .products.columns-3,
    .related.products ul.products {
        display: grid !important;
        /* Cambiamos a 2 columnas pequeñas o 1 si la pantalla es muy angosta */
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important; 
        gap: 15px !important;
    }

    /* 3. Arreglar Galería de Imágenes */
    .single-product-page .single-product-gallery {
        width: 100% !important;
        flex: 0 0 100% !important;
        min-width: 0 !important;
        margin-bottom: 20px;
    }

    /* Ajustar miniaturas para que no se vean diminutas */
    .flex-control-nav.flex-control-thumbs li {
        width: 25% !important; /* 4 fotos por fila en celular */
    }
    
    /* Asegurar que la imagen no se salga de la pantalla */
    .woocommerce-product-gallery__image img {
        width: 100%;
        height: auto;
    }
}

/* === CORRECCIÓN FINAL GRID WOOCOMMERCE === */

/* Eliminar los elementos "fantasma" (clearfix) que empujan los productos */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    content: none !important;
    display: none !important;
}

/* Asegurar que el grid ocupe todo el ancho sin márgenes extraños */
.woocommerce ul.products {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
}


/* === CORRECCIÓN PRODUCTOS RELACIONADOS === */

/* Solo para vista de escritorio (mayores a 1024px) */
@media (min-width: 1024px) {
    /* Forzar grid de 3 columnas para que las tarjetas sean anchas */
    .related.products ul.products {
        display: grid;
        grid-template-columns: repeat(4, 2fr) !important;
        gap: 20px; /* Más espacio entre productos */
    }
    
    /* Asegurar que la imagen ocupe el ancho completo de la tarjeta */
    .related.products ul.products li.product {
        width: 90%; 
    }
}