/* Custom Styles for Montserrat & Vidal Abogados */

/* Smooth Scroll Fallback */
html {
  scroll-behavior: smooth;
}

/* Deactivate native smooth scroll when Lenis is active */
html.lenis {
  scroll-behavior: auto !important;
}

/* Añadido overflow-x hidden para prevenir scroll horizontal */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Estilos necesarios para Lenis */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f5f3f0;
}

::-webkit-scrollbar-thumb {
  background: #1a2e44;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #243b53;
}

/* Selection Color */
::selection {
  background: #c9a227;
  color: #1a2e44;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Animate on Scroll Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Service Card Hover Effect */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: #c9a227;
  transition: height 0.3s ease;
}

.service-card:hover::before {
  height: 100%;
}

/* Team Member Card */
.team-member {
  text-align: left;
}

.team-member img {
  filter: grayscale(0);
  transition: filter 0.3s ease, transform 0.5s ease;
}

.team-member:hover img {
  filter: grayscale(20%);
}

/* Testimonial Slider */
.testimonial-slider {
  transition: opacity 0.5s ease;
}

.testimonial-slider.fade-out {
  opacity: 0;
}

.testimonial-slider.fade-in {
  opacity: 1;
}

/* Form Focus Styles */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Header Scroll State */
header.scrolled nav {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Mobile Menu Animation */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#mobile-menu.open {
  max-height: 400px;
}

/* Stats Counter Animation */
.stat-number {
  display: inline-block;
}

/* Hero Image Parallax Effect */
@media (min-width: 768px) {
  #inicio .absolute img {
    transform: scale(1.1);
    transition: transform 0.5s ease;
  }
}

/* Card Lift Effect */
.card-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #c9a227 0%, #d4b84a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section Divider */
.section-divider {
  width: 60px;
  height: 3px;
  background: #c9a227;
  margin: 0 auto;
}

/* Link Hover Underline */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #c9a227;
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}

/* Responsive Typography */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }
}

/* Print Styles */
@media print {

  header,
  footer,
  #back-to-top,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    text-decoration: underline;
  }
}

/* Accessibility - Focus Visible */
:focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if needed */
}

/* Toast Visibility */
#toast.visible {
  opacity: 1;
  visibility: visible;
}

/* Back to Top Button Visibility */
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Form Validation Styles */
input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
select:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
  border-color: #22c55e;
}

/* Custom Select Arrow */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.5rem;
  padding-right: 3rem;
}

/* Image Lazy Load Placeholder */
img[data-src] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}