/* ============================================
   COMPONENTS — Nav, Buttons, Cards, Footer
   ============================================ */

/* === NAVEGACION === */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-nav);
  padding: var(--space-lg) 0;
  transition: all var(--duration-slow) var(--ease-out-expo);
}

.main-nav.scrolled {
  padding: var(--space-md) 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  height: 50px;
  width: auto;
  transition: height var(--duration-normal) var(--ease-smooth);
}

.main-nav.scrolled .nav__logo {
  height: 38px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  transition: color var(--duration-fast) var(--ease-smooth);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-primary);
  transition: width var(--duration-normal) var(--ease-out-expo);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-primary);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__cta {
  margin-left: var(--space-lg);
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: calc(var(--z-overlay) + 10);
}

.nav__hamburger span {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--duration-normal) var(--ease-out-expo);
  transform-origin: center;
}

.nav__hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav__hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav__hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile overlay */
.nav__mobile-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-slow) var(--ease-out-expo);
}

.nav__mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.nav__mobile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.nav__mobile-link {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  color: var(--color-text);
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-normal) var(--ease-out-expo);
}

.nav__mobile-overlay.active .nav__mobile-link {
  opacity: 1;
  transform: translateY(0);
}

/* === BOTONES === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border: none;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-bg);
  box-shadow: var(--shadow-glow-sm);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: var(--color-bg);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn--outline:hover {
  background: rgba(var(--color-primary-rgb), 0.1);
  transform: translateY(-2px);
  color: var(--color-primary-light);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  padding: var(--space-sm) 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: var(--weight-medium);
}

.btn--ghost::after {
  content: '→';
  margin-left: var(--space-sm);
  transition: transform var(--duration-fast) var(--ease-out-expo);
}

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

.btn--ghost:hover::after {
  transform: translateX(4px);
}

.btn--lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-base);
}

.btn--sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-xs);
}

/* Magnetic button wrapper */
.btn-magnetic {
  display: inline-block;
}

/* === CARDS === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  transition: all var(--duration-normal) var(--ease-out-expo);
  height: 100%;
}

.card:hover {
  border-color: var(--color-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card--glass {
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

.card--glass:hover {
  border-color: rgba(var(--color-primary-rgb), 0.25);
  box-shadow: var(--shadow-glow-sm);
}

.card--featured {
  border-color: var(--color-primary);
  position: relative;
}

.card--featured::before {
  content: 'Recomendado';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-bg);
  padding: var(--space-xs) var(--space-lg);
  border-radius: var(--border-radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  font-size: 1.4rem;
  margin-bottom: var(--space-lg);
}

.card__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
  font-family: var(--font-heading);
}

.card__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* === PRICE CARDS === */
.price-card {
  text-align: center;
  padding: var(--space-3xl) var(--space-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.price-card .card__text {
  flex: 1;
}

.price-card .price-card__features {
  flex: 1;
  justify-content: flex-start;
  width: 100%;
}

.price-card .btn-magnetic {
  margin-top: auto;
}

.price-card__amount {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  color: var(--color-primary);
  margin: var(--space-lg) 0 var(--space-xs);
}

.price-card__unit {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.price-card__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.price-card__feature {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.price-card__feature::before {
  content: '✓';
  color: var(--color-primary);
  font-weight: var(--weight-bold);
}

/* === FOOTER === */
.main-footer {
  background: var(--color-bg-dark);
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand p {
  margin-top: var(--space-md);
  color: var(--color-text-dim);
  font-size: var(--text-sm);
  max-width: 350px;
}

.footer__logo {
  height: 60px;
  width: auto;
  opacity: 0.8;
}

.footer__heading {
  font-family: var(--font-accent);
  font-size: var(--text-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  font-weight: var(--weight-regular);
  font-style: italic;
}

.footer__link {
  display: block;
  color: var(--color-text-dim);
  font-size: var(--text-sm);
  padding: var(--space-xs) 0;
  transition: color var(--duration-fast) var(--ease-smooth);
}

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

.footer__social {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.footer__social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-muted);
  transition: all var(--duration-normal) var(--ease-out-expo);
  font-size: 1.1rem;
}

.footer__social-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.footer__bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}

.footer__legal {
  display: flex;
  gap: var(--space-lg);
}

.footer__legal a {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}

/* === WHATSAPP FLOAT === */
.whatsapp-float {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.6rem;
  z-index: var(--z-chatbot);
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: all var(--duration-normal) var(--ease-out-expo);
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
  color: white;
}

/* === PAGE LOADER === */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: var(--z-loader);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity var(--duration-slow) var(--ease-out-expo);
}

.page-loader.loaded {
  opacity: 0;
  pointer-events: none;
}

.loader__logo {
  height: 80px;
  width: auto;
  animation: loaderPulse 1.5s ease-in-out infinite;
}

.loader__bar {
  width: 120px;
  height: 2px;
  background: var(--color-surface);
  margin-top: var(--space-xl);
  border-radius: var(--border-radius-full);
  overflow: hidden;
}

.loader__progress {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary), var(--color-primary-light));
  border-radius: var(--border-radius-full);
  width: 0%;
  animation: loaderProgress 1.8s var(--ease-out-expo) forwards;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes loaderProgress {
  to { width: 100%; }
}

/* === CUSTOM CURSOR === */
.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--color-primary);
  border-radius: var(--border-radius-full);
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              border-color 0.3s var(--ease-smooth),
              background 0.3s var(--ease-smooth);
  mix-blend-mode: difference;
  display: none;
}

.custom-cursor.active {
  width: 50px;
  height: 50px;
  background: rgba(var(--color-primary-rgb), 0.1);
}

@media (pointer: fine) {
  .custom-cursor {
    display: block;
  }
}

/* === FORM STYLES === */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--border-radius);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: border-color var(--duration-fast) var(--ease-smooth);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-dim);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

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

/* === RESPONSIVE COMPONENTS === */
@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

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