/* =========================================================
   VARIABLES (colors, mides A4, tipografia)
   ========================================================= */
:root{
  --a4w: 210mm;
  --a4h: 297mm;

  --bg-beige: #E1E1C8;
  --bg-gray:  #F2F2F2;
  --bg-teal:  #467886;
  --bg-white: #ffffff;
  --bg-green: #E1E1C8;
  --bg-pale-green: #D1D1BC;

  --font: "Aptos", "Inter", "Segoe UI", Arial, sans-serif;
  --ink: #2b2b2b;
  --muted: #6b7280;
  --line: #cfcfcf;

  --pad: 10mm;
  --cert-caixa-h: 80px;
}

/* Helpers de fons */
.bg-white{ background: var(--bg-white); }
.bg-green{ background: var(--bg-green); }
.bg-beige{ background: var(--bg-beige); }
.bg-gray{ background: var(--bg-gray); }
.bg-pale-green{ background: var(--bg-pale-green); }

/* Estil global links */
a{
  color: var(--bg-teal);
  text-decoration: none;
}
a:hover{
  text-decoration: underline;
}

/* =========================================================
   BASE (pantalla / responsive)
   ========================================================= */
*{ box-sizing: border-box; }

html, body{
  overflow-x: hidden;
}

body{
  margin:0;
  font-family: var(--font);
  color: var(--ink);
  background: #5253491c;
}

.wrap{ display:grid; place-items:start center; padding: 18px; }

.sheet{
  width: var(--a4w);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  max-width: 100%;
}

@media screen and (max-width: 830px){
  .wrap{ padding: 10px; }
  .sheet{ width: 100%; box-shadow: none; }
}

.section{ margin:0; padding:0; }

.inner{ padding: 12px var(--pad); }

@media screen and (max-width: 830px){
  .inner{ padding: 12px 14px; }
}

/* =========================================================
   TIPOGRAFIA I ESPAIATS
   ========================================================= */
h1{
  margin:0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .2px;
}

h2{
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #3a3a3a;
}

p{ margin:0; }

.p12{ font-size: 12px; line-height: 1.35; }
.p11{ font-size: 11px; line-height: 1.35; }

.subtitle{
  margin-top: 6px;
  font-size: 14px;
  font-style: italic;
  color: #000000;
}

.ref{
  margin-top: 4px;
  font-size: 14px;
  font-style: italic;
  color: #000000;
}

.muted{ color: var(--muted); }
.sp8{ margin-top: 8px; }
.sp10{ margin-top: 10px; }
.sp12{ margin-top: 12px; }

/* =========================================================
   PRINT A4 (sense marges)
   ========================================================= */

@page { size: A4; margin: 0; }

