/*
 * Theme Name:      GeneratePress Child
 * Theme URI:       https://rosberg.click/
 * Description:     Tema hijo para el sitio web de Rosberg.click
 * Author:          Tu nom
 * Author URI:      https://rosberg.click
 * Template:        generatepress
 * Version:         1.0.3
*/

/* FADE IN / OUT */
html.fade-preload body {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.fade-transition {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.fade-transition.fade-in {
  opacity: 1;
}

/* ============================================================
   0) Resets i utilitats
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ============================================================
   1) Base i fons
   ============================================================ */
html,
body {
  height: 100%;
  background: transparent !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("https://rosberg.click/wp-content/uploads/2025/08/PicOptimizerXpress_20250817T140638.webp")
    center center / cover no-repeat;
  background-color: #000;
  background-attachment: fixed;
  z-index: -1;
  pointer-events: none;
}

/* Solució específica per categories */
.tax-menu_categoria body::before {
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
}

/* Header i footer transparents o ocults */
.site-header,
.page-header {
  background: transparent !important;
}
.site-footer {
  display: none !important;
}

/* ============================================================
   2) Capçalera i elements Gutenberg
   ============================================================ */
.site-header {
  position: fixed !important;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  z-index: 1000 !important;
  padding: 10px;
}
.site-header .main-navigation {
  display: none !important;
}
.site-logo {
  max-height: 80px !important;
  width: auto;
}

.wp-block-columns {
  padding: 0 12px;
}
.wp-block-button {
  margin: 0 8px;
}
a.wp-block-button__link.wp-element-button {
  padding: 18px 24px !important;
}

/* ============================================================
   3) Catàleg / arxius de categories
   ============================================================ */
.tax-menu_categoria .site-main .page-header {
  text-align: center !important;
  color: #fff !important;
  padding: 120px 0 10px !important;
  z-index: 1 !important;
}
.tax-menu_categoria .site-main .page-header h1 {
  font-size: 1.5em !important;
  font-weight: 400 !important;
  letter-spacing: 1.5px !important;
  margin: 30px 0 0 !important;
}
.subtitulo-categoria {
  font-size: 1em;
  font-weight: 200;
  color: #fff;
  margin: 10px 0 0;
}

.plat-archive-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 100px;
}
.plat-item {
  text-decoration: none;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  padding-bottom: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  -webkit-tap-highlight-color: transparent;
}
.plat-image-container {
  height: 150px;
  overflow: hidden;
}
.plat-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.plat-title {
  font-size: 1em;
  font-weight: 700;
  margin: 10px 0;
}
.plat-price {
  font-size: 1em !important;
  font-weight: 200;
  color: #ccc;
  display: block;
}

.plat-item .plat-title,
.plat-item:link .plat-title,
.plat-item:visited .plat-title,
.plat-item:hover .plat-title,
.plat-item:focus .plat-title,
.plat-item:active .plat-title,
.tax-menu_categoria .plat-item,
.tax-menu_categoria .plat-item:link,
.tax-menu_categoria .plat-item:visited,
.tax-menu_categoria .plat-item:hover,
.tax-menu_categoria .plat-item:focus,
.tax-menu_categoria .plat-item:active {
  color: #fff !important;
  text-decoration: none !important;
}

#titulo-pagina-container {
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
#titulo-pagina-container.oculto {
  opacity: 0;
  transform: translateY(-50px);
}

@media (max-width: 480px) {
  .tax-menu_categoria .site-main .page-header {
    padding-top: 96px !important;
    margin-bottom: 32px !important;
  }
}

/* ============================================================
   4) Fitxa individual (single-carta.php)
   ============================================================ */
.single-carta .site-header {
  display: none !important;
}

.single-plat-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  color: #fff;
  text-align: center;
}
.single-plat-image-container {
  width: 100%;
  height: 230px;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 20px;
}
.single-plat-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.single-plat-title {
  font-size: 1.6em;
  margin: 0 0 5px;
  color: #fff !important;
}
.single-plat-description {
  font-size: 1em;
  margin: 0 auto 10px !important;
  line-height: 1.5;
}

.precios-plato-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  font-size: 1em !important;
  font-weight: 400 !important;
  margin: 0 !important;
}
.precio-plato {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 15px;
  border-radius: 5px;
  white-space: nowrap;
}

.atributos-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}
.atributo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 60px;
}
.atributo-icono {
  width: 40px;
  height: auto;
  margin-bottom: 5px;
}
.atributo-nombre {
  font-size: 0.7em;
  color: #ccc;
  font-weight: 400;
  text-transform: uppercase;
}

/* ============================================================
   5) Menú flotant inferior
   ============================================================ */
.menu-flotante-inferior {
  position: fixed !important;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  z-index: 9999;
  background: #000 !important;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}
.boton-flotante-volver,
.boton-flotante-subir {
  flex: 1 1 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 1.2em;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-sizing: border-box;
}
.boton-flotante-volver {
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}
.boton-flotante-volver:hover,
.boton-flotante-subir:hover {
  background: rgba(255, 255, 255, 0.1);
}
.boton-flotante-volver .texto-boton {
  margin-left: 5px;
}
.boton-flotante-subir .texto-boton {
  margin-right: 5px;
}
.boton-flotante-subir {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.boton-flotante-subir.visible {
  opacity: 1;
  pointer-events: auto;
}

.separate-containers .site-main {
  margin: 0;
}

/* ============================================================
   6) Millores finals aplicades (accessibilitat, usabilitat)
   ============================================================ */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  font-size: 16px;
  line-height: 1.6;
}

button,
a.button,
a.wp-block-button__link,
.boton-flotante-volver,
.boton-flotante-subir {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a:focus,
button:focus {
  outline: 2px dashed #fff;
  outline-offset: 3px;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 480px) {
  .boton-flotante-volver,
  .boton-flotante-subir {
    padding: 16px 8px;
    font-size: 1.3em;
  }
}
