/* =========================================
   HEADER I MENÚ DESPLEGABLE (ESTIL GALERIA)
   ========================================= */
:root {
    --header-bg: #efefef; 
    --text-name: #E97500;
    --text-dark: #000000;
    --text-grey: #555555;
}

/* Base del Header */
.site-header {
    background-color: var(--header-bg);
    padding: 15px 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%; /* Assegurem que ocupi tota la pantalla */
    box-sizing: border-box; /* Evita que el padding generi barra de desplaçament */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Aquesta és la clau: l'obliguem a ocupar tot l'espai d'esquerra a dreta */
    max-width: 100%;
    margin: 0;
}

/* Secció esquerra (Logo + Text) */
.header-logo-section {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 20px;
}

.header-logo-img {
    height: 60px; 
    width: 60px;
    object-fit: cover;
}

.header-title {
    display: flex;
    flex-direction: column;
    justify-content: left;
}

.title-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-name);
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.title-subtitle {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: 0.5px;
    line-height: 1.1;
}

/* Base del botó Hamburguesa */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    z-index: 1002;
    margin-left: auto; /* Aquest truc empeny el botó cap a la dreta del tot obligatòriament */
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
}

/* Animació de l'hamburguesa (es converteix en una X) */
.hamburger-btn.open span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}
.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* =========================================
   MENÚ LATERAL I NAVEGACIÓ
   ========================================= */

/* Menú Lateral (Slide Menu) */
.slide-menu {
    position: fixed;
    top: 0;
    right: -30%; /* Amagat fora de la pantalla */
    width: 30%; /* Ocupa el 30% a l'ordinador */
    height: 100vh;
    background-color: var(--header-bg);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* Quan el JS li afegeix la classe 'open', es desplaça a la posició 0 */
.slide-menu.open {
    right: 0; 
}

/* Alineació de l'interior del menú */
.slide-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Els textos queden alineats a l'esquerra */
    gap: 25px; /* Distància entre els enllaços */
    padding: 80px 40px 40px 60px; /* Padding superior reduït al no tenir la X extra */
}

/* Estil dels enllaços */
.slide-nav a {
    text-decoration: none;
    color: var(--text-grey);
    font-size: 15px; 
    font-weight: 500; 
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.slide-nav a:hover, .slide-nav a.active {
    color: var(--text-dark);
    font-weight: bold;
    text-decoration: underline;
}

/* EFECTE TABULACIÓ PER ALS SUB-MENÚS (Pintura, Escultura, Obra Gràfica) */
.sub-menu-item {
    margin-left: 30px; 
}

/* Overlay fosc per quan el menú s'obre */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   FOOTER (Amb les tres columnes)
   ========================================= */
.site-footer {
    background-color: var(--header-bg);
    padding: 25px 60px; /* El mateix padding lateral que té el Header */
    font-size: 13px;
    font-weight: 500;
    margin-top: auto; /* L'empenta a baix de tot de la pàgina */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Les tres parts s'imposen ocupar 1 part proporcional cadascuna */
.footer-left, .footer-center, .footer-right {
    flex: 1;
}

.footer-left {
    text-align: left;
}

.footer-center {
    text-align: center;
    color: var(--text-grey);
}

.footer-right {
    text-align: right;
}

/* Estil dels enllaços del Footer (Telèfon i Legal) */
.site-footer a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--text-name);
}

/* =========================================
   RESPONSIVE (Per a tauletes i mòbils)
   ========================================= */
@media (max-width: 1024px) {
    .slide-menu {
        width: 45%;
        right: -45%;
    }
}

@media (max-width: 768px) {
    /* Ajustaments del Header */
    .site-header { padding: 10px 20px; }
    .header-logo-section { gap: 10px; }
    .header-title .title-name { font-size: 18px; }
    .header-title .title-subtitle { font-size: 16px; }
    .header-logo-img { height: 50px; width: 50px; gap: 10px; }
    .hamburger-btn span { width: 30px; gap: 6px; }
    
    /* Ajustaments del Menú Lateral */
    .slide-menu { width: 85%; right: -85%; }
    .slide-nav { padding-left: 40px; }
    
    /* Ajustaments del Footer al mòbil */
    .site-footer {
        padding: 30px 20px;
    }
    
    .footer-content {
        flex-direction: column; /* Apila els elements un a sobre l'altre */
        gap: 15px; /* Deixa espai entre les línies */
    }
    
    .footer-left, .footer-center, .footer-right {
        text-align: center; /* Centra-ho tot quan estem al mòbil */
        flex: auto;
    }
}