/* 
    PJ3D Cinematic Prototype - GLOBAL STYLES
    Core, Typography, Nav, Footer, Utilities
*/

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600&family=Unbounded:wght@400;600;800&display=swap');

:root {
    --bg-color: #050505;
    --text-color: #F0F0F0;
    --accent: #FF6A00;
    /* Energy Orange */
    --accent-hover: #FF7F26;
    --pj-text: #F0F0F0;
    --pj-bg: #050505;
    --pj-line: rgba(255, 255, 255, 0.1);
    --pj-surface: #111;
    --glass-panel: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-display: 'Unbounded', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --easing: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* FORCE SCROLLBAR TO PREVENT LAYOUT SHIFT */
    overflow-y: scroll;
}

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    padding-top: 113px;
    /* Standard Header Offset */
    overflow-x: clip;
    /* clip instead of hidden allows position: sticky to work */
    -webkit-font-smoothing: antialiased;
}

/* Specific body padding override for Single Product pages */
body.single-product {
    padding-top: 163px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* TYPOGRAPHY SYSTEM */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: clamp(2rem, 5vw, 6rem);
    margin-bottom: 2rem;
}

/* UTILITIES */
.full-screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.container {
    padding: 0 4vw;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
}

/* TOAST NOTIFICATION */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: white;
    color: black;
    padding: 1rem 2rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    font-family: var(--font-display);
    border: 1px solid var(--accent);
}

/* NAVIGATION */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 4vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    /* Ensure high z-index */
    color: var(--pj-text);
    background: rgba(14, 16, 20, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
    text-decoration: none;
}

.nav-center {
    display: none;
    /* Hidden on mobile */
    gap: 2rem;
}

.nav-link-item {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pj-text);
    transition: color 0.3s ease;
    text-decoration: none;
}

