/* ============================================================
   CB Sant Gregori — Estils compartits
   Fonts auto-hostatjades + reset + header + footer + cookie banner
   ============================================================ */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 600;
    font-display: block;
    src: url('fonts/inter.woff2') format('woff2');
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 500 700;
    font-display: block;
    src: url('fonts/oswald.woff2') format('woff2');
}

/* --- VARIABLES --- */
:root {
    --bg-dark: #0A0A0A;
    --bg-card: #141414;
    --text-white: #F2F2F2;
    --text-gray: #A0A0A0;
    --accent: #552583;

    --font-display: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;

    --container-width: 1200px;
    --spacing-section: 100px;
}

/* --- RESET --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- TIPOGRAFIA --- */
h1, h2, h3, h5 {
    font-family: var(--font-display);
    text-transform: uppercase;
    line-height: 1.1;
}

/* --- CONTAINER --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER & NAV --- */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 0;
    z-index: 100;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container { display: flex; align-items: center; }
.logo-img { height: 80px; width: auto; display: block; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-btn {
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid transparent;
}
.menu-btn:hover { border-color: white; }
.menu-btn.active { color: white; border-bottom: 1px solid var(--accent); }

.nav-link { font-size: 0.9rem; margin-left: 20px; color: var(--text-gray); }
.nav-link:hover { color: white; }
.nav-link.active { color: white; border-bottom: 1px solid var(--accent); }

.btn-small {
    display: inline-block;
    padding: 10px 20px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
}

/* --- FOOTER --- */
footer {
    padding: 80px 0 30px;
    border-top: 1px solid #222;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.footer-col h5 {
    color: white;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col a { display: block; margin-bottom: 10px; }
.footer-col a:hover { color: var(--accent); }

.newsletter input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    padding: 10px 0;
    width: 100%;
    color: white;
    outline: none;
}
.newsletter-form { display: flex; gap: 10px; margin-top: 10px; }
.newsletter-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 700;
    transition: 0.3s;
}
.newsletter-btn:hover { background: white; color: black; }

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #1a1a1a;
    font-size: 0.8rem;
}

/* --- BOTÓ FLOTANT TORNAR A L'INICI (mòbil) --- */
.back-to-home {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--accent);
    color: white;
    padding: 12px 18px;
    border-radius: 50%;
    z-index: 1000;
    display: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
.back-to-home:hover {
    background: white;
    color: black;
    transform: translateY(-2px);
}

/* --- COOKIE BANNER --- */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    border-top: 1px solid #222;
    padding: 20px 0;
    z-index: 9999;
    transition: bottom 0.5s ease-out;
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}
.cookie-banner.show { bottom: 0; }

.cookie-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
}

.cookie-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.btn-cookie {
    padding: 10px 20px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 2px;
}

.btn-fill {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
}
.btn-fill:hover { background: white; color: black; border-color: white; }

/* .btn-outline dins del cookie banner — més específic que .btn-outline de pàgines amb hero */
.cookie-banner .btn-outline {
    background: transparent;
    color: #ccc;
    border: 1px solid #444;
}
.cookie-banner .btn-outline:hover { border-color: white; color: white; }

.link-cookie {
    font-size: 0.8rem;
    text-decoration: underline;
    color: #888;
}
.link-cookie:hover { color: var(--accent); }

/* --- MEDIA MÒBIL — regles compartides --- */
@media (max-width: 768px) {
    .back-to-home { display: block; }

    .cookie-flex { flex-direction: column; text-align: center; }
    .cookie-buttons { flex-direction: column; width: 100%; }
    .btn-cookie { width: 100%; }

    /* Amaga el primer botó del nav (← Inici) en mòbil */
    .nav-right .menu-btn:first-child { display: none; }
}
