/*
Theme Name:   RELAXIA
Theme URI:    https://ericc432.sg-host.com
Description:  Tema fill de Hello Elementor per a RELAXIA — catàleg de mobles. Mode catàleg sense preus.
Author:       Prozeus
Template:     hello-elementor
Version:      1.3.0
Text Domain:  relaxia
*/

/* ==========================================================================
   Tokens del sistema de disseny "Aura de Luxe"
   Origen: stitch/.../aura_de_luxe/DESIGN.md — no canviar sense actualitzar-lo.
   ========================================================================== */

:root {
    /* Colors */
    --relaxia-onyx:            #1b1c1c; /* text principal */
    --relaxia-onyx-soft:       #444748; /* text secundari */
    --relaxia-alabaster:       #fbf9f9; /* fons */
    --relaxia-white:           #ffffff;
    --relaxia-gold:            #775a19; /* Heritage Gold */
    --relaxia-gold-light:      #e9c176;
    --relaxia-gold-hairline:   #c5a059;
    --relaxia-outline:         #747878;
    --relaxia-outline-variant: #c4c7c7;
    --relaxia-surface-dark:    #1c1b1b;

    /* Tipografia */
    --relaxia-font-display: "Libre Caslon Text", Georgia, serif;
    --relaxia-font-body:    "Manrope", system-ui, -apple-system, sans-serif;

    /* Espaiat */
    --relaxia-container: 1440px;
    --relaxia-gutter:    32px;
    --relaxia-section:   120px;
    --relaxia-margin-mobile: 20px;
}

/* ==========================================================================
   Base
   ========================================================================== */

body {
    background-color: var(--relaxia-alabaster);
    color: var(--relaxia-onyx);
    font-family: var(--relaxia-font-body);
    font-size: 16px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--relaxia-font-display);
    font-weight: 400;
}

/* Cantonades vives a tot arreu: el sistema de disseny és "Sharp (0)" */
button, input, select, textarea,
.elementor-button, .woocommerce a.button, .woocommerce button.button {
    border-radius: 0 !important;
}

/* ==========================================================================
   Utilitats del disseny original
   ========================================================================== */

/* Filet daurat amb degradat — separador de seccions */
.relaxia-hairline-gold {
    position: relative;
    padding-bottom: 1rem;
}
.relaxia-hairline-gold::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--relaxia-gold) 0%, var(--relaxia-gold-light) 50%, var(--relaxia-gold) 100%);
}

/* Text amb degradat daurat — titulars destacats */
.relaxia-text-gold {
    background: linear-gradient(90deg, var(--relaxia-gold) 0%, var(--relaxia-gold-light) 50%, var(--relaxia-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Aparició progressiva en fer scroll */
.relaxia-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}
.relaxia-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .relaxia-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==========================================================================
   Logotips de marca
   ========================================================================== */

/* Gris que es tenyeix en passar-hi per sobre, com al disseny original. */
.relaxia-brand-logo {
    filter: grayscale(100%);
    opacity: .5;
    transition: filter .3s ease, opacity .3s ease, transform .3s ease;
}
.relaxia-brand-logo:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.05);
}

/* Totes les marques ocupen EXACTAMENT la mateixa caixa.
 *
 * Els logotips tenen proporcions molt diferents (Gomarco és 7,4:1; Korflex 4,3:1),
 * així que igualar l'amplada els descompensaria: els allargats es veurien minúsculs.
 * La solució és una caixa idèntica per a tots amb el logotip centrat i limitat per
 * alçada I amplada alhora — així ningú domina i tots ocupen el mateix espai.
 *
 * Cal el !important: Elementor injecta mides en línia per widget.
 */
.relaxia-brand-logo {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 180px !important;
    height: 44px;
}
/* Ull amb els SVG: amb width:auto + height:auto es col·lapsen a zero i
   desapareixen, perquè no tenen mida intrínseca com els PNG. Cal donar-los
   una alçada concreta i deixar que l'amplada la calculi el viewBox. */