.nav-link-item:hover,
.nav-link-item.active {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Mobile Header Wrap: Search bar goes to a second line explicitly using Grid */
@media (max-width: 1024px) {
    .nav-bar {
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        align-items: center;
        gap: 0.5rem;
        /* Reduced gap */
        padding-top: 0.5rem;
        /* Reduced padding */
        padding-bottom: 0.5rem;
        /* Reduced padding */
    }

    .nav-right {
        display: contents;
        /* Flattens children into the nav-bar grid */
    }

    .site-logo {
        grid-column: 1 / 2;
    }

    /* Target the language switcher if it exists */
    .lang-switcher {
        grid-column: 3 / 4;
        margin-right: 0.5rem;
    }

    .menu-toggle {
        grid-column: 4 / 5;
    }

    .header-right-widget-area {
        grid-column: 1 / -1;
        /* Match full width of the grid */
        margin-top: 0;
    }

    /* Override body padding for the taller mobile header */
    body {
        padding-top: 80px;
        /* Reduced from 140px */
    }

    body.single-product {
        padding-top: 80px;
        /* Reduced from 140px */
    }
}

@media (min-width: 1024px) {
    .nav-center {
        display: flex;
    }

    .menu-trigger {
        display: none !important;
    }
}


/* BUTTONS (Global) */
.btn-border {
    padding: 0.8rem 2rem;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 100px;
    text-transform: uppercase;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.btn-border:hover {
    background: white;
    color: black;
}

.btn-border svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.btn-border:hover svg {
    transform: translateX(5px);
}

.btn-magnetic {
    padding: 1rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-magnetic:hover {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

/* CUSTOM CURSOR */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: white;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body.hovering .cursor-outline {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    backdrop-filter: blur(2px);
}

/* PRELOADER */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: var(--font-display);
    font-size: 2rem;
}

.loader-text {
    overflow: hidden;
}

.loader-text span {
    display: inline-block;
    transform: translateY(100%);
}

/* KINETIC LINK (Footer?) */
.kinetic-link {
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kinetic-link:hover {
    font-weight: 800;
    color: var(--accent);
    transform: scale(1.05);
}

/* CART BADGE (Specific to Global Nav) */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    opacity: 0;
    /* Hidden initially */
    transition: all 0.3s;
}

/* GLOBAL SCROLLBAR (Site-wide Consistency) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: var(--bg-color);
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
    border: 2px solid var(--bg-color);
    /* Creates padding effect */
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* STANDARD FOOTER (Global) */
footer {
    background: var(--pj-bg);
    color: var(--pj-text);
    padding: 4rem 4vw;
    border-top: 1px solid var(--pj-line);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4rem;
}

.footer-cta {
    flex: 1;
    min-width: 300px;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.footer-col h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 0.8rem;
}

.footer-col a {
    color: var(--pj-text);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    footer {
        flex-direction: column;
        gap: 3rem;
    }

    .footer-links {
        width: 100%;
        justify-content: space-between;
    }
}

/* =========================================
   MUST-HAVE UTILITIES & MOBILE NAV
   ========================================= */

/* 1. Truncate Text for Titles */
.text-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    /* Standard Property */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(1.2rem, 5vw, 2.5rem);
    line-height: 1.1;
}

/* 2. Mobile Navigation Styles */
.menu-toggle {
    display: none;
    /* Hidden on Desktop */
    background: none;
    border: none;
    color: var(--pj-text);
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 9999;
    /* Ensure it's above the overlay itself */
    position: relative;
    mix-blend-mode: normal;
    /* Removed difference to ensure it is visible */
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: block;
        /* Show on Mobile/Tablet */
        z-index: 2000;
        /* Ensure button stays strictly above the 1500 overlay */
    }
}

/* Ensure HIDDEN on Desktop */
@media (min-width: 1025px) {
    .menu-toggle {
        display: none !important;
    }
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Changed from center to allow scrolling long menus from the top */
    padding: 100px 4vw 4rem 4vw;
    /* Reduced from 160px to match new header height */
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    overflow-y: auto;
    /* Allow vertical scrolling if menu items exceed screen height */
}

.mobile-nav-overlay.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.mobile-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-link-item {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: var(--pj-text);
    text-decoration: none;
    text-transform: uppercase;
    line-height: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: color 0.3s;
}

.mobile-link-item:hover {
    color: var(--accent);
    -webkit-text-stroke: 1px var(--accent);
}

/* --- EDITORIAL PRODUCT PAGE SPECIFICS --- */
/* Hide injected share buttons and other garbage from hero info col */
.hero-info-col .sharedaddy,
.hero-info-col .jp-relatedposts,
.hero-info-col form.cart,
.hero-info-col .variations_form {
    display: none !important;
}

/* Constrain WooCommerce product gallery so it doesn't push the layout */
.hero-image-col .woocommerce-product-gallery {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.hero-image-col .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
.hero-image-col .woocommerce-product-gallery .woocommerce-product-gallery__image {
    max-height: 75vh;
    height: 75vh;
    overflow: hidden;
    border-radius: 8px;
    display: block;
}

.hero-image-col .woocommerce-product-gallery .woocommerce-product-gallery__image img {
    height: 100% !important;
    width: 100% !important;
    object-fit: contain !important;
    max-height: 75vh !important;
}

@media (max-width: 768px) {

    /* Prevent hero image cropping or excessive heights on layout on mobile */
    .hero-image-col .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
    .hero-image-col .woocommerce-product-gallery .woocommerce-product-gallery__image {
        max-height: 50vh;
    }

    .hero-image-col .woocommerce-product-gallery .woocommerce-product-gallery__image img {
        max-height: 50vh;
        width: 100%;
        object-fit: contain;
    }
}

.hero-image-col .woocommerce-product-gallery .flex-control-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

.hero-image-col .woocommerce-product-gallery .flex-control-nav li {
    width: 60px;
    height: 60px;
}

.hero-image-col .woocommerce-product-gallery .flex-control-nav li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.hero-image-col .woocommerce-product-gallery .flex-control-nav li img.flex-active {
    border-color: var(--accent);
}

/* WooCommerce Tabs (Description / Reviews) */
.woocommerce-tabs {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--pj-line);
    border-radius: 12px;
    padding: 2.5rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.woocommerce-tabs ul.tabs {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0 0 2rem 0;
    padding: 0;
    border-bottom: 1px solid var(--pj-line);
}

.woocommerce-tabs ul.tabs li {
    padding-bottom: 1rem;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.5;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.woocommerce-tabs ul.tabs li.active {
    opacity: 1;
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.woocommerce-tabs ul.tabs li a {
    color: inherit;
    text-decoration: none;
}

.woocommerce-Tabs-panel {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.9;
}

.woocommerce-Tabs-panel h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--pj-text);
}

.woocommerce-Tabs-panel h2:first-child {
    margin-top: 0;
    display: none;
    /* Hide default first "Description" heading since tab implies it */
}

/* Sticky Bottom Bar for CTA */
.pdp-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(14, 16, 20, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 4vw;
    z-index: 9999;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    animation: slideUpSticky 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards 1s;
    /* appears after 1s */
}

@keyframes slideUpSticky {
    to {
        transform: translateY(0);
    }
}

.sticky-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    gap: 1rem;
    padding-right: 180px;
    /* Leave space for bottom-right widgets (e.g. Suscribirse button) */
}

.sticky-product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    /* Important to let text truncate */
    flex: 1;
}

