.site-header {
  background: #faf9f7;
  border-bottom: 1px solid rgba(60, 48, 38, 0.1);
  padding: 0.875rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(60, 48, 38, 0.04);
}

.site-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2.5rem;
}

.site-branding {
  flex: 0 0 auto;
  z-index: 1002;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.site-title:hover {
  transform: translateY(-1px);
}

.brand-logo {
  flex-shrink: 0;
}

.brand-logo img {
  display: block;
  width: 44px;
  height: 44px;
  transition: transform 0.3s ease;
}

.site-title:hover .brand-logo img {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.main-nav {
  flex: 1 1 auto;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
}

.nav-link {
  display: block;
  padding: 0.35rem 0.75rem;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  letter-spacing: 0.01em;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0.2rem;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 16px;
  height: 2px;
  background: var(--color-orange);
  border-radius: 2px;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: var(--color-text);
  background: rgba(243, 79, 41, 0.06);
}

.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-link.active {
  color: var(--color-orange);
  font-weight: 700;
}

.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dropdown-arrow {
  transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #fff;
  border: 1px solid rgba(60, 48, 38, 0.1);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(60, 48, 38, 0.12);
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  min-width: 310px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--color-text);
  text-decoration: none;
  font-family: 'Palatino Linotype', Georgia, serif;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
  background: rgba(243, 79, 41, 0.06);
  border-left-color: var(--color-orange);
  color: var(--color-orange);
}

.dropdown-menu .dd-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1.1rem;
  color: var(--color-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.dropdown-menu .dd-link:hover {
  background: rgba(243, 79, 41, 0.05);
  border-left-color: var(--color-orange);
}

.dd-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.dd-link:hover .dd-icon {
  transform: scale(1.06);
}

.dd-icon--recursos { background: rgba(243, 79, 41, 0.1); color: var(--color-orange); }
.dd-icon--calc { background: rgba(26, 123, 179, 0.1); color: var(--color-accent); }
.dd-icon--test { background: rgba(128, 90, 213, 0.1); color: #805ad5; }
.dd-icon--news { background: rgba(72, 187, 120, 0.1); color: #38a169; }
.dd-icon--libros { background: rgba(237, 137, 54, 0.1); color: #dd6b20; }

.dd-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dd-title {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  transition: color 0.2s;
  line-height: 1.2;
}

.dd-desc {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.dd-link:hover .dd-title {
  color: var(--color-orange);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
  position: relative;
}

.hamburger-line {
  width: 100%;
  height: 2.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.wb-banner {
  position: sticky;
  top: 72px;
  z-index: 999;
  background: linear-gradient(90deg,
    rgba(253, 246, 236, 0.97) 0%,
    rgba(255, 250, 243, 0.97) 50%,
    rgba(253, 246, 236, 0.97) 100%);
  background-size: 200% 100%;
  animation: wb-shimmer 6s ease infinite;
  border-bottom: 1px solid rgba(217, 79, 92, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease;
}

.wb-banner.wb-hiding {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  overflow: hidden;
  border: none;
}

@keyframes wb-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.wb-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.wb-badge {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--color-orange);
  color: #fff;
  padding: 0.18rem 0.55rem;
  border-radius: 100px;
  white-space: nowrap;
}

.wb-msg {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: rgba(60, 48, 38, 0.85);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.5s ease;
}

.wb-msg.wb-fading {
  opacity: 0;
}

.wb-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-orange);
  text-decoration: none;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(217, 79, 92, 0.35);
  border-radius: 100px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.wb-cta:hover {
  background: var(--color-orange);
  color: #fff;
  border-color: var(--color-orange);
}

.wb-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(60, 48, 38, 0.4);
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
  padding: 0;
}

.wb-close:hover {
  background: rgba(60, 48, 38, 0.08);
  color: rgba(60, 48, 38, 0.8);
}

.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0 2rem;
  background: var(--color-bg-secondary);
  border-top: 2px solid var(--color-border);
}

.site-footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-text p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0;
  text-align: center;
}

.social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px var(--color-shadow);
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px var(--color-shadow);
  background: white;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.social-link svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.social-link:hover svg {
  transform: scale(1.1);
}

.footer-legal {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  width: 100%;
}

.legal-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.legal-nav a {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-nav a:hover {
  color: var(--color-accent);
}

.legal-separator {
  color: var(--color-border);
  font-size: 0.85rem;
}

@media (max-width: 1024px) {
  .books-toast {
    display: none !important;
  }
}

.books-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 340px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(60, 48, 38, 0.14);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(60, 48, 38, 0.14);
  padding: 14px 14px 12px;
  z-index: 9999;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.books-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.books-toast-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: rgba(60, 48, 38, 0.65);
  transition: background 0.2s ease, color 0.2s ease;
}

.books-toast-close:hover {
  background: rgba(243, 79, 41, 0.08);
  color: var(--color-orange);
}

.books-toast-kicker {
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted, rgba(60, 48, 38, 0.65));
  margin-bottom: 6px;
}

.books-toast-title {
  font-family: var(--font-display, Montserrat, system-ui, sans-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text, #3c3026);
  margin-bottom: 6px;
}

.books-toast-text {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(60, 48, 38, 0.82);
  margin-bottom: 10px;
}

.books-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.books-toast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid rgba(60, 48, 38, 0.18);
  color: var(--color-text, #3c3026);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.books-toast-btn.primary {
  background: var(--color-orange);
  color: #fff;
  border-color: rgba(243, 79, 41, 0.25);
}

.books-toast-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(60, 48, 38, 0.1);
  border-color: rgba(243, 79, 41, 0.35);
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 0;
  }

  .site-header .container {
    padding: 0 1.5rem;
  }

  .brand-logo img {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid rgba(60, 48, 38, 0.12);
    box-shadow: -2px 0 16px rgba(60, 48, 38, 0.15);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav.active {
    right: 0;
  }

  .nav-links {
    flex-direction: column;
    padding: 5.5rem 0 2rem;
    gap: 0;
    align-items: stretch;
  }

  .nav-links > li {
    border-bottom: 1px solid rgba(60, 48, 38, 0.08);
  }

  .nav-links > li:last-child {
    border-bottom: none;
  }

  .nav-link {
    width: 100%;
    text-align: left;
    padding: 1.25rem 2rem;
    border-left: 3px solid transparent;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover,
  .nav-link.active {
    border-left-color: var(--color-orange);
    background: rgba(243, 79, 41, 0.08);
    color: var(--color-orange);
  }

  .nav-dropdown {
    position: static;
  }

  .nav-dropdown-toggle {
    justify-content: space-between;
    width: 100%;
  }

  .nav-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: rgba(243, 79, 41, 0.03);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-dropdown-toggle[aria-expanded="true"] + .dropdown-menu {
    max-height: 550px;
  }

  .dropdown-menu a {
    padding: 0.875rem 2rem 0.875rem 3rem;
    font-size: 0.95rem;
  }

  .dropdown-menu .dd-link {
    padding: 0.9rem 1.5rem 0.9rem 1.25rem;
    gap: 0.7rem;
  }

  .dd-icon {
    width: 30px;
    height: 30px;
  }

  .dd-title {
    font-size: 0.9rem;
  }

  .dd-desc {
    font-size: 0.72rem;
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
    background: var(--color-orange);
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
    background: var(--color-orange);
  }

  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(60, 48, 38, 0.4);
    z-index: 999;
  }

  .menu-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
  }

  .wb-banner {
    position: relative;
    top: auto;
  }

  .wb-inner {
    height: 40px;
    padding: 0 1rem;
    gap: 0.5rem;
  }

  .wb-msg {
    font-size: 0.78rem;
  }

  .wb-cta {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
  }
}

@media (max-width: 600px) {
  .site-footer {
    padding: 2rem 0 1.5rem;
  }

  .social-links {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }

  .social-link {
    justify-content: center;
    width: 100%;
  }

  .legal-nav {
    font-size: 0.8rem;
  }

  .legal-separator:last-of-type {
    display: none;
  }
}

@media (max-width: 480px) {
  .site-header .container {
    padding: 0 1rem;
  }

  .main-nav {
    width: 85%;
    max-width: 320px;
  }

  .nav-link {
    padding: 1.125rem 1.75rem;
    font-size: 0.95rem;
  }

  .dropdown-menu a {
    padding: 0.875rem 1.75rem 0.875rem 2.75rem;
  }
}

@media (max-width: 420px) {
  .wb-msg {
    display: none;
  }

  .wb-inner {
    justify-content: center;
    gap: 0.75rem;
    position: relative;
  }

  .wb-cta {
    font-size: 0.8rem;
    padding: 0.35rem 1rem;
  }

  .wb-close {
    position: absolute;
    right: 0.75rem;
  }
}

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

  .footer-text p {
    text-align: left;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}