@media print{

  html, body{
    background:#fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  *{
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a{
    color: inherit;
    text-decoration: none;
  }

  .wrap{
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    background: #fff !important;
  }

  .sheet{
    max-width: 100% !important;
    width: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .page1,
  .page2,
  .page1-spacer,
  .page2-spacer{
    background: #fff !important;
  }

  /* =========================================================
     FONS DE SECCIONS A SANG, SENSE MOURE EL CONTINGUT
     ========================================================= */
  .section.bg-beige,
  .section.bg-gray,
  .section.bg-green,
  .section.bg-pale-green,
  footer.footer{
    position: relative !important;
    isolation: isolate !important;
    overflow: visible !important;
    background: transparent !important;
  }

  .section.bg-beige::before,
  .section.bg-gray::before,
  .section.bg-green::before,
  .section.bg-pale-green::before,
  footer.footer::before{
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -10mm;
    right: -10mm;
    z-index: 0;
  }

  .section.bg-beige > *,
  .section.bg-gray > *,
  .section.bg-green > *,
  .section.bg-pale-green > *,
  footer.footer > *{
    position: relative !important;
    z-index: 1 !important;
  }

  .section.bg-beige::before{
    background: var(--bg-beige) !important;
  }

  .section.bg-gray::before{
    background: var(--bg-gray) !important;
  }

  .section.bg-green::before{
    background: var(--bg-green) !important;
  }

  .section.bg-pale-green::before{
    background: var(--bg-pale-green) !important;
  }

  /* Franja idiomes no necessària en versió impresa */
  #sec-idiomes{
    display: none !important;
  }

  /* Salts / evitar talls */
  .page-break{
    break-before: page;
  }

  .avoid-break{
    break-inside: avoid;
    page-break-inside: avoid;
  }

  section.section,
  footer.footer,
  table, tr, td, th,
  .plans, .gallery, .links-row,
  .icons-row-left, .icons-row-right{
    break-inside: avoid;
    page-break-inside: avoid;
  }

/* =========================================================
                SECCIO PRINT DEL HERO
========================================================= */

  #sec-imatge-principal{
    position: relative !important;
    flex: 0 1 400px;
    max-height: 400px;
    min-height: 0;
    overflow: hidden !important;
  }

  #sec-imatge-principal .inner{
    overflow: hidden !important;
  }

  .hero{
    height: 100% !important;
    max-height: 400px !important;
    background: #fff !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
  }

  .hero-wrap{
    background: #fff !important;
    width: 100% !important;
    text-align: center !important;
  }

  .hero-img-box{
    display: inline-block !important;
    line-height: 0 !important;
    max-width: 100% !important;
  }

  .hero-main-img{
    display: block !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    max-height: 400px !important;
    object-fit: contain !important;
  }

  .hero-logo-overlay{
    position: absolute !important;
    left: var(--pad) !important;
    bottom: 12px !important;
    width: auto;
    height: 60px;
    display: block !important;
    opacity: 1 !important;
  }

  .hero-pefc-overlay{
    position: absolute;
    right: var(--pad);
    bottom: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }

  .hero-pefc-overlay img{
    display: block;
    height: 60px;
    width: auto;
  }


/* =========================================================
   SECCIÓ NORMATIVA / CERTIFICACIONS A PRINT
   ========================================================= */
#sec-NormCert .nc-row{
  grid-template-columns: auto 1fr auto !important;
}

#sec-NormCert .nc-text{
  min-width: 0 !important;
  max-width: 420px !important;
  width: 100% !important;
  margin: 0 auto !important;
}

#sec-NormCert .nc-icons{
  flex-wrap: nowrap !important;
  min-width: 0 !important;
}

/* =========================================================
                     GALERIA -> 3 COLUMNES 
========================================================= */

  #sec-Galeria .gallery{
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0 !important;
  }

  #sec-Galeria .gallery img{
    width: 100% !important;
    height: 45mm !important;
    object-fit: cover !important;
    display: block !important;
  }

  #sec-Galeria{
    margin-top: 0;
  }

  .page1{
    display: flex;
    flex-direction: column;
    height: var(--a4h);
    overflow: hidden;
  }

  .page1-spacer{
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .page1-bottom{
    margin-top: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .page2{
    display: flex;
    flex-direction: column;
    height: var(--a4h);
    overflow: hidden;
  }

  .page2-spacer{
    flex: 1 1 auto;
    overflow: hidden;
  }

  .page2-bottom{
    margin-top: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* =========================================================
   SECCIÓ IMATGE PRINCIPAL (HERO)
   ========================================================= */
#sec-imatge-principal{
  position: relative;
  overflow: hidden;
}

#sec-imatge-principal .inner{
  overflow: hidden;
}

.hero{
  background: #fff !important;
  display: grid;
  place-items: center;
  padding: 0;
}

.hero-wrap{
  background: #fff !important;
  width: 100%;
  text-align: center;
}

.hero-img-box{
  line-height: 0;
  max-width: 100%;
}

.hero-main-img{
  max-width: 100%;
  max-height: 300px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.hero-logo-overlay{
  position: absolute;
  left: var(--pad);
  bottom: 12px;
  width: auto;
  height: 60px;
  display: block;
  opacity: 1;
}

.hero-pefc-overlay{
  position: absolute;
  right: var(--pad);
  bottom: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.hero-pefc-overlay img{
  display: block;
  height: 60px;
  width: auto;
}

/* =========================================================
   SECCIÓ CAPÇALERA + LOGO
   ========================================================= */
.head{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 0;
}

.logo-ph{
  width: 100px;
  display:grid;
  place-items:start;
}

.logo-img{
  max-width:100%;
  max-height:100%;
}

/* =========================================================
   SECCIÓ PLÀNOLS
   ========================================================= */
.plans{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.plans img{
  width: 100%;
  height: auto;
  display:block;
}

/* =========================================================
   SECCIÓ NORMATIVA
   ========================================================= */
#sec-NormCert{
  padding: 10px var(--pad);
}

#sec-NormCert .nc-row{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 14px;
}

#sec-NormCert .nc-logo{
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#sec-NormCert .nc-logo a{
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

#sec-NormCert .nc-logo img{
  display: block;
  height: 60px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

#sec-NormCert .nc-text{
  min-width: 0;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

#sec-NormCert .nc-text p{
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

#sec-NormCert .nc-icons{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

#sec-NormCert .nc-icons a{
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

#sec-NormCert .nc-icons img{
  display: block;
  height: 60px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

#sec-NormCert .nc-certs-icons{
  display:flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 15px;
}

#sec-NormCert .nc-certs-caixa{
  height: 60px;
  display: inline-grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: end;
  width: auto;
  flex: 0 0 auto;
}

