/* =============================================
   JM Asociados — style.css
   Single source of truth for all custom styles
   Bootstrap 5.3.8 via CDN | FA 6.5.1 via CDN
============================================= */

/* =========================
   1. CSS VARIABLES
========================= */
:root {
  --jm-red:       #691932;
  --jm-red-dark:  #4d1123;
  --jm-gold:      #bfa46d;

  --jm-section-light: #fdf2f5;
  --jm-section-dark:  #1e1e1e;
  --jm-card-light:    #ffffff;
  --jm-card-dark:     #252525;
}

[data-bs-theme="light"] {
  --jm-section: var(--jm-section-light);
  --jm-card:    var(--jm-card-light);
}

[data-bs-theme="dark"] {
  --jm-section: var(--jm-section-dark);
  --jm-card:    var(--jm-card-dark);
  --bs-body-bg:    #121212;
  --bs-body-color: #eeeeee;
}

/* =========================
   2. BASE
========================= */
html, body {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  transition: background-color 0.4s ease, color 0.4s ease;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

h1, h2, h3, h4, h5, h6,
.display-4, .display-5 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  letter-spacing: 1px;
  color: inherit;
}

p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: inherit;
}

/* =========================
   3. SECTION BACKGROUNDS
========================= */
.section-bg,
#jm-history,
#jm-services-preview {
  background-color: var(--jm-section);
  transition: background-color 0.4s ease;
}

/* =========================
   4. NAVBAR
========================= */
#jm-navbar {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  box-shadow: 0 0.5rem 0.5rem rgba(0,0,0,.15);
  backdrop-filter: saturate(180%) blur(6px);

  --bs-navbar-bg:           rgba(255, 255, 255, 0.95);
  --bs-navbar-color:        #111;
  --bs-navbar-hover-color:  var(--jm-red);
  --bs-navbar-active-color: var(--jm-red);
  --bs-navbar-brand-color:  #111;
}

[data-bs-theme="dark"] #jm-navbar {
  --bs-navbar-bg:           rgba(18, 18, 18, 0.95);
  --bs-navbar-color:        #eee;
  --bs-navbar-brand-color:  #eee;
}

#jm-navbar .nav-link:hover,
#jm-navbar .nav-link.active {
  color: var(--jm-red) !important;
}

[data-bs-theme="dark"] #jm-navbar .nav-link:hover,
[data-bs-theme="dark"] #jm-navbar .nav-link.active {
  color: var(--jm-red) !important;
}

.navbar-logo {
  height: 50px;
  width: auto;
  transition: height 0.3s ease;
}

/* =========================
   5. DROPDOWN
========================= */
.dropdown-menu {
  --bs-dropdown-bg:                var(--bs-body-bg);
  --bs-dropdown-color:             var(--bs-body-color);
  --bs-dropdown-link-color:        var(--bs-body-color);
  --bs-dropdown-link-hover-color:  #fff;
  --bs-dropdown-link-hover-bg:     var(--jm-red);
  --bs-dropdown-border-color:      rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] .dropdown-menu {
  --bs-dropdown-bg:           #252525;
  --bs-dropdown-border-color: rgba(255,255,255,0.1);
}

/* =========================
   6. CAROUSEL
========================= */
#jm-carousel .carousel-inner { max-height: 75vh; }
#jm-carousel .carousel-item img {
  height: 75vh;
  object-fit: cover;
}

.jm-overlay {
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  border-radius: 1.5rem;
  padding: 2rem;
}

[data-bs-theme="dark"] .jm-overlay {
  background-color: rgba(0, 0, 0, 0.85);
}

/* =========================
   7. CARDS & FEATURE CARDS
========================= */
.jm-feature-card,
.card {
  background-color: var(--jm-card);
  border-radius: 30px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  transition: all 0.4s ease;
  padding: 3rem 2rem;
  color: inherit;
}

