/* ============================================
   TOT CREATIU - Estilos generales
   ============================================ */

/* --- Variables CSS --- */
:root {
  /* Colores */
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;
  --color-bg-dark: #3d5a4a;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-white: #ffffff;
  --color-link: #333333;
  --color-link-hover: #555555;
  --color-border: #e0e0e0;
  --color-accent: #c8a96e;
  --color-success: #4caf50;
  --color-error: #f44336;

  /* Tipografía */
  --font-family: 'Lato', sans-serif;

  /* Espaciado */
  --container-max: 1200px;
  --container-padding: 2rem;
  --header-height: 80px;
  --section-padding: 5rem 0;
  --gallery-gap: 1rem;

  /* Transiciones */
  --transition: 0.3s ease;

  /* Sombras */
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* --- Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-link-hover);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 1rem;
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin: 0 0 1rem;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* --- Contenedor --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  box-shadow: var(--shadow);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  height: 75px;
  width: auto;
}

.main-nav .nav-list {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text);
  padding: 0.5rem 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
  opacity: 0.7;
}

.nav-link--cta {
  background-color: var(--color-bg-dark);
  color: var(--color-text-white);
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
}

.nav-link--cta:hover {
  color: var(--color-text-white);
  opacity: 0.85;
}

.nav-link--cta.active {
  background-color: transparent;
  color: var(--color-bg-dark);
  border: 2px solid var(--color-bg-dark);
  opacity: 1;
}

/* Hamburger (CSS only) */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
}

.nav-toggle-label span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--color-text);
  transition: var(--transition);
}

/* --- Hero --- */
.hero {
  height: 450px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto 1rem;
  line-height: 1.8;
}

/* --- Bloque sobre nosotros --- */
.about-block {
  max-width: 800px;
  margin: 0 auto;
  background-color: #ebf3ef;
  border-color: #000 #000 #000 #3d5a4a;
  border-style: none none none dotted;
  border-width: 0 0 0 3px;
  padding: 1.5rem 2rem;
  text-align: center;
}

.about-block p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-light);
  margin: 0 0 1rem;
}

.about-block p:last-child {
  margin-bottom: 0;
}

/* --- Secciones --- */
.section {
  padding: var(--section-padding);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 300;
  font-size: 2rem;
}

.section-text {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-light);
}

/* --- Galería --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gallery-gap);
}

.gallery-item {
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  transition: transform var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Galería featured (homepage) */
.gallery--featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 150px 150px;
  gap: var(--gallery-gap);
}

.gallery--featured .gallery-item:first-child {
  grid-row: 1 / 3;
}

.gallery--featured .gallery-item:first-child img {
  aspect-ratio: auto;
  height: 100%;
}

.gallery--featured .gallery-item img {
  aspect-ratio: auto;
  height: 100%;
}

/* Lightbox CSS-only */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox:target {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  color: white;
  text-decoration: none;
  line-height: 1;
  z-index: 1001;
}

.lightbox-close:hover {
  color: #ccc;
}

/* --- Formulario de contacto --- */
.contact-section {
  padding: var(--section-padding);
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-text);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn:hover {
  opacity: 0.85;
}

.btn-submit {
  background-color: var(--color-text);
  color: var(--color-text-white);
  width: 100%;
}

.form-message {
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  text-align: center;
}

.form-message--success {
  background-color: #e8f5e9;
  color: var(--color-success);
}

.form-message--error {
  background-color: #ffebee;
  color: var(--color-error);
}

/* --- Páginas legales --- */
.legal-section {
  padding: var(--section-padding);
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.legal-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.legal-content p {
  color: var(--color-text-light);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content ul li {
  color: var(--color-text-light);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--color-bg-dark);
  color: var(--color-text-white);
  padding: 3rem 0 1.5rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-heading {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-col a:hover {
  color: var(--color-text-white);
}

.footer-col p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(0.75rem);
  -webkit-backdrop-filter: blur(0.75rem);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.cookie-banner__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin: 0;
  min-width: 200px;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 0.5rem 1.25rem;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--color-text);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}

.cookie-btn--accept {
  background-color: var(--color-text);
  color: var(--color-text-white);
}

.cookie-btn--accept:hover {
  opacity: 0.85;
}

.cookie-btn--reject,
.cookie-btn--configure {
  background-color: transparent;
  color: var(--color-text);
}

.cookie-btn--reject:hover,
.cookie-btn--configure:hover {
  background-color: var(--color-bg-alt);
}

/* Cookie Preferences Modal */
.cookie-prefs {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-prefs__bg {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(0.75rem);
  -webkit-backdrop-filter: blur(0.75rem);
}

.cookie-prefs__panel {
  position: relative;
  background-color: var(--color-bg);
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.cookie-prefs__scroll {
  padding: 2rem;
  overflow-y: auto;
  max-height: 80vh;
}

.cookie-prefs__scroll h3 {
  margin-bottom: 1.5rem;
}

.cookie-prefs__category {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cookie-prefs__category:last-of-type {
  border-bottom: none;
}

.cookie-prefs__category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.cookie-prefs__category-header label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.cookie-prefs__always-on {
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-weight: 400;
}

.cookie-prefs__category p {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.6;
}

.cookie-prefs__actions {
  margin-top: 1.5rem;
  text-align: center;
}

/* --- Responsive --- */
@media screen and (max-width: 991px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .footer-inner {
    gap: 1.5rem;
  }
}

@media screen and (max-width: 767px) {
  :root {
    --container-padding: 1.25rem;
    --section-padding: 3rem 0;
  }

  /* Hamburger menu */
  .nav-toggle-label {
    display: flex;
  }

  .main-nav .nav-list {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    flex-direction: column;
    padding: 1rem var(--container-padding);
    box-shadow: var(--shadow);
    gap: 0;
  }

  .nav-toggle:checked ~ .main-nav .nav-list {
    display: flex;
  }

  .nav-link {
    padding: 0.75rem 0;
    display: block;
    border-bottom: 1px solid var(--color-border);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery--featured {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .gallery--featured .gallery-item:first-child {
    grid-row: auto;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .cookie-banner__inner {
    flex-direction: column;
    text-align: center;
  }

  .cookie-banner__actions {
    justify-content: center;
  }
}

@media screen and (max-width: 479px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .cookie-banner__actions {
    flex-direction: column;
    width: 100%;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
  }

  .section-title {
    font-size: 1.5rem;
  }
}