#sec-NormCert .nc-certs-caixa a{
  display:flex;
  align-items:center;
  justify-content:center;
  line-height: 0;
  text-decoration: none;
  height: 100%;
  width: auto;
}

#sec-NormCert .nc-certs-caixa img{
  display:block;
  height: 100%;
  width: auto;
  object-fit: contain;
}

#sec-NormCert .nc-certs-label{
  margin-top: 2px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  color: #000000;
}

@media screen and (max-width: 830px){
  #sec-NormCert .nc-row{
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  #sec-NormCert .nc-logo{
    grid-column: auto;
    justify-content: center;
  }

  #sec-NormCert .nc-text{
    grid-column: auto;
    min-width: auto;
    max-width: 100%;
  }

  #sec-NormCert .nc-text p{
    text-align: center;
  }

  #sec-NormCert .nc-icons{
    grid-column: auto;
    justify-content: center;
  }

  #sec-NormCert .nc-certs-icons{
    gap: 5px;
}
}


/* =========================================================
   SECCIÓ LINKS INTERÈS
   ========================================================= */
.links-row{
  background:#fff;
  display:flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 8px var(--pad) 12px var(--pad);
  font-size: 12px;
}

.links-row a{
  text-align: center;
  color: var(--bg-teal);
  font-style: italic;
  display:block;
}

.link-icono{
  opacity: 60%;
  height: 8mm;
  display:block;
  margin: 0 auto 2mm;
}

/* =========================================================
   ESTIL GENÈRIC TAULES
   ========================================================= */
table{
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: rgba(255,255,255,0);
}

th, td{
  border-top: 1px solid rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(0,0,0,0.15);
  padding: 0px 5px;
  vertical-align: middle;
  text-align: center;
}

td + td{
  border-left: 1px solid rgba(0,0,0,0.04);
}

th{
  background: rgba(0,0,0,0.07);
}

th + th{
  border-left: 1px solid rgba(0,0,0,0.04);
}

.col-name{ width: 25%; }
.col-img{ width: 18%; text-align: right; }

.comp-link{
  color: var(--bg-teal);
  text-decoration: underline;
  font-style: italic;
  font-size: 12px;
}

td img{
  max-width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 1024px){
  table, table th, table td{ font-size: 10.5px; }
}

@media (max-width: 600px){
  table, table th, table td{ font-size: 10px; }
}

.norm-links{
  font-size: 12px;
  font-style: italic;
  color: var(--bg-teal);
}

.norm-links a{
  color: var(--bg-teal);
  text-decoration: underline;
}

/* =========================================================
   SECCIÓ PRESCRIPCIONS
   ========================================================= */
.mono{
  font-family: var(--font);
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.35;
}

/* =========================================================
   SECCIÓ FAQ
   ========================================================= */
