/*
 Theme Name:   Cirkadian Divi Child
 Theme URI:    https://cirkadian.com
 Description:  Tema hijo de Divi para Cirkadian - Compatible con Divi Visual Builder
 Author:       Cirkadian
 Template:     Divi
 Version:      2.0.0
 License:      GNU General Public License v2 or later
*/

/* ============================================
   1. COLORES DEL MENU PRINCIPAL
   ============================================ */

/* Color normal: NEGRO */
#top-menu li a,
.et-menu > li > a,
#et-secondary-menu li a {
    color: #000000 !important;
    transition: color 0.3s ease !important;
}

/* Hover: GRIS OSCURO */
#top-menu li a:hover,
.et-menu > li > a:hover,
#et-secondary-menu li a:hover {
    color: #666666 !important;
}

/* Click / Activo / Current: GRIS CLARO */
#top-menu li.current-menu-item > a,
#top-menu li.current_page_item > a,
.et-menu > li.current-menu-item > a,
#top-menu li a:active,
.et-menu > li > a:active {
    color: #aaaaaa !important;
}

/* Submenu tambien */
#top-menu li li a,
.nav li ul li a {
    color: #000000 !important;
}

#top-menu li li a:hover,
.nav li ul li a:hover {
    color: #666666 !important;
}

/* ============================================
   2. FOOTER - SIEMPRE AL FINAL
   ============================================ */

html, body, #page-container {
    height: auto !important;
    min-height: 100vh;
}

#page-container {
    display: flex;
    flex-direction: column;
}

#main-content {
    flex: 1 0 auto;
    min-height: 70vh;
}

#main-footer,
#footer-bottom {
    flex-shrink: 0;
    clear: both;
    position: relative;
}

/* Ocultar "La Atalaya" del footer */
#main-footer a[href*="atalaya"],
#footer-bottom a[href*="atalaya"],
#main-footer:has-text("La Atalaya") {
    display: none !important;
}

/* ============================================
   3. TIENDA - GRID LIMPIO (Compatible con Divi Shop Module)
   ============================================ */

/* Fondo blanco en toda la tienda */
.woocommerce-page #main-content,
.post-type-archive-product #main-content,
body.woocommerce-shop #main-content {
    background-color: #ffffff !important;
}

/* Sidebar oculta en tienda */
.woocommerce-page #sidebar,
.post-type-archive-product #sidebar {
    display: none !important;
}

.woocommerce-page #left-area,
.post-type-archive-product #left-area {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
}

/* Contenedor principal centrado */
.cirkadian-shop-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 40px 80px;
    background: #ffffff;
}

/* Grid de productos */
.cirkadian-shop-wrap ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cirkadian-shop-wrap ul.products::before,
.cirkadian-shop-wrap ul.products::after {
    display: none !important;
}

/* Item individual */
.cirkadian-shop-wrap ul.products li.product {
    background: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 15px !important;
    width: 100% !important;
    float: none !important;
    clear: none !important;
    text-align: center !important;
    transition: all 0.3s ease;
}

.cirkadian-shop-wrap ul.products li.product:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.06) !important;
    transform: translateY(-4px);
}

/* Imagen del producto */
.cirkadian-shop-wrap ul.products li.product a img {
    width: 100% !important;
    height: auto !important;
    max-height: 400px !important;
    object-fit: contain !important;
    background: #ffffff !important;
    margin-bottom: 15px !important;
    transition: transform 0.4s ease;
}

.cirkadian-shop-wrap ul.products li.product:hover a img {
    transform: scale(1.03);
}

/* Titulo */
.cirkadian-shop-wrap ul.products li.product h2,
.cirkadian-shop-wrap ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
    transition: color 0.3s ease;
}

.cirkadian-shop-wrap ul.products li.product:hover h2 {
    color: #7CB342 !important;
}

/* Precio */
.cirkadian-shop-wrap ul.products li.product .price {
    font-size: 14px !important;
    color: #7CB342 !important;
    margin-bottom: 12px !important;
    display: block !important;
}

.cirkadian-shop-wrap ul.products li.product .price del {
    color: #999999 !important;
    font-size: 12px !important;
}

.cirkadian-shop-wrap ul.products li.product .price ins {
    text-decoration: none !important;
    color: #7CB342 !important;
    font-weight: 600 !important;
}

/* Boton Anadir al carrito */
.cirkadian-shop-wrap ul.products li.product a.button,
.cirkadian-shop-wrap ul.products li.product .add_to_cart_button {
    display: inline-block !important;
    background-color: #7CB342 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-radius: 0 !important;
    padding: 10px 24px !important;
    border: none !important;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease !important;
}

.cirkadian-shop-wrap ul.products li.product:hover a.button,
.cirkadian-shop-wrap ul.products li.product:hover .add_to_cart_button {
    opacity: 1;
    transform: translateY(0);
}

.cirkadian-shop-wrap ul.products li.product a.button:hover {
    background-color: #689F38 !important;
}

/* Badge "Oferta" */
.cirkadian-shop-wrap ul.products li.product span.onsale {
    background: #7CB342 !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 5px 12px !important;
    border-radius: 0 !important;
    top: 10px !important;
    left: 10px !important;
}

/* ============================================
   4. PAGINA DE PRODUCTO INDIVIDUAL
   ============================================ */

.cirkadian-single-product-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
}

.cirkadian-single-product-wrap .product_title {
    font-size: 28px;
    font-weight: 600;
    color: #333333;
}

.cirkadian-single-product-wrap .price {
    font-size: 22px;
    color: #7CB342 !important;
}

.cirkadian-single-product-wrap .single_add_to_cart_button {
    background-color: #7CB342 !important;
    color: #ffffff !important;
    border-radius: 0 !important;
    padding: 16px 50px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    border: none !important;
}