.relaxia-brand-logo img {
    width: auto !important;
    height: 34px !important;
    max-width: 100% !important;
    object-fit: contain;
}

@media (max-width: 767px) {
    .relaxia-brand-logo {
        width: 120px !important;
        height: 34px;
    }
    .relaxia-brand-logo img,
    .relaxia-brand-logo svg {
        max-height: 26px !important;
    }
}

/* ==========================================================================
   Seccions de fons fosc — correcció de contrast
   ==========================================================================

   El sistema de disseny té DOS daurats i no són intercanviables:
     --relaxia-gold       #775a19  -> per a fons CLARS
     --relaxia-gold-light #e9c176  -> per a fons FOSCOS

   Stitch feia servir el fosc (#775a19) sempre, perquè les seves seccions eren
   clares. En passar-lo a un fons #1c1b1b el contrast cau a 2,4:1, molt per sota
   del 4,5:1 mínim. Amb el daurat clar puja a 10,5:1.

   S'aplica per CSS i no editant l'estructura perquè la portada l'edita l'Eric
   a mà des d'Elementor. */

.elementor-element-inHelp .elementor-heading-title,
.elementor-element-inHelp p {
    color: rgba(255, 255, 255, .82);
}

/* L'etiqueta petita ("ASSESSORAMENT PERSONALITZAT") */
.elementor-element-inHelpL .elementor-heading-title {
    color: var(--relaxia-gold-light) !important;
}

/* El botó: filet i text en daurat clar. En hover s'omple de daurat i el text
   passa a ònix — així el canvi es veu de debò, en comptes de fosc sobre fosc. */
.elementor-element-inHelp .elementor-button {
    color: var(--relaxia-gold-light) !important;
    border-color: var(--relaxia-gold-light) !important;
    background-color: transparent !important;
    transition: background-color .3s ease, color .3s ease;
}
.elementor-element-inHelp .elementor-button:hover,
.elementor-element-inHelp .elementor-button:focus-visible {
    background-color: var(--relaxia-gold-light) !important;
    color: var(--relaxia-surface-dark) !important;
    border-color: var(--relaxia-gold-light) !important;
}

/* ==========================================================================
   Capçalera fixa
   Reprodueix: fixed top-0 w-full z-50 bg-background/90 backdrop-blur-md
               border-b border-outline-variant/20
   ========================================================================== */

.relaxia-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background-color: rgba(251, 249, 249, .9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(196, 199, 199, .2);
}

/* Compensa l'alçada de la capçalera fixa: main pt-24 (96px) al disseny original.
   A l'editor d'Elementor no cal, perquè la capçalera no hi és. */
body:not(.elementor-editor-active) .site-main,
body:not(.elementor-editor-active) .elementor-location-single,
body:not(.elementor-editor-active) .elementor-location-archive {
    padding-top: 96px;
}
@media (max-width: 767px) {
    body:not(.elementor-editor-active) .site-main,
    body:not(.elementor-editor-active) .elementor-location-single,
    body:not(.elementor-editor-active) .elementor-location-archive {
        padding-top: 72px;
    }
}

/* El menú del disseny només apareix a partir de 768px (md:flex) */
@media (max-width: 767px) {
    .relaxia-header .elementor-nav-menu--main .elementor-nav-menu {
        display: none;
    }
}

/* ==========================================================================
   Botó flotant de WhatsApp
   ========================================================================== */

.relaxia-wa-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
    transition: transform .25s ease;
}
.relaxia-wa-float:hover {
    transform: scale(1.08);
    color: #fff;
}
.relaxia-wa-float svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}
@media (max-width: 767px) {
    .relaxia-wa-float {
        right: var(--relaxia-margin-mobile);
        bottom: var(--relaxia-margin-mobile);
    }
}

/* ==========================================================================
   Mode catàleg — WooCommerce sense preus ni carret
   Xarxa de seguretat visual: el gruix es fa en PHP (functions.php).
   ========================================================================== */

