/* ---------- RESET ---------- */

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

body{
    font-family: Arial, Helvetica, sans-serif;
    background:#f6f7fb;
    color:#222;
}

/* ---------- HEADER ---------- */

header{

    background:white;

    padding:10px 0;

    box-shadow:0 2px 10px rgba(0,0,0,.05);

}

header h1{

    font-size:1.7rem;
    margin:0;
    color: #4a4a4a; 
    text-shadow: 1px 1px 3px rgba(0,0,0,.15);  
}
/* ---------- HERO ---------- */

#hero{
    background:linear-gradient(135deg, #74dc74 ,#c3c3c3);
    color:white;
    padding:12px 20px;
}


.hero-content h2{
    font-size:1.3rem;
    margin-bottom:8px;
    margin-bottom:6px;
}

#search{
    width:100%;
    max-width:550px;
    padding:10px 14px;
    border:none;
    border-radius:8px;
    font-size:0.95rem;
}

/* ---------- CATÀLEG ---------- */

#catalog{
    display:grid;
    grid-template-columns:240px 1fr 340px;
    gap:30px;
    max-width:1800px;
    margin:40px auto;
    padding:0 20px;
}

/* ---------- FILTRES ---------- */

#filters{
    background:white;
    border-radius:12px;
    padding:16px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
    position:sticky;
    top:20px;
    height:max-content;
}

/* ---------- RESULTATS ---------- */

#results{
    display:flex;
    flex-direction:column;
    gap:0px;
}

#results-header{
    height:50px;
    display:flex;
    justify-content:center;
    align-items:center;
    color: #4a4a4a; 
}

#cards-container{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:25px;
    }


/* ---------- TARGETES ---------- */

.card{
    background:white;
    border-radius:12px;
    padding:12px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
    display:flex;
    flex-direction:column;
    gap:4px;
    transition:.2s;
    position:relative;
}

.card:hover{
     transform:translateY(-4px);
    box-shadow:0 8px 24px rgba(0,0,0,.12);
}

.card h3{
    margin:0 0 2px 0;
    font-size:1rem;
    line-height:1.5;
}

.card .categoria{
    color:#666;
    font-size:.95rem;
    margin-top: -2px;
}

.card .organitzador{
    font-weight:400;
}

.card .preu{
    margin-top:0px;
    font-size:0.9rem;
    font-weight:400;
    line-height:1.3;
}

.card button{
    margin-top:10px;
    padding:12px;
    border:none;
    border-radius:8px;
    background:linear-gradient(135deg, #74dc74 ,#c3c3c3);
    color:white;
    cursor:pointer;
    font-weight:600;
}

.card button:hover{
    background:linear-gradient(135deg, #f59cbc ,#c3c3c3);
}

.container{
    max-width:1200px;
    margin:auto;
    padding:0 20px;
}

#filters h3{
    margin-bottom:25px;
    font-size:1rem;
    color: #4a4a4a;
    border-bottom:2px solid #666;
    padding-bottom:8px;
}

#filters label{
    display:block;
    margin-top:10px;
    margin-bottom:4px;
    font-size:0.8rem;
    font-weight:600;
    color:#666;
}

#filters select,
#filters input{
    width:100%;
    padding:12px;
    border:1px solid #ddd;
    border-radius:6px;
    font-size:0.9rem;
    background: white;
    outline:none;
    border-color:#666;
    box-shadow:0 0 0 3px rgba(116,220,116,.2);
}

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    display:flex;
    justify-content:flex-end;
    align-items:stretch;
    z-index:1000;
}

.ocult{
    display:none;
}

.modal-content{
    background:white;
    width:600px;
    max-width:90vw;
    height:100vh;
    overflow:auto;
    padding:30px;
    box-sizing:border-box;
}

#tancarModal{
    float:right;
    font-size:30px;
    cursor:pointer;
}

.fitxa-titol{
    margin:0;
    font-size:1.3rem;
    line-height:1.2;
}

.fitxa-subtitol{
    color:#666;
    margin-top:4px;
    margin-bottom:12px;
    font-size:.9rem;
}

.fitxa-seccio{
    margin-top:4px;
    padding-top:4px;
    border-top:1px solid #e5e5e5;
}

.fitxa-seccio h3{
    margin:0 0 0px 0;
    font-size:0.95rem;
    color:#1c4f82;
}

.fitxa-camp{
    margin-bottom:4px;
}

.fitxa-label{
       font-size:0.8rem;
    font-weight:600;
    color:#666;
   }


.fitxa-valor{
       font-size:0.8rem;
    }

@media (max-width: 768px) {

    .modal {
        justify-content: center;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 16px;
    }

}

.header-content{
    display:flex;
    align-items:center;
    gap:20px;
}

.header-content h1{
    flex:1;
    text-align:center;
    margin-right:80px;
}

.logo-ajuntament{
    height:60px;
    width:auto;
    object-fit:contain;
}

.hero-content{
    display:flex;
    align-items:center;
    justify-content: flex-start;
    gap:20px;
}

.hero-text{
    flex:0 0 60%;
}

.hero-illustration{
    height:120px;
    width:auto;
    object-fit:contain;
    flex-shrink:0;
       }

#paginacio{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:20px;
    margin-top:20px;
    margin-bottom:-10px;
}

#paginacio button{
    background:#c3c3c3;
    color:white;
    border:none;
    border-radius:8px;
    width:20px;
    height:20px;
    cursor:pointer;
    font-size:1rem;
}

#paginacio button:hover{
    background:#f59cbc;
}

#paginacio button:disabled{
    background:#c3c3c3;
    cursor:not-allowed;
}

#paginacio span{
    font-weight:300;
    color:#4a4a4a;
    font-size:0.8rem;
}

.card-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
}

.card-header h3{
    flex:1;
    margin:0;
}

.card-icon{
    position: absolute;
    top: 16px;
    right: 12px;
    width:48px;
    height:48px;
    object-fit:contain;
    flex-shrink:0;
}

#fitxa-detall{
    background:white;
    border-radius:12px;
    padding:20px;
    box-shadow:0 4px 15px rgba(0,0,0,.08);
    height:fit-content;
    position:sticky;
    top:20px;
    }

#fitxa-detall.ocult{
    display:none;
}

#fitxa-detall-content{
    font-size:0.8rem;
}

#fitxa-detall h2{
    margin-top:0;
}

#fitxa-detall h3{
    margin-top:4px;
    margin-bottom:4px;
    color: #4a4a4a; 
    text-shadow: 1px 1px 3px rgba(0,0,0,.15);
    font-size: 0.85rem;
}

#fitxa-detall p{
    margin:2px 0;
}

.card div{
    font-size:0.85rem;
    line-height:1.2;
    margin:0;
}

.categoria{
    margin:0;
    font-size:0.85rem;
    font-weight:600;
    color:#666;
}

.organitzador{
    color:#555;
}

.preu{
    font-weight:600;
    margin-top:4px;
}

.fitxa-camp{
    display:flex;
    gap:6px;
    align-items:flex-start;
    margin-bottom:4px;
}

.fitxa-label{
    flex-shrink:0;
}

#btnResetFiltres{
    width:100%;
    margin-top:20px;
    padding:12px;
    border:none;
    border-radius:8px;
    background: linear-gradient(135deg, #74dc74 ,#c3c3c3);
    color:white;
    font-weight:600;
    cursor:pointer;
}

#btnResetFiltres:hover{
    background: linear-gradient(135deg, #f59cbc ,#c3c3c3);
}

#toggleDescripcio{
    background:none;
    border:none;
    color:#458bcc;
    font-size:0.75rem;
    font-weight:600;
    cursor:pointer;
    padding:0;
    margin-top:4px;
}

#toggleDescripcio:hover{
    color:#f59cbc;
    text-decoration:underline;
}


/* =====================================================
   FOOTER
===================================================== */

footer{
    margin-top:-5px;
    padding:24px 20px;
    background:linear-gradient(
        90deg,
        #6fd36f 0%,
        #9fd99f 45%,
        #d8d8d8 100%
    );
    border-top:1px solid #c3c3c3;
}

.footer-content{
    max-width:1100px;
    margin:0 auto;
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    gap:20px;
}


/* =====================================================
   INFORMACIÓ
===================================================== */

.footer-info{
    display:flex;
    flex-direction:column;
    justify-content:left;
    }

.footer-info h3{
    margin:0 0 0px;
    font-size:0.80rem;
    font-weight:600;
    color:#666;
}

.footer-info p{
    margin:0px 0;
    font-size:.80rem;
    color:#666;
    line-height:1.35;
}

.footer-info a{
    color:#666;
    font-size:.80rem;
    text-decoration:none;
    line-height:1.35;
}

.footer-info a:hover{
    text-decoration:underline;
}


/* =====================================================
   LOGOS
===================================================== */

.footer-logos{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:20px;
}

.footer-logo{
    height:46px;
    width:auto;
    object-fit:contain;
}


/* =====================================================
   CONTACTE
===================================================== */

.footer-legal{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:6px;
    padding-right:30px;
}

.footer-legal a{
    color:#666;
    font-size:.80rem;
    text-decoration:none;
    transition:.2s;
    display:block;
}

.footer-legal a:hover{
    text-decoration:underline;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width:900px){

    footer{
        padding:30px 20px;
    }

    .footer-content{
        grid-template-columns:1fr;
        gap:28px;
        text-align:center;
    }

    .footer-info,
.footer-legal{
    align-items:center;
}

    .footer-logos{
        display:flex;
        flex-wrap:wrap;
        justify-content:center;
        gap:20px;
        align-items:center;
        }

    .footer-logo{
        max-width:100%;
        height:50px;
    }
}

@media (max-width: 768px){

    #catalog{
        grid-template-columns:1fr;
    }

    #cards-container{
        grid-template-columns:1fr;
    }

    #fitxa-detall{
        position:static;
    }

        #filters{
        position:static;
        top:auto;
    }

.hero-content{
    flex-direction:column;
    text-align:center;
}

.hero-text{
    width:100%;
}

#search{
    max-width:100%;
}

.hero-illustration{
    height:90px;
}

.header-content{
    flex-direction:column;
    gap:10px;
}

.header-content h1{
    margin:0;
    text-align:center;
    font-size:1.5rem;
}

#filtersToggle{
    cursor:pointer;
}

#filtersContent.ocult{
    display:none;
}

#fitxa-detall{
    display:none !important;
}

#fitxa-mobile{
    position:fixed;
    top:0;
    left:0;
    right:0;
    background:white;
    z-index:2000;
    padding:20px;
    overflow:auto;
    box-sizing:border-box;
    width:100vw;
    max-width:100vw;
    overflow-x:hidden;
}

#fitxa-mobile.ocult{
    display:none;
}

#tancarFitxaMobile{
    width:100%;
    margin-top:20px;
    padding:12px;
    border:none;
    border-radius:8px;
    background:#74dc74;
    color:white;
    font-weight:600;
}

}

/* =====================================================
   MODAL LEGAL
===================================================== */

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:5000;
}

.ocult{
    display:none;
}

.modal-legal{
    width:min(900px,90vw);
    max-height:85vh;
    background:white;
    border-radius:12px;
    padding:30px;
    overflow-y:auto;
    box-shadow:0 20px 60px rgba(0,0,0,.30);
    position:relative;
}

#tancarLegal{
    position:absolute;
    top:18px;
    right:22px;
    font-size:32px;
    cursor:pointer;
    color:#666;
}

#tancarLegal:hover{
    color:#000;
}

#modalTitol{
    margin-bottom:20px;
    color:#4a4a4a;
}

#modalCos h3{
    margin-top:22px;
    margin-bottom:8px;
    color:#4a4a4a;
}

#modalCos p{
    margin-bottom:12px;
    line-height:1.6;
    color:#555;
}

.btn-mes-info {
    display: inline-block;
    background: linear-gradient(135deg, #74dc74 ,#c3c3c3);
    color: white;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 400;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.btn-mes-info:hover {
    background:linear-gradient(135deg, #f59cbc ,#c3c3c3);
    transform: translateY(-1px);
}

.text-info-extra {
    font-size: 0.8rem;
}

#descripcioText {
    font-size: 0.8rem;
    line-height: 1.2;
}