.cirkadian-single-product-wrap .single_add_to_cart_button:hover {
    background-color: #689F38 !important;
}

.cirkadian-single-product-wrap .woocommerce-tabs ul.tabs {
    border-bottom: 2px solid #f0f0f0;
}

.cirkadian-single-product-wrap .woocommerce-tabs ul.tabs li a {
    color: #999999;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cirkadian-single-product-wrap .woocommerce-tabs ul.tabs li.active a {
    color: #333333 !important;
    border-bottom: 2px solid #7CB342;
}

/* ============================================
   5. CARRITO Y CHECKOUT
   ============================================ */

.woocommerce-cart .checkout-button,
#place_order {
    background: #7CB342 !important;
    color: #ffffff !important;
    border-radius: 0 !important;
    padding: 18px 50px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    border: none !important;
}

.woocommerce-cart .checkout-button:hover,
#place_order:hover {
    background: #689F38 !important;
}

/* ============================================
   6. RESPONSIVE TIENDA
   ============================================ */

@media (max-width: 1100px) {
    .cirkadian-shop-wrap ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .cirkadian-shop-wrap {
        padding: 20px 20px 60px;
    }
    
    .cirkadian-shop-wrap ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .cirkadian-shop-wrap ul.products li.product a.button {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   7. PAGINA PROYECTOS - MODO OSCURO
   ============================================ */

.page-template-page-proyectos {
    background: #000000 !important;
}

.page-template-page-proyectos #main-content {
    background: #000000 !important;
}

/* Header oscuro en proyectos */
.page-template-page-proyectos #main-header,
.page-template-page-proyectos .et_nav_text_color_dark #main-header,
.page-template-page-proyectos #top-header {
    background-color: rgba(0,0,0,0.9) !important;
    backdrop-filter: blur(10px);
}

.page-template-page-proyectos #top-menu li a,
.page-template-page-proyectos .et-menu > li > a {
    color: #ffffff !important;
}

.page-template-page-proyectos #top-menu li a:hover {
    color: #7CB342 !important;
}

.page-template-page-proyectos #top-menu li.current-menu-item > a {
    color: #aaaaaa !important;
}

/* Logo en modo oscuro */
.page-template-page-proyectos #logo {
    filter: brightness(0) invert(1);
}

/* Footer oscuro en proyectos */
.page-template-page-proyectos #main-footer {
    background: #000000 !important;
    border-top: 1px solid rgba(124,179,66,0.2) !important;
}

.page-template-page-proyectos #footer-bottom {
    background: #111111 !important;
}

/* ============================================
   8. CONSTELACION - CONTENEDOR
   ============================================ */

.cirkadian-constellation-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000000;
    overflow: hidden;
}

#constellation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#constellation-canvas:active {
    cursor: grabbing;
}

/* Nodo central */
.constellation-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
}

.constellation-center-box {
    width: 200px;
    height: 200px;
    border: 2px solid #7CB342;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    animation: centerPulse 3s ease-in-out infinite;
}

.constellation-center-box::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid rgba(124,179,66,0.3);
}

.constellation-center-box::after {
    content: '';
    position: absolute;
    inset: -18px;
    border: 1px solid rgba(124,179,66,0.1);
}

.constellation-center-text {
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: lowercase;
}

.constellation-center-sub {
    color: #7CB342;
    font-size: 10px;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-top: 8px;
}

@keyframes centerPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(124,179,66,0.15); }
    50% { box-shadow: 0 0 50px rgba(124,179,66,0.3); }
}

/* Filtros */
.constellation-filters {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 10px;
}

.constellation-filters button {
    color: rgba(255,255,255,0.5);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: lowercase;
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.constellation-filters button:hover,
.constellation-filters button.active {
    color: #7CB342;
    border-color: rgba(124,179,66,0.4);
    background: rgba(124,179,66,0.08);
}

/* Modal del proyecto */
.project-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.project-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.project-modal {
    background: #111111;
    border: 1px solid rgba(124,179,66,0.3);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s ease;
}

.project-modal-overlay.active .project-modal {
    transform: translateY(0) scale(1);
}

.project-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.project-modal-close:hover {
    border-color: #7CB342;
    color: #7CB342;
}

.project-modal-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    background: #1a1a1a;
}

.project-modal-content {
    padding: 35px 40px;
}

.project-modal-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: lowercase;
}

.project-modal-type {
    color: #7CB342;
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.project-modal-desc {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 25px;
}

.project-modal-link {
    display: inline-block;
    color: #7CB342;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 30px;
    border: 1px solid #7CB342;
    transition: all 0.3s ease;
}

.project-modal-link:hover {
    background: #7CB342;
    color: #000000;
}

/* Info de hover */
.project-hover-info {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    z-index: 20;
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.project-hover-info.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.project-hover-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.project-hover-type {
    color: #7CB342;
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ============================================
   9. OCULTAR ELEMENTOS NO DESEADOS
   ============================================ */

/* Ocultar La Atalaya del footer */
#main-footer a[href*="atalaya"],
#footer-bottom a[href*="atalaya"] {
    display: none !important;
}

/* Ocultar titulo de pagina de tienda */
.woocommerce-products-header__title {
    display: none;
}

/* ============================================
   10. MENSAJES WOOCOMMERCE
   ============================================ */

.woocommerce-message {
    background: #f0f8e8 !important;
    color: #4a7c23 !important;
    border-left: 4px solid #7CB342 !important;
    border-radius: 0 !important;
}

/* ============================================
   11. MISC
   ============================================ */

.woocommerce-pagination .page-numbers a:hover {
    background: #f5f5f5;
}

.woocommerce-pagination .page-numbers span.current {
    background: #333333;
    color: #ffffff;
}