.faq-q{
  font-weight: 700;
  font-size: 11px;
  margin-top: 10px;
}

.faq-a{
  font-size: 11px;
  color:#4b5563;
  margin-top: 4px;
}

/* =========================================================
   SECCIÓ IMATGE EXTRA
   ========================================================= */
#sec-imatge-extra{
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#sec-imatge-extra .inner{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

#sec-imatge-extra .img-full-box{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sec-imatge-extra img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* =========================================================
   SECCIÓ GALERIA
   ========================================================= */
.gallery{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}

.gallery img{
  width:100%;
  height: 55mm;
  object-fit: cover;
  display:block;
}

@media (max-width: 830px){
  .gallery{ grid-template-columns: 1fr; }
  .gallery img{ height: 40mm; }
}

/* =========================================================
   SECCIÓ FOOTER
   ========================================================= */
#sec-Footer{
  font-size: 12px;
  color:#4b5563;
}

#sec-Footer .inner{
  padding: 10px var(--pad);
}

#sec-Footer .footer-main{
  display: grid;
  grid-template-columns: auto auto auto auto;
  column-gap: 16px;
  align-items: center;
}

#sec-Footer .footer-col{
  min-width: 0;
}

#sec-Footer .footer-col.logo{

  display:flex;
  align-items:center;
  justify-content:flex-start;
}

#sec-Footer .footer-col.logo img{
  display:block;
  max-height:60px;
  width:auto;
}

#sec-Footer .footer-col.company{

  text-align: right;
  line-height: 1.35;
}

#sec-Footer .footer-col.contact{

  text-align: left;
  line-height: 1.35;
}

#sec-Footer .footer-title{
  display: block;
  font-weight: 500;
  font-style: italic;
  color: #000000;
}

#sec-Footer .footer-col.contact a{
  color: var(--bg-teal);
}

#sec-Footer .footer-col.certs{

  display:flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

#sec-Footer .certs-text{
  text-align: center;
  font-size: 12px;
  color:#2b2b2b;
  line-height: 1.2;
}

#sec-Footer .certs-icons{
  display:flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 15px;
}

#sec-Footer .certs-icons-caixa{
  height: var(--cert-caixa-h);
  display: inline-grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: end;
  width: auto;
  flex: 0 0 auto;
}

#sec-Footer .certs-icons-caixa a{
  display:flex;
  align-items:center;
  justify-content:center;
  line-height: 0;
  text-decoration: none;
  height: 100%;
  width: auto;
}

#sec-Footer .certs-icons-caixa img{
  display:block;
  height: 100%;
  width: auto;
  object-fit: contain;
}

#sec-Footer .certs-icons-caixa .certs-label{
  margin-top: 2px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  color: #000000;
}

#sec-Footer .footer-filetag{
  margin-top: 8px;
  text-align: center;
  font-size: 8px;
  color:#4b5563;
}

@media screen and (max-width: 830px){
  #sec-Footer .footer-main{
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  #sec-Footer .certs-icons{
    justify-content: center;
    gap: 5px;
  }

  #sec-Footer .footer-col.logo,
  #sec-Footer .footer-col.company,
  #sec-Footer .footer-col.contact,
  #sec-Footer .footer-col.certs{
    grid-column: auto;
    text-align:center;
  }

  #sec-Footer .footer-col.certs{
    justify-content:center;
    align-items: center;
  }

  #sec-Footer .footer-col{
    grid-column: auto !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

/* =========================================================
   SECCIÓ FILETAG
   ========================================================= */
#sec-Filetag{
  font-size: 9px;
}

#sec-Filetag .filetag{
  text-align: center;
  line-height: 1.2;
}

#sec-Filetag .inner{
  padding: 6px var(--pad);
}

/* =========================================================
   SECCIÓ IDIOMES
   ========================================================= */
.langs{
  display:flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  color: #7b8794;
  padding-top: 8px;
  padding-bottom: 8px;
}

.langs a{
  color: inherit;
  text-decoration: none;
  font-style: italic;
}

.langs a[aria-current="true"]{
  color: #111;
  text-decoration: underline;
  font-weight: 700;
}