.sticky-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sticky-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.3;
}

.sticky-action .sticky-btn {
    padding: 12px 24px;
    background: var(--pj-text);
    color: var(--pj-bg);
    text-transform: uppercase;
    font-family: var(--font-display);
    font-weight: 700;
    border-radius: 8px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: transform 0.2s, background 0.3s;
    display: block;
    white-space: nowrap;
}

.sticky-action .sticky-btn:hover {
    transform: scale(1.05);
    background: var(--accent);
    color: white;
}

/* --- MULTI-LINE CLAMPING --- */
.ep-title-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    /* Ensure long words break */
    white-space: normal;
}

.ep-title-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    white-space: normal;
}

/* --- LEGACY CONTENT CLEANUP --- */
/* Hide old hardcoded affiliate notices inside Gutenberg content */
.woocommerce-Tabs-panel .su-note,
.editorial-content-section .su-note {
    display: none !important;
}

/* Ensure CSS Grid text wrapping doesn't blow out */
.hero-image-col,
.hero-info-col {
    min-width: 0;
}

/* --- EDITORIAL GUTENBERG CONTENT SPACING --- */
.editorial-content-section p,
.editorial-content-section ul,
.editorial-content-section ol,
.editorial-content-section blockquote,
.editorial-content-section dl {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.editorial-content-section h2,
.editorial-content-section h3,
.editorial-content-section h4 {
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.editorial-content-section h2:first-child,
.editorial-content-section h3:first-child {
    margin-top: 0;
}

.editorial-content-section hr,
.editorial-content-section .wp-block-separator {
    margin: 4rem auto;
    border-color: var(--pj-line);
    opacity: 0.5;
}

.editorial-content-section .wp-block-image,
.editorial-content-section .wp-block-gallery,
.editorial-content-section table {
    margin-bottom: 2.5rem;
    margin-top: 2.5rem;
}


@media (max-width: 768px) {
    .pdp-sticky-bar {
        padding: 0.75rem 4vw;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .sticky-bar-content {
        padding-right: 0;
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .sticky-product-info {
        display: flex;
        /* Override display: none from earlier */
        max-width: 50%;
        gap: 0.75rem;
    }

    .sticky-thumb {
        width: 36px;
        height: 36px;
        border-radius: 4px;
    }

    .sticky-title {
        font-size: 0.85rem;
        line-height: 1.2;
    }

    .sticky-action {
        width: 45%;
        flex-shrink: 0;
    }

    .sticky-action .sticky-btn {
        width: 100%;
        text-align: center;
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    .editorial-content-section {
        padding-bottom: 6rem !important;
    }
}

/* =========================================
   GUTENBERG & WOOCOMMERCE BLOCKS (Mobile Overflows)
   ========================================= */

/* 1. Getwid Custom Post Types & Columns */
@media (max-width: 768px) {

    .wp-block-getwid-custom-post-type__wrapper.getwid-columns,
    .wc-block-featured-category__wrapper,
    .has-layout-grid .wp-block-getwid-custom-post-type__wrapper {
        display: flex;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 1rem;
        /* Space for scrollbar */
    }

    .wp-block-getwid-custom-post-type__wrapper.getwid-columns>*,
    .has-layout-grid .wp-block-getwid-custom-post-type__wrapper>* {
        flex: 0 0 85%;
        /* Make items take 85% of screen, hinting at the next one */
        min-width: 280px;
        scroll-snap-align: center;
    }

    /* 2. Tables & Image Resizing in comparison grids */
    .wp-block-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }

    .wp-block-table table {
        width: 100%;
        min-width: 500px;
        /* Ensure table doesn't squash too much */
    }

    .wp-block-table img {
        max-width: 100px !important;
        /* Cap image sizes in mobile tables */
        height: auto !important;
    }
}

/* --- ACCESSIBILITY / PERFORMANCE --- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}