/* =================================================================
   MAMMUT DESIGN AND BUILD - Reusable Components
   ================================================================= */

/* ---------------------------------------------------------------
   CONTAINER
   --------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }
}

.container--narrow {
  max-width: var(--container-lg);
}

.container--wide {
  max-width: var(--container-2xl);
}

/* ---------------------------------------------------------------
   BUTTONS - Modern gradient style with micro-interactions
   --------------------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  letter-spacing: 0.025em;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: var(--border-width-2) solid transparent;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

/* Primary Button - Gradient with glow */
.btn--primary {
  background: var(--gradient-primary);
  color: var(--color-white);
  box-shadow:
    0 4px 6px -1px rgba(16, 185, 129, 0.25),
    0 2px 4px -1px rgba(16, 185, 129, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn--primary:hover {
  background: var(--gradient-primary-hover);
  transform: translateY(-3px);
  box-shadow:
    0 10px 20px -5px rgba(16, 185, 129, 0.4),
    0 6px 10px -3px rgba(16, 185, 129, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: var(--color-white);
}

.btn--primary:active {
  transform: translateY(-1px);
  box-shadow:
    0 4px 8px -2px rgba(16, 185, 129, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Secondary Button */
.btn--secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  background: var(--gradient-primary);
  color: var(--color-white);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3);
}

/* White Button (for dark backgrounds) */
.btn--white {
  background-color: var(--color-white);
  color: var(--color-primary-dark);
  border-color: var(--color-white);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn--white:hover {
  background-color: var(--color-white);
  border-color: var(--color-white);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  color: var(--color-primary-dark);
}

/* Outline White (for dark backgrounds) */
.btn--outline-white {
  background-color: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

.btn--outline-white:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--color-white);
  color: var(--color-white);
  transform: translateY(-3px);
}

/* Accent Button - Orange gradient */
.btn--accent {
  background: var(--gradient-accent);
  color: var(--color-white);
  box-shadow:
    0 4px 6px -1px rgba(249, 115, 22, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--accent:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.4);
}

/* Button Sizes */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-xl);
}

/* ---------------------------------------------------------------
   CARDS - Modern with gradient border and enhanced hover
   --------------------------------------------------------------- */

.card {
  position: relative;
  background-color: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

/* Gradient border effect on hover */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

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

.card--no-hover:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

.card--no-hover::before {
  display: none;
}

.card__icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}

.card__title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

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

/* ---------------------------------------------------------------
   SECTION STYLES
   --------------------------------------------------------------- */

.section {
  padding: var(--section-padding-y) 0;
}

.section--gray {
  background-color: var(--bg-secondary);
}

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

.section--primary h2,
.section--primary h3,
.section--primary h4 {
  color: var(--color-white);
}

.section__header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-12);
}

.section__subtitle {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section--primary .section__subtitle {
  color: var(--color-accent-light);
}

.section__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

.section__description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.section--primary .section__description {
  color: rgba(255, 255, 255, 0.85);
}

/* ---------------------------------------------------------------
   GRID LAYOUTS
   --------------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 {
  grid-template-columns: repeat(1, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(1, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 576px) {
  .grid--2,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------------
   BADGES
   --------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: var(--color-white);
}

.badge--secondary {
  background-color: var(--color-accent);
}

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

/* ---------------------------------------------------------------
   FORM ELEMENTS
   --------------------------------------------------------------- */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  background-color: var(--bg-primary);
  border-color: var(--border-color);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  background-color: var(--bg-primary);
  border-color: var(--color-primary);
  box-shadow:
    0 0 0 4px rgba(16, 185, 129, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-mid-gray);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

/* ---------------------------------------------------------------
   IMAGE STYLES
   --------------------------------------------------------------- */

.img-rounded {
  border-radius: var(--radius-lg);
}

.img-cover {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------
   TEXT UTILITIES
   --------------------------------------------------------------- */

.text-center {
  text-align: center;
}

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

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--color-primary);
}

.text-white {
  color: var(--color-white);
}

.text-muted {
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------
   SPACING UTILITIES
   --------------------------------------------------------------- */

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* ---------------------------------------------------------------
   ANIMATIONS - Modern with spring easing
   --------------------------------------------------------------- */

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grids - more dramatic */
.fade-in.delay-1 { transition-delay: 0.1s; }
.fade-in.delay-2 { transition-delay: 0.2s; }
.fade-in.delay-3 { transition-delay: 0.3s; }
.fade-in.delay-4 { transition-delay: 0.4s; }
.fade-in.delay-5 { transition-delay: 0.5s; }
.fade-in.delay-6 { transition-delay: 0.6s; }

/* Scale up animation variant */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Slide in from left */
.slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide in from right */
.slide-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .scale-in,
  .slide-in-left,
  .slide-in-right {
    transition: opacity 0.3s ease;
    transform: none;
  }

  .fade-in.visible,
  .scale-in.visible,
  .slide-in-left.visible,
  .slide-in-right.visible {
    transform: none;
  }
}

/* ---------------------------------------------------------------
   WHATSAPP FLOATING BUTTON
   --------------------------------------------------------------- */

.whatsapp-btn {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: var(--z-whatsapp);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms ease;
  animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(37, 211, 102, 0.6), 0 0 0 8px rgba(37, 211, 102, 0.1);
  }
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
  animation: none;
}

.whatsapp-btn svg {
  width: 32px;
  height: 32px;
  fill: var(--color-white);
}

@media (max-width: 768px) {
  .whatsapp-btn {
    width: 50px;
    height: 50px;
    bottom: var(--space-4);
    right: var(--space-4);
  }

  .whatsapp-btn svg {
    width: 28px;
    height: 28px;
  }
}

/* ---------------------------------------------------------------
   RIPPLE EFFECT (for buttons)
   --------------------------------------------------------------- */

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---------------------------------------------------------------
   SCROLL PROGRESS INDICATOR
   --------------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 9999;
  transition: width 100ms ease-out;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* ---------------------------------------------------------------
   LOADING SHIMMER EFFECT
   --------------------------------------------------------------- */

.shimmer {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmerMove 1.5s ease-in-out infinite;
}

[data-theme="dark"] .shimmer::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
}

@keyframes shimmerMove {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Skeleton loading placeholders */
.skeleton {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmerMove 1.5s ease-in-out infinite;
}

.skeleton--text {
  height: 1em;
  width: 80%;
  margin-bottom: 0.5em;
}

.skeleton--title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 1em;
}

.skeleton--image {
  width: 100%;
  aspect-ratio: 16/9;
}

/* ---------------------------------------------------------------
   FOCUS VISIBLE (enhanced accessibility)
   --------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------------------------------------------------------------
   SMOOTH SCROLLING (respects user preferences)
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