[data-bs-theme="dark"] .jm-feature-card,
[data-bs-theme="dark"] .card {
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

.jm-feature-card:hover,
.card:hover {
  transform: translateY(-15px);
  box-shadow: 0 30px 60px rgba(105,25,50,0.3);
}

/* =========================
   8. BUTTONS
========================= */
.btn-danger {
  background-color: var(--jm-red);
  border-color: var(--jm-red);
}

.btn-danger:hover {
  background-color: var(--jm-red-dark);
  border-color: var(--jm-red-dark);
}

/* =========================
   9. UTILITIES
========================= */
.text-gold { color: var(--jm-gold) !important; }

footer { margin-bottom: 0; }

/* =========================
   10. FOOTER
========================= */
#jm-footer {
  background-color: #111;
}

[data-bs-theme="dark"] #jm-footer {
  background-color: #0a0a0a;
}

/* =========================
   11. SERVICE ICON ANIMATIONS
========================= */
.icon-wrapper {
  display: inline-block;
  transition: transform 0.4s ease;
}

.service-icon {
  display: block;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fade-in-up.visible .service-icon {
  animation: iconBounce 1s ease-out;
}

.service-card:hover .icon-wrapper { transform: translateY(-10px); }
.service-card:hover .service-icon {
  transform: scale(1.2) rotate(8deg);
  filter: brightness(1.1);
}

@keyframes iconBounce {
  0%   { transform: translateY(-30px) scale(0.8); opacity: 0; }
  60%  { transform: translateY(10px) scale(1.15); }
  80%  { transform: translateY(-5px) scale(0.95); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* =========================
   12. YOUTUBE SHORTS SECTION
========================= */
#jm-shorts {
  background-color: var(--jm-section);
  padding: 4rem 0;
}

.shorts-title {
  font-family: 'Playfair Display', serif;
  color: var(--jm-red);
}

.short-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto 1.5rem;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 1.2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.short-video-wrapper:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(105,25,50,0.25);
}

.short-video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.short-caption {
  text-align: center;
  padding: 0 1rem;
}

.short-caption h5 {
  margin-top: 1rem;
  font-weight: 700;
  color: var(--jm-red);
}

.short-caption p {
  font-size: 1rem;
  color: inherit;
  opacity: 0.9;
}

/* =========================
   13. TEAM CARDS
========================= */
.team-card .card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card .card-img-top {
  border: 5px solid var(--jm-red);
  transition: transform 0.4s ease;
}

.team-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(105, 25, 50, 0.2) !important;
}

.team-card .card-body { padding: 1.5rem; }

/* =========================
   14. SCROLL ANCHOR OFFSET
========================= */
[id] { scroll-margin-top: 90px; }

/* =========================
   15. ANIMATIONS
========================= */
.fade-in-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.animation-delay-1 { transition-delay: 0.2s; }
.animation-delay-2 { transition-delay: 0.4s; }
.animation-delay-3 { transition-delay: 0.6s; }
.animation-delay-4 { transition-delay: 0.8s; }

.fade-in-left,
.fade-in-right {
  opacity: 0;
  transition: opacity 1s ease-out, transform 1s ease-out;
}
.fade-in-left  { transform: translateX(-80px); }
.fade-in-right { transform: translateX(80px); }

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

/* =========================
   16. RESPONSIVE
========================= */
@media (max-width: 991.98px) {
  .navbar-logo { height: 40px; }
  .carousel-caption h3 { font-size: 2.4rem; }
  .short-video-wrapper { max-width: 100%; }
}

@media (max-width: 767.98px) {
  .navbar-logo { height: 35px; }
  .carousel-caption h3 { font-size: 2rem; }
  #jm-carousel .carousel-caption h3,
  #jm-carousel .carousel-caption p,
  #jm-carousel .carousel-caption .btn {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  }
}

/* =========================
   17. LANGUAGE TOGGLE
========================= */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.lang-btn {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-btn:hover {
  background-color: var(--jm-red);
  color: #fff !important;
}

.lang-btn.lang-active {
  background-color: var(--jm-red);
  color: #fff !important;
  pointer-events: none;
}

[data-bs-theme="dark"] .lang-btn {
  color: #eee;
}