/* --- tipografies --- */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Fredoka:wght@300..700&family=Comfortaa:wght@300..700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: #333333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #ffffff;
    transition: background 0.3s ease;
}

h1, h2, h3, h4 {
    font-family: 'Fredoka', 'Comfortaa', sans-serif;
    color: #4a3b32;
}

/* --- navegació --- */
header {
    background-color: #e4f0e1;
    padding: 20px;
    text-align: center;
    border-bottom: 3px solid #a0c596;
}

.logo img {
    max-width: 140px;
    height: auto;
}

.logo h1 {
    margin: 10px 0 0 0;
    font-size: 2.6rem;
}

.logo p {
    margin: 5px 0 20px 0;
    font-size: 0.9rem;
    color: #8a7365;
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

nav ul > li {
    display: inline-block;
    position: relative;
}

nav ul > li > a {
    text-decoration: none;
    color: #6d5444;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: block;
}

nav ul > li > a:hover,
nav ul > li > a.active,
nav ul > li > a.actiu {
    background-color: #a0c596 !important;
    color: #ffffff !important;
}

nav ul > li.desplegable > a::after {
    content: " ▾";
}

nav ul li .submenu {
    display: none; 
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e4f0e1 !important; 
    border: 2px solid #a0c596 !important;
    border-radius: 12px;
    padding: 8px 0;
    min-width: 230px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    z-index: 99999;
    list-style: none;
    margin: 5px 0 0 0;
}

nav ul li .submenu li {
    display: block !important;
    width: 100% !important;
    padding: 0 8px !important;
    margin: 0 !important;
}

nav ul li .submenu li a {
    display: block !important;
    background-color: transparent !important; 
    color: #6d5444 !important;                
    padding: 10px 14px !important;
    border-radius: 8px !important;            
    text-align: left !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    width: 100% !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

nav ul li .submenu li a:hover {
    background-color: #a0c596 !important; 
    color: #ffffff !important;          
}

nav ul li.desplegable:hover .submenu {
    display: block !important;
}

/* --- graelles --- */
.contenidor-home {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.banda-gossos {
    width: 100%;
    margin-bottom: 25px;
    border-radius: 20px;
    overflow: hidden;
}

.banda-gossos img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.graella-principal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- seccions --- */
.caixa-subscripcio {
    grid-column: span 2;
    background-color: #ffffff;
    border: 1px solid #a0c596;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    overflow: hidden;
}

.caixa-contingut {
    padding: 30px;
}

.caixa-subscripcio .caixa-imatge img {
    width: 50%;
    height: 95%;
    object-fit: contain;
}

.caixa-destacada {
    background-color: #ffffff;
    border: 1px solid #a0c596;
    border-radius: 20px;
    border-top: 4px solid #a0c596 !important; 
}

/* --- testimonis --- */
.bloc-testimonis {
    grid-column: span 2;
    background-color: #ffffff; 
    border: 1px solid #a0c596; 
    border-radius: 20px;
    padding: 35px;
}

.graella-testimonis {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
    margin-top: 20px;
}

.targeta-testimoni {
    background-color: #ffffff;
    border: 1px solid #a0c596; 
    border-top: 4px solid #a0c596 !important;
    border-radius: 18px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.citacio {
    font-style: italic;
    color: #4a3b32;
    line-height: 1.6;
    margin-top: 0;
    flex-grow: 1;
}

.autor {
    display: block;
    text-align: right;
    font-weight: bold;
    color: #6d5444;
    margin-top: 10px;
    margin-bottom: 20px;
}

.imatge-decorativa-banda {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    border-top: 1px dashed #a0c596;
    padding-top: 15px;
}

.imatge-decorativa-banda img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #a0c596;
    background-color: #e4f0e1;
}

/* --- valors --- */
.seccio-valors-home {
    background-color: #ffffff;
    border: 1px solid #a0c596;
    border-radius: 20px;
    padding: 35px;
    text-align: center;
    grid-column: span 2;
    margin-top: 10px;
}

.imatge-gosarbre {
    margin-top: 25px;
    width: 100%;
    text-align: center;
}

.imatge-gosarbre img {
    width: 35%;
    max-width: 35%;
    height: auto;
    display: inline-block; 
    object-fit: contain;
    border-radius: 14px;
}

/* --- galeries, formularis i taules --- */

main {
    max-width: 1100px;
    margin: 40px auto;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.card {
    background: #e4f0e1;
    border: 1px solid #a0c596;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
}

.card img {
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
}

.card video {
    width: 100%;
    height: 180px;
    object-fit: cover; 
    border-radius: 10px;
    background-color: #000000;
}

.camp-formulari {
    margin-bottom: 20px;
}

.camp-formulari label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #4a3b32;
}

.camp-formulari input, 
.camp-formulari textarea, 
.camp-formulari select {
    width: 100%;
    padding: 12px;
    border: 1px solid #a0c596;
    border-radius: 8px;
    box-sizing: border-box;
    background-color: #fcf9f5;
}

button, .boto-enllaç {
    background-color: #a0c596;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s ease;
}

button:hover {
    background-color: #4a3b32;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #a0c596;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #e4f0e1;
    color: #4a3b32;
}

/* --- peu de pàgina --- */
footer {
    background-color: #a0c596; 
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.9rem;
}

footer p {
    margin: 5px 0;
    color: #6d5444;
}

footer a {
    color: #6d5444;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    color: #a0c596;
    text-decoration: underline;
}

/* --- filtres --- */

.index-filtres {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    background-color: #e4f0e1;
    padding: 15px;
    border-radius: 14px;
    border: 1px solid #a0c596;
}

.boto-filtre {
    text-decoration: none;
    background-color: #ffffff;
    color: #6d5444;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    border: 1px solid #a0c596;
    transition: all 0.2s ease;
}

.boto-filtre:hover {
    background-color: #a0c596;
    color: #ffffff;
}

.galeria-filtrable-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-filtrable {
    background-color: #ffffff;
    border: 1px solid #a0c596;
    border-radius: 16px;
    display: flex; 
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.card-filtrable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(160, 197, 150, 0.15);
}

.card-filtrable img {
    width: 200px;
    height: 100%;
    min-height: 160px;
    object-fit: cover;
    border-right: 1px solid #a0c596;
}

.info-producte {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    flex-grow: 1;
}

.info-producte h4 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.info-producte p {
    margin: 0 0 15px 0;
    color: #555555;
    font-size: 0.95rem;
}

.hashtag-visual {
    align-self: flex-start;
    background-color: #f0f5ee;
    color: #8a7365;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* --- filtres i fons --- */

body:has(#joguines:target) .card-filtrable,
body:has(#roba:target) .card-filtrable,
body:has(#habitat:target) .card-filtrable,
body:has(#alimentacio:target) .card-filtrable,
body:has(#novetats:target) .card-filtrable,
body:has(#mes-venuts:target) .card-filtrable,
body:has(#gossos:target) .card-filtrable,
body:has(#gats:target) .card-filtrable,
body:has(#rèptils:target) .card-filtrable,
body:has(#peixos:target) .card-filtrable,
body:has(#ocells:target) .card-filtrable,
body:has(#petits-mamifers:target) .card-filtrable {
    display: none !important;
}

body:has(#joguines:target) .card-filtrable.joguines,
body:has(#roba:target) .card-filtrable.roba,
body:has(#habitat:target) .card-filtrable.habitat,
body:has(#alimentacio:target) .card-filtrable.alimentacio,
body:has(#novetats:target) .card-filtrable.novetats,
body:has(#mes-venuts:target) .card-filtrable.mes-venuts,
body:has(#gossos:target) .card-filtrable.gossos,
body:has(#gats:target) .card-filtrable.gats,
body:has(#rèptils:target) .card-filtrable.rèptils,
body:has(#peixos:target) .card-filtrable.peixos,
body:has(#ocells:target) .card-filtrable.ocells,
body:has(#petits-mamifers:target) .card-filtrable.petits-mamifers,
body:has(#tots:target) .card-filtrable {
    display: flex !important; 
}

body.pagina-inici { background: url('../imatges/Fons13.png') no-repeat center center fixed !important; background-size: cover !important; }
body.pagina-consells { background: url('../imatges/Fons6.png') no-repeat center center fixed !important; background-size: cover !important; }
body.pagina-productes { background: url('../imatges/Fons14.png') no-repeat center center fixed !important; background-size: cover !important; }
body.pagina-compra { background: url('../imatges/Fons6.png') no-repeat center center fixed !important; background-size: cover !important; }
body.pagina-atencio { background: url('../imatges/Fons14.png') no-repeat center center fixed !important; background-size: cover !important; }
body.pagina-gestio { background: url('../imatges/Fons13.png') no-repeat center center fixed !important; background-size: cover !important; }
body.pagina-memoria { background: url('../imatges/Fons14.png') no-repeat center center fixed !important; background-size: cover !important; }

/* --- detall-producte --- */
.contenidor-principal-detall {
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
}

.seccio-detall {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.seccio-detall h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.introduccio {
    text-align: center;
    color: #6d5444;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.card-filtrable {
    margin-bottom: 10px;
}

.card-filtrable img {
    width: 220px;          
    height: 180px;       
    object-fit: cover;    
}

body:has(.boto-filtre:focus) .card-filtrable,
body:has(#joguines:target) .card-filtrable,
body:has(#roba:target) .card-filtrable,
body:has(#habitat:target) .card-filtrable,
body:has(#alimentacio:target) .card-filtrable 
body:has(#novetats:target) .card-filtrable,
body:has(#mes-venuts:target) .card-filtrable 
body:has(#gossos:target) .card-filtrable,
body:has(#gats:target) .card-filtrable,
body:has(#rèptils:target) .card-filtrable,
body:has(#peixos:target) .card-filtrable,
body:has(#ocells:target) .card-filtrable,
body:has(#petits-mamifers:target) .card-filtrable {
    display: none !important;
}

body:has(#joguines:target) .card-filtrable.joguines,
body:has(#roba:target) .card-filtrable.roba,
body:has(#habitat:target) .card-filtrable.habitat,
body:has(#alimentacio:target) .card-filtrable.alimentacio,
body:has(#novetats:target) .card-filtrable.novetats,
body:has(#mes-venuts:target) .card-filtrable.mes-venuts,
body:has(#gossos:target) .card-filtrable.gossos,
body:has(#gats:target) .card-filtrable.gats,
body:has(#rèptils:target) .card-filtrable.rèptils,
body:has(#peixos:target) .card-filtrable.peixos,
body:has(#ocells:target) .card-filtrable.ocells,
body:has(#petits-mamifers:target) .card-filtrable.petits-mamifers,
body:has(#tots:target) .card-filtrable {
    display: flex !important; 
}

/* --- header títols --- */
.enllac-titol-producte {
    text-decoration: none;      
    color: #4a3b32;             
    transition: color 0.2s ease;
}

.enllac-titol-producte:hover {
    color: #a0c596;             
}

/* --- pantalles reduides --- */
@media (max-width: 768px) {
    .graella-principal, .graella-testimonis, .caixa-subscripcio {
        grid-template-columns: 1fr;
    }
    
    .caixa-subscripcio {
        text-align: center;
    }
    
    .caixa-subscripcio .caixa-imatge img {
        width: 80%;
        margin: 10px auto;
    }
    
    .imatge-gosarbre img {
        width: 70%;
        max-width: 70%;
    }
    .caixa-subscripcio-compra {
        grid-template-columns: 1fr;
    }
	.card-filtrable {
        flex-direction: column;
    }
    .card-filtrable img {
        width: 100%;
        height: 180px;
        border-right: none;
        border-bottom: 1px solid #a0c596;
    }
}