
*{box-sizing:border-box}

:root{
    --bordeus:#6B1E1E;
    --bordeus-fosc:#4d1414;
    --or:#C9A45C;
    --crema:#F8F6F1;
    --text:#333333;
}

body{
    margin:0;
    background:var(--crema);
    color:var(--text);
    font:16px/1.55 Arial,Helvetica,sans-serif;
}

a{color:var(--bordeus)}
a:hover{color:#9a3434}

/* CAPÇALERA */
.capcalera{
    background:var(--bordeus);
    text-align:center;
    border-bottom:5px solid var(--or);
}

.marca{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:16px;
    min-height:100px;
    text-decoration:none;
    color:#fff;
    font:bold 30px Georgia,serif;
    letter-spacing:3px;
}

.marca img{
    max-height:115px;
    max-width:min(100%,1100px);
    object-fit:contain;
}

/* MENÚ */
.menu{
    display:flex;
    justify-content:center;
    gap:0;
    flex-wrap:wrap;
    background:var(--bordeus-fosc);
    border-bottom:3px solid var(--or);
}

.menu a{
    color:#fff;
    text-decoration:none;
    padding:14px 22px;
    font-weight:bold;
}

.menu a:hover{
    background:var(--or);
    color:var(--bordeus-fosc);
}

/* CONTINGUT */
.contenidor{
    width:min(1180px,92%);
    margin:34px auto 60px;
}

h1,h2{
    font-family:Georgia,serif;
    color:var(--bordeus);
    line-height:1.2;
}

h1{
    font-size:2.2rem;
    margin:0 0 24px;
    border-bottom:2px solid var(--or);
    padding-bottom:12px;
}

h2{
    font-size:1.55rem;
    margin:34px 0 18px;
}

/* PORTADA */
.hero{
    background:linear-gradient(110deg,#fff 0%,#f1e8d8 100%);
    border-left:6px solid var(--or);
    padding:42px;
    margin-bottom:30px;
}

.hero h1{margin:5px 0 12px}
.hero p{max-width:720px}

.sobretitol,.etiqueta{
    color:#8b6b31;
    text-transform:uppercase;
    letter-spacing:1px;
    font-size:.78rem;
    font-weight:bold;
}

/* BOTONS */
.boto{
    display:inline-block;
    border:2px solid var(--bordeus);
    background:var(--bordeus);
    color:#fff;
    padding:11px 20px;
    border-radius:3px;
    text-decoration:none;
    font-weight:bold;
    cursor:pointer;
}

.boto:hover{
    background:var(--or);
    border-color:var(--or);
    color:var(--bordeus-fosc);
}

/* CERCA */
.cerca-rapida{
    background:#fff;
    padding:24px;
    border:1px solid var(--or);
    border-top:4px solid var(--bordeus);
}

.formulari-cerca{
    display:flex;
    gap:10px;
    align-items:end;
    flex-wrap:wrap;
}

.formulari-cerca label{
    display:block;
    width:100%;
    font-weight:bold;
}

input[type=search]{
    flex:1;
    min-width:220px;
    padding:12px;
    border:1px solid #bbb;
    border-radius:3px;
    font:inherit;
}

/* GRAELLA D'AMPOLLETES */
.graella{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
    gap:18px;
}

.targeta{
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
    background:#fffdf9;
    padding:14px;
    border:1px solid #dfc995;
    border-bottom:3px solid var(--or);
    border-radius:4px;
    text-decoration:none;
    color:var(--text);
    transition:transform .15s,box-shadow .15s;
}

.targeta:hover{
    transform:translateY(-3px);
    box-shadow:0 5px 18px #6B1E1E20;
    border-color:var(--bordeus);
}

.targeta img{
    height:150px;
    max-width:100%;
    width:auto;
    object-fit:contain;
    margin-bottom:10px;
}

.targeta strong{color:var(--bordeus)}
.targeta small{margin-top:5px;color:#777}

/* ESTADÍSTIQUES */
.stats{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:15px;
}

.stats div{
    background:#fff;
    border-top:4px solid var(--or);
    border-bottom:1px solid #e8dfce;
    padding:22px;
    text-align:center;
}

.stats strong{
    display:block;
    color:var(--bordeus);
    font:bold 2rem Georgia,serif;
}

.stats span{display:block}

/* CONTINGUT I FITXA */
.contingut{
    background:#fff;
    padding:32px;
    max-width:900px;
    border-top:4px solid var(--or);
}

.fitxa{
    display:grid;
    grid-template-columns:minmax(220px,38%) 1fr;
    gap:36px;
    align-items:start;
}

.foto-fitxa{
    background:#fff;
    padding:18px;
    text-align:center;
    border:1px solid var(--or);
}

.foto-fitxa img{
    max-width:100%;
    height:auto;
    max-height:550px;
    object-fit:contain;
}

.dades{
    display:grid;
    grid-template-columns:minmax(145px,.7fr) 1.3fr;
    margin:0 0 22px;
}

.dades dt,.dades dd{
    padding:8px 10px;
    border-bottom:1px solid #e9e3d9;
    margin:0;
}

.dades dt{
    font-weight:bold;
    color:var(--bordeus);
}

/* TAULES */
.taula-scroll{
    overflow-x:auto;
    background:#fff;
}

table{
    border-collapse:collapse;
    width:100%;
}

th,td{
    text-align:left;
    padding:11px;
    border-bottom:1px solid #e5ded2;
}

th{
    background:var(--bordeus);
    color:#fff;
    border-bottom:3px solid var(--or);
}

/* PEU DE PÀGINA */
.peu{
    background:var(--bordeus-fosc);
    color:#fff;
    text-align:center;
    padding:22px;
    font-size:.9rem;
    border-top:4px solid var(--or);
}

.peu a{color:var(--or)}

/* ACCESSIBILITAT */
.sr-only{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
}

/* ADAPTACIÓ A MÒBILS */
@media(max-width:700px){
    .hero{padding:25px}
    .fitxa{grid-template-columns:1fr}
    .foto-fitxa img{max-height:450px}
    .stats{grid-template-columns:1fr}
    .dades{grid-template-columns:1fr}
    .dades dt{border-bottom:0;padding-bottom:0}
    .dades dd{padding-top:3px}
    .menu a{padding:12px 13px}
    .marca{font-size:24px}
}


/* Paginació de resultats */
.paginacio {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0 12px;
}

.paginacio a,
.paginacio strong {
    display: inline-block;
    min-width: 38px;
    padding: 9px 12px;
    text-align: center;
    text-decoration: none;
    border: 1px solid #C9A45C;
    border-radius: 3px;
    color: #6B1E1E;
    background: #fffdf9;
}

.paginacio a:hover,
.paginacio .pagina-actual {
    background: #6B1E1E;
    color: #fff;
    border-color: #6B1E1E;
}

.paginacio .separador-pagines {
    padding: 5px;
    color: #777;
}

.text-paginacio {
    text-align: center;
    color: #777;
    font-size: .9rem;
    margin-bottom: 30px;
}


.foto-estanteria {
    margin: 25px auto;
    text-align: center;
}

.foto-estanteria img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
}

/* Consulta privada de receptes */

.cerca-receptes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 15px;
    margin: 25px 0;
    padding: 20px;
    background: #F8F6F1;
    border: 1px solid #C9A45C;
    border-radius: 6px;
}

.cerca-receptes-camp {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cerca-receptes-camp label {
    font-weight: bold;
    color: #6B1E1E;
}

.cerca-receptes-camp input,
.cerca-receptes-camp select {
    width: 100%;
    box-sizing: border-box;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
}

.cerca-receptes-botons {
    display: flex;
    align-items: end;
    gap: 12px;
}

.cerca-receptes-botons button {
    padding: 10px 18px;
    color: white;
    background: #6B1E1E;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font: inherit;
}

.cerca-receptes-botons a {
    padding: 10px 14px;
    color: #6B1E1E;
}

.resultat-receptes {
    margin: 20px 0;
}

.graella-receptes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 22px;
    margin: 25px 0;
}

.targeta-recepta {
    overflow: hidden;
    background: #F8F6F1;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.targeta-recepta > a {
    display: block;
    text-align: center;
    background: white;
}

.targeta-recepta img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 150px;
    margin: 0 auto;
    object-fit: contain;
}

.targeta-recepta-dades {
    padding: 12px;
}

.targeta-recepta-dades h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.targeta-recepta-dades h2 a {
    color: #6B1E1E;
    text-decoration: none;
}

.targeta-recepta-dades h2 a:hover {
    text-decoration: underline;
}

.targeta-recepta-dades p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.recepta-sense-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: #777;
    background: #eee;
}

.cap-recepta {
    margin: 30px 0;
    padding: 20px;
    background: #F8F6F1;
    border-radius: 5px;
    text-align: center;
}

@media (max-width: 600px) {
    .cerca-receptes-botons {
        align-items: stretch;
        flex-direction: column;
    }

    .graella-receptes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}


/* AUTOCOMPLETAR DE DESTIL·LERIES */

.autocompletar-contenidor {
    position: relative;
    width: 100%;
}

.autocompletar-contenidor input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

.autocompletar-resultats {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 250px;
    overflow-y: auto;
}

.autocompletar-opcio {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocompletar-opcio:hover {
    background: #F8F6F1;
    color: #6B1E1E;
}

.autocompletar-buit {
    padding: 10px;
    color: #777;
}
