/* ========================================
   Global Styles — UTN FRBA Motorsport
   Compartido por todas las páginas
   ======================================== */

/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
  --color-black: #151519;
  --color-gray-dark: #1c1c21;
  --color-gray: #232328;
  --color-gray-light: #333339;
  --color-white: #fcf6e6;
  --color-white-muted: rgba(252, 246, 230, 0.7);
  --color-white-subtle: rgba(252, 246, 230, 0.5);
  --color-red: #dd0e0e;
  --color-red-hover: #bb0c0c;
  --color-red-glow: rgba(221, 14, 14, 0.3);
  --font-family: 'Unbounded', sans-serif;
  --max-width: 1600px;
  --header-height: 70px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-black);
  color: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
}

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

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

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 2px;
}

::selection {
  background-color: var(--color-red-glow);
  color: var(--color-white);
}

/* ========================================
   Header / Navigation
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(21, 21, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(252, 246, 230, 0.08);
  height: var(--header-height);
}

.header__container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 1200px) {
  .header__container {
    padding: 0 4rem;
  }
}

.header__logo {
  display: flex;
  align-items: center;
}

.header__logo-img {
  height: 30px;
  width: auto;
  object-fit: contain;
}

/* Hamburger button (mobile) */
.header__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 110;
}

.header__hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger → X animation when open */
.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(2) {
  opacity: 0;
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Nav — hidden on mobile by default */
.nav {
  display: none;
}

/* Mobile nav overlay */
.nav--open {
  display: flex;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(21, 21, 25, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99;
  padding: 2rem;
  overflow-y: auto;
}

.nav--open .nav__list {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
}

.nav--open .nav__list > li {
  width: 100%;
  border-bottom: 1px solid rgba(252, 246, 230, 0.06);
}

.nav--open .nav__link {
  display: block;
  padding: 1rem 0;
  font-size: 1.1rem;
}

.nav--open .nav__dropdown-toggle {
  padding: 1rem 0;
  font-size: 1.1rem;
  width: 100%;
  justify-content: space-between;
}

.nav--open .nav__dropdown {
  position: static;
  transform: none;
  margin-top: 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  padding: 0 0 0.5rem 1rem;
  opacity: 1;
  visibility: visible;
  display: none;
}

.nav--open .nav__dropdown[data-open="true"] {
  display: block;
}

.nav--open .nav__dropdown-link {
  padding: 0.75rem 0;
  font-size: 1rem;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-white-muted);
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--color-white);
}

/* Dropdown */
.nav__item {
  position: relative;
}

.nav__dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-white-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
}

.nav__dropdown-toggle:hover {
  color: var(--color-white);
}

.nav__dropdown-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.nav__item:hover .nav__dropdown-toggle svg,
.nav__dropdown-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  padding: 0.5rem 0;
  margin-top: 0.75rem;
  background: rgba(28, 28, 33, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(252, 246, 230, 0.1);
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Show dropdown on hover AND keyboard focus-within AND aria-expanded */
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown,
.nav__dropdown-toggle[aria-expanded="true"] + .nav__dropdown {
  opacity: 1;
  visibility: visible;
}

.nav__dropdown-link {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  color: var(--color-white-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav__dropdown-link:hover,
.nav__dropdown-link:focus-visible {
  background: rgba(252, 246, 230, 0.05);
  color: var(--color-white);
}

.header__cta {
  display: inline-flex;
}

/* Show desktop nav, hide hamburger on larger screens */
@media (min-width: 768px) {
  .nav {
    display: block;
  }

  .header__hamburger {
    display: none;
  }

  .nav--open {
    display: block;
    position: static;
    background: none;
    backdrop-filter: none;
    padding: 0;
    overflow: visible;
  }
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn--primary {
  background-color: var(--color-red);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-red-hover);
}

.btn--secondary {
  background-color: white;
  color: #0c0c0f;
  border: 1px solid rgba(252, 246, 230, 0.15);
}

.btn--secondary:hover {
  background-color: rgba(252, 246, 230, 0.05);
  color: var(--color-white);
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* ========================================
   Main content offset (for fixed header)
   ======================================== */
.main {
  padding-top: var(--header-height);
}

/* ========================================
   Footer
   ======================================== */
.footer {
  position: relative;
  z-index: 1;
  background: var(--color-black);
  border-top: 1px solid rgba(252, 246, 230, 0.06);
  padding: 3rem 1.5rem 2rem;
}

.footer__container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer__main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(252, 246, 230, 0.06);
}

@media (min-width: 768px) {
  .footer__main {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer__brand {
  display: flex;
  align-items: center;
}

.footer__logo {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__link {
  font-size: 0.9rem;
  color: var(--color-white-muted);
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--color-white);
}

.footer__bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer__copyright {
  font-size: 0.8rem;
  color: var(--color-white-subtle);
}

.footer__social {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer__social {
    justify-content: flex-end;
  }
}

.footer__social-link {
  width: 36px;
  height: 36px;
  background: var(--color-gray);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.footer__social-link:hover {
  background: var(--color-gray-light);
}

.footer__social-link svg {
  width: 18px;
  height: 18px;
  color: var(--color-white);
}

/* ========================================
   Utility Classes
   ======================================== */
.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;
}