.woocommerce .price,
.woocommerce div.product p.price,
.woocommerce ul.products li.product .price,
.wc-block-components-product-price,
.woocommerce div.product form.cart,
.woocommerce a.add_to_cart_button,
.woocommerce .added_to_cart {
    display: none !important;
}

/* ==========================================================================
   Targeta de producte del catàleg
   MARCA (daurat, majúscules) / Títol (serif) / "Veure detalls" (filet daurat).
   Va per CSS perquè els ajustos del widget "Products" d'Elementor no arriben
   a aquests elements: els títols sortien en rosa, el color d'enllaç per defecte.
   ========================================================================== */

/* Graella: el disseny demana 3 columnes i WooCommerce en pinta 4 amb floats
   (ul.products.columns-4). Amb grid, totes les targetes d'una fila fan la mateixa
   alçada, cosa que els floats no garanteixen: una fitxa sense marca queda més
   curta i deixa la fila dentada. */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 64px 32px;
    margin: 0 !important;
}

/* El clearfix de WooCommerce compta com a ítem de grid i hi obre forats. */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    content: none !important;
}

.woocommerce ul.products li.product {
    width: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* Empeny el CTA a baix de tot: així queda alineat a tota la fila encara que un
   títol ocupi dues línies. */
.woocommerce ul.products li.product .relaxia-loop-link {
    margin-top: auto;
    align-self: center; /* sense això, el filet daurat s'estira a tot l'ample */
}

@media (max-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 48px 24px;
    }
}

@media (max-width: 767px) {
    .woocommerce ul.products {
        gap: 40px 16px;
    }
}

.woocommerce ul.products li.product .relaxia-loop-brand {
    margin: 24px 0 8px;
    font-family: var(--relaxia-font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .1em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--relaxia-gold);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--relaxia-font-display) !important;
    font-size: 32px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    color: var(--relaxia-onyx) !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
}

/* headline-md (32px) és una mida d'escriptori: dins d'una targeta de ~170px al
   mòbil, un títol com "Estanteria Frame" es parteix i desborda visualment.
   El DESIGN.md ja preveu que els titulars baixin al mòbil. */
@media (max-width: 1024px) {
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 24px !important;
    }
}

@media (max-width: 767px) {
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 20px !important;
        margin: 0 0 12px !important;
    }
    .woocommerce ul.products li.product .relaxia-loop-brand {
        margin: 16px 0 6px;
        font-size: 12px;
    }
    .relaxia-loop-link {
        font-size: 12px;
    }
}

.woocommerce ul.products li.product a,
.woocommerce ul.products li.product a:hover {
    color: inherit;
}

.relaxia-loop-link {
    display: inline-block;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--relaxia-gold);
    font-family: var(--relaxia-font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--relaxia-gold) !important;
    transition: color .3s ease, border-color .3s ease;
}
.relaxia-loop-link:hover {
    color: var(--relaxia-onyx) !important;
    border-bottom-color: var(--relaxia-onyx);
}

/* Imatge del producte: proporció fixa i zoom suau, com al disseny. */
.woocommerce ul.products li.product img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    margin: 0 !important;
    transition: transform .7s ease-out;
}
.woocommerce ul.products li.product:hover img {
    transform: scale(1.05);
}
.woocommerce ul.products li.product a img {
    overflow: hidden;
}

/* CTA de consulta per WhatsApp a la fitxa i a la graella */
.relaxia-consulta-btn {
    display: inline-flex;
    align-items: center;
    gap: .6em;
    padding: 16px 32px;
    background: var(--relaxia-onyx);
    color: var(--relaxia-white);
    font-family: var(--relaxia-font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1;
    border: 1px solid var(--relaxia-onyx);
    transition: background-color .3s ease, color .3s ease;
}
.relaxia-consulta-btn:hover {
    background: transparent;
    color: var(--relaxia-onyx);
}
