/* ===== BASE ===== */
html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ===== NAVBAR ===== */
#navbar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#navbar.scrolled {
  background-color: rgba(237, 237, 237, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #d9d9d9;
  box-shadow: 0 4px 20px -8px rgba(26, 26, 26, 0.18);
}

#navbar.scrolled .nav-link {
  color: #1a1a1a;
}

#navbar.scrolled #menu-btn {
  color: #1a1a1a;
}

#navbar-logo {
  height: 3rem;      /* móvil: cabe dentro del navbar h-20 (5rem) */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 640px) {
  #navbar-logo {
    height: 4rem;
  }
}

@media (min-width: 1024px) {
  #navbar-logo {
    height: 7.28rem; /* desktop: tamaño completo con 40% */
  }
}

#navbar.scrolled #navbar-logo {
  height: 2.5rem;    /* móvil scrolled */
}

@media (min-width: 640px) {
  #navbar.scrolled #navbar-logo {
    height: 3rem;
  }
}

@media (min-width: 1024px) {
  #navbar.scrolled #navbar-logo {
    height: 5.6rem;  /* desktop scrolled: tamaño completo con 40% */
  }
}

/* ===== SHADOWS ===== */
.shadow-elegant {
  box-shadow: 0 20px 50px -20px rgba(26, 26, 26, 0.30);
}

.shadow-card {
  box-shadow: 0 4px 20px -8px rgba(26, 26, 26, 0.18);
}

.shadow-glow {
  box-shadow: 0 0 40px rgba(237, 28, 36, 0.40);
}

/* ===== GRADIENTS ===== */
.hero-gradient {
  background: linear-gradient(
    135deg,
    rgba(26, 26, 26, 0.92) 0%,
    rgba(38, 38, 38, 0.82) 55%,
    rgba(215, 26, 33, 0.55) 100%
  );
}

.bg-gradient-section {
  background: linear-gradient(180deg, #f5f5f5 0%, #EDEDED 100%);
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 180px;
  gap: 12px;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    gap: 16px;
  }
}

/* Gallery item spans (mobile: all 1x1, desktop via md: classes) */
@media (min-width: 768px) {
  .gallery-span-2c-2r { grid-column: span 2; grid-row: span 2; }
  .gallery-span-2c-1r { grid-column: span 2; grid-row: span 1; }
  .gallery-span-1c-2r { grid-column: span 1; grid-row: span 2; }
  .gallery-span-1c-1r { grid-column: span 1; grid-row: span 1; }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
  box-shadow: 0 4px 20px -8px rgba(26, 26, 26, 0.18);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26, 26, 26, 0.90) 0%,
    rgba(26, 26, 26, 0.30) 50%,
    transparent 100%
  );
  opacity: 0.70;
  transition: opacity 0.5s ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus .gallery-overlay {
  opacity: 0.95;
}

.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease-out;
}

.gallery-item:hover img,
.gallery-item:focus img {
  transform: scale(1.10);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  text-align: left;
  transform: translateY(8px);
  transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus .gallery-caption {
  transform: translateY(0);
}

.gallery-icon-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.5s ease;
}

.gallery-item:hover .gallery-icon-btn,
.gallery-item:focus .gallery-icon-btn {
  background-color: #ED1C24;
  opacity: 1;
}

.gallery-item:focus {
  outline: none;
  box-shadow: 0 0 0 3px #ED1C24, 0 0 0 5px rgba(237, 28, 36, 0.20);
}

/* ===== LIGHTBOX ===== */
#lightbox {
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#lightbox.active {
  display: flex;
  opacity: 1;
}

#lightbox.fade-out {
  opacity: 0;
}

/* ===== WHATSAPP BUTTON ===== */
@keyframes wa-ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

.whatsapp-ping {
  animation: wa-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ===== TOAST ===== */
#toast {
  display: none;
}

#toast.show {
  display: block;
  animation: toast-in 0.3s ease;
}

#toast.hide {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}

/* ===== FORM ===== */
input, textarea {
  font-family: 'Outfit', system-ui, sans-serif;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #ED1C24 !important;
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.20);
}

/* ===== SERVICE CARD HOVER ===== */
.service-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px -20px rgba(26, 26, 26, 0.30);
}

.service-icon {
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-icon {
  background-color: #F3CF3F;
  color: #1a1a1a;
}
