/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background-color: #f5f5f5;
  color: #1a1a1a;
}

/* ===== Colores del Rayo Vallecano ===== */
:root {
  --rayo-gold: #ccb800;
  --rayo-red: #d50000;
  --rayo-black: #111;
  --rayo-white: #ffffff;
  --surface: #ffffff;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* ===== Layout general ===== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ===== Header ===== */
header {
  background-color: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.top {
  max-width: 1100px;
  margin: 0; 
  display: flex;
  align-items: center;
}

.logo {
  margin-left: 10rem;
  width: 70px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
}

/* ===== Nav ===== */
.nav {
  max-width: 1100px;
  margin: 0;
  margin-left: 2rem; 
  flex: 1; 
}

.nav_list {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav_link {
  text-decoration: none;
  color: var(--rayo-black);
  font-weight: 500;
  position: relative;
  font-size: 20px;
}

.nav_link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 2px;
  background-color: var(--rayo-red);
  transition: width 0.2s ease;
}

.nav_link:hover::after {
  width: 100%;
}

/* ===== Secciones ===== */
.section-header {
  margin-bottom: 1.5rem;
  background-color: var(--rayo-red);
  border-radius: 0.5rem;
  padding: 20px 1.5rem;
}

.section-header_title {
  font-size: 2rem;
  margin-bottom: 0.25rem;
  color: var(--rayo-white);
}

/* ===== Hero (Flexbox) ===== */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 2rem 0;
  align-items: center;
}

.hero_content {
  flex: 1 1 260px;
}

.hero_title {
  text-shadow: #111 2px 2px 2px;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.hero_subtitle {
  margin-bottom: 1rem;
  color: var(--rayo-red);
  text-shadow: 2px 2px 2px rgb(0, 0, 0);
  font-size: 1.2rem;
  font-weight: 700;
}

.hero_button {
  background-color: var(--rayo-red);
  color: var(--rayo-white);
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.hero_image-wrapper {
  flex: 1 1 260px;
  max-width: 480px;
  background-color: var(--surface);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero_image {
  width: 100%;
  display: block;
}

.hero_caption {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #555;
}

/* ===== Productos (Grid) ===== */
.products {
  margin: 3rem 0;
}

.products_grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.product-card {
  background-color: var(--surface);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.product-card_image {
  width: 100%;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-card_title {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.product-card_description {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.product-card_price {
  font-weight: 600;
  font-size: 30px;
  color: var(--rayo-red);
  margin-bottom: 0.75rem;
}

.product-card_button {
  margin-top: auto;
  align-self: flex-start;
  background-color: var(--rayo-black);
  color: var(--rayo-white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}
.product-card_button:hover {
  background-color: var(--rayo-red);
  transition: background-color 0.3s ease;
}
.section-products_title {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  background: var(--rayo-white);
  padding: 10px;
  border-radius: 5px;
}

/* ===== Galería ===== */
.gallery {
  margin: 3rem 0;
}

.gallery_viewer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gallery_figure {
  flex: 1;
  background-color: var(--surface);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gallery_image {
  width: 100%;
  display: block;
}

.gallery_caption {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #555;
}

.gallery_control {
  background-color: var(--rayo-red);
  color: var(--rayo-white);
  border: none;
  border-radius: 999px;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Blog ===== */
.blog {
  margin: 3rem 0;
}

.blog-post {
  background-color: var(--surface);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.blog-post_title {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.blog-post_meta {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.75rem;
}

.blog-post_excerpt {
  margin-bottom: 0.75rem;
}

.blog-post_toggle {
  background-color: transparent;
  border: 1px solid var(--rayo-red);
  color: var(--rayo-red);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.blog-post_content {
  margin-top: 0.5rem;
  color: #444;
}

/* ===== Contacto ===== */
.contact {
  margin: 3rem 0;
}

.contact-form {
  background-color: var(--surface);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.contact-form_field {
  margin-bottom: 1rem;
}

.contact-form_label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.contact-form_input,
.contact-form_textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
  padding: 0.5rem 0.6rem;
  font: inherit;
}

.contact-form_input:focus,
.contact-form_textarea:focus {
  outline: 2px solid var(--rayo-red);
  border-color: transparent;
}

.contact-form_button {
  background-color: var(--rayo-red);
  color: var(--rayo-white);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.contact-form_button:hover {
  background-color: #000000;
  transition: background-color 0.2s ease;
} 

.contact-form_error {
  display: block;
  font-size: 0.8rem;
  color: #b40000;
  margin-top: 0.25rem;
}

.contact-form_success {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #15803d;
}

/* ===== Footer ===== */
.footer {
  background-color: var(--rayo-black);
  color: #eee;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

.footer_text {
  margin: 0;
  color: inherit;
  font-weight: 500;
}

/* ===== Carrusel de productos ===== */

.products-carousel {
  position: relative;
  display: flex;
  align-items: center;
  margin: 2rem 0;
}

.products-carousel_viewport {
  overflow: hidden;
  width: 100%;
}

.products-carousel_track {
  display: flex;
  gap: 1.6rem;
  transition: transform 0.5s ease;
  margin: 10px 0 10px 0;
}

.product-card {
  min-width: 300px;
  max-width: 300px;
  flex-shrink: 0;
}

.products-carousel_control {
  background-color: var(--rayo-red);
  color: var(--rayo-white);
  border-radius: 5px;
  border: none;
  width: 3.4rem;
  height: 3.3rem;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.products-carousel_control--prev {
  margin-right: 0.5rem;
}

.products-carousel_control--next {
  margin-left: 0.5rem;
}

/* ===== HERO CARRUSEL ===== */

.hero-carousel {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.hero-carousel_slides {
  display: flex;
  width: 300%;
  height: 100%;
  animation: heroSlide 12s infinite linear;
}

.hero-carousel_slide {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.hero-carousel_content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--rayo-white);
  text-shadow: 0 4px 10px rgba(0,0,0,0.7);
}

.hero-carousel_content .hero_title {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.hero-carousel_content .hero_subtitle {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* ===== HERO SLIDER ===== */

.hero-slider {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  filter: opacity(80%);
}

.hero-slider_slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 2s ease-in-out;
}

.hero-slider_slide.active {
  opacity: 1;
}

.hero-slider_content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--rayo-white);
  text-shadow: 0 4px 10px rgba(0,0,0,0.7);
}

.hero-slider_content .hero_title {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.hero-slider_content .hero_subtitle {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* ===== Responsividad ===== */
@media (max-width: 900px) {
  .products_grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .products_grid {
    grid-template-columns: 1fr;
  }

  .gallery_viewer {
    flex-direction: column;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
  }

  .nav--open {
    display: block;
  }

  .nav_list {
    flex-direction: column;
    padding: 0.5rem 0;
  }
}
