/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.6;
    color: #333;
    background-color: #fefefe;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sección hero (encabezado principal) */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 120px 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,[...]');
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.nombres {
    font-size: 4rem;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.fecha {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.lugar {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.invitacion {
    font-size: 1.2rem;
    font-style: italic;
    margin-top: 20px;
    opacity: 0.95;
}

.divider {
    width: 100px;
    height: 3px;
    background: white;
    margin: 30px auto;
}

/* Navegación */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.navbar li {
    margin: 0;
}

.navbar a {
    display: block;
    padding: 20px 25px;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    transition: all 0.3s ease;
}

.navbar a:hover {
    background-color: #667eea;
    color: white;
}

/* Sección de cuenta regresiva */
.countdown-section {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

.countdown-section h2 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 40px;
    font-weight: 300;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.time-unit {
    background: white;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.15);
    min-width: 120px;
}

.time-unit span {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.time-unit p {
    font-size: 1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Sección de historia */
.historia-section {
    padding: 80px 20px;
    background-color: #fff;
    text-align: center;
}

.historia-section h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.historia-section .divider {
    background: #667eea;
}

.historia-texto {
    max-width: 800px;
    margin: 40px auto;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
}

/* Sección de detalles */
.detalles-section {
    padding: 80px 20px;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

.detalles-section h2 {
    font-size: 2.5rem;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

.detalles-section .divider {
    background: #667eea;
}

.eventos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.evento-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.evento-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.evento-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.evento-card h3 {
    font-size: 1.8rem;
    color: #667eea;
    margin-bottom: 15px;
}

.evento-card .hora {
    font-size: 1.3rem;
    font-weight: bold;
    color: #764ba2;
    margin-bottom: 15px;
}

.evento-card p {
    color: #666;
    line-height: 1.6;
}

/* Sección de ubicación */
.ubicacion-section {
    padding: 80px 20px;
    background-color: #fff;
    text-align: center;
}

.ubicacion-section h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.ubicacion-section .divider {
    background: #667eea;
}

.ubicacion-info {
    max-width: 800px;
    margin: 40px auto;
}

.ubicacion-info h3 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 20px;
}

.ubicacion-info p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.direccion {
    margin-top: 30px;
    font-style: italic;
    color: #764ba2;
}

/* Sección de confirmación */
.confirmacion-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.confirmacion-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.confirmacion-texto {
    font-size: 1.3rem;
    margin: 40px auto;
    max-width: 600px;
}

.contacto-info {
    margin-top: 40px;
}

.contacto-info p {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.nota {
    font-style: italic;
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 30px;
}

/* Estilos para el formulario RSVP (mejor estructura y botones redondeados) */
#rsvp-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 900px;
    margin: 30px auto 0;
    text-align: left;
}

#rsvp-form .form-row {
    display: flex;
    flex-direction: column;
}

#rsvp-form .form-row.full { grid-column: 1 / -1; }

#rsvp-form label { font-weight: 600; margin-bottom: 6px; color: rgba(255,255,255,0.95); }

#rsvp-form input[type="text"],
#rsvp-form input[type="email"],
#rsvp-form input[type="number"],
#rsvp-form select,
#rsvp-form textarea {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.95);
    color: #222;
    font-size: 1rem;
    outline: none;
    transition: box-shadow .15s ease, transform .08s ease;
}

#rsvp-form textarea { min-height: 100px; resize: vertical; }

#rsvp-form input:focus,
#rsvp-form select:focus,
#rsvp-form textarea:focus {
    box-shadow: 0 6px 20px rgba(102,126,234,0.18);
    transform: translateY(-2px);
    border-color: rgba(102,126,234,0.9);
}

#rsvp-form .form-row .radio-group { display:flex; gap:12px; align-items:center; }
#rsvp-form .form-row .radio-group label { font-weight: 500; color: #333; }

#rsvp-form .actions { grid-column: 1 / -1; display:flex; gap:12px; align-items:center; justify-content:flex-start; margin-top:6px; }

#rsvp-submit {
    background: linear-gradient(90deg,#667eea,#764ba2);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(102,126,234,0.2);
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}

#rsvp-submit:hover { transform: translateY(-3px); box-shadow: 0 14px 38px rgba(102,126,234,0.25); }

#rsvp-submit:active { transform: translateY(-1px); }

#rsvp-status { color: rgba(255,255,255,0.95); margin-top:8px; }

/* Pie de página */
footer {
    background-color: #2c2c2c;
    color: white;
    text-align: center;
    padding: 40px 20px;
}

footer p {
    margin-bottom: 10px;
}

.footer-mensaje {
    font-style: italic;
    color: #667eea;
    font-size: 1.1rem;
}

/* Galería y soluciones para móviles: asegurar que los thumbnails siempre tengan tamaño en móvil */
#galeria { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
#galeria h2 { color: #c0392b; margin-bottom: 0.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.grid-item {
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 4/3; /* moderno: mantiene altura consistente en móviles */
    min-height: 180px; /* fallback para navegadores sin aspect-ratio */
}
.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modal */
/* .modal { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.85); 
    display: none; 
    align-items: center; 
    justify-content: center; 
    padding: 1rem; 
    z-index: 2000; 
}  */
/* .modal.open { display: flex; }
.modal-content { max-width: 95%; max-height: 95%; position: relative; }
.modal-content img { max-width: 100%; max-height: 100%; border-radius: 6px; display: block; }
.modal-close { position: absolute; top: -10px; right: -10px; background: #fff; border-radius: 50%; width: 36px; height: 36px; display: inline-grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.3); font-weight: 700; }
.pie { color: #666; font-size: .95rem; margin-bottom: .75rem; } */

/* Encabezado con imagen de fondo (mantener) */
header.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;              /* altura mínima; ajustar si quieres más o menos */
  color: #fff;
  text-align: center;
  background-image:
    linear-gradient(rgba(0,0,0,0.36), rgba(0,0,0,0.36)),
    url('pics/16010AF6-80FD-4B8F-85E7-6974BAE9927E-44809-0000065B086A1D8B.jpg');
  background-size: cover;
  background-position: center 70%;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

/* Opcional: sombra y contraste extra en el texto */
header .hero-content { position: relative; z-index: 1; padding: 2rem 1rem; }
header .nombres {
  font-size: 2.4rem;
  margin: 0;
  text-shadow: 0 2px 18px rgba(0,0,0,0.6);
}
header .fecha,
header .lugar,
header .invitacion {
  margin: 0.25rem 0;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

/* Ajustes para pantallas pequeñas: formulario responsive y galería */
@media (max-width: 900px) {
    #rsvp-form { grid-template-columns: 1fr; padding: 0 10px; }
    #rsvp-form .actions { justify-content: center; }
}

/* Hamburger button - hidden on desktop */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #667eea;
    cursor: pointer;
    padding: 12px 20px;
}

@media (max-width: 768px) {
    .nav-toggle { display: block !important; }
    .navbar ul {
        display: none !important;
        flex-direction: column;
    }
    .navbar ul.open {
        display: flex !important;
    }
    .navbar a { padding: 15px 20px; }
    .nombres { font-size: 2.5rem; }
    .fecha { font-size: 1.4rem; }
    .lugar { font-size: 1.1rem; }
    .countdown { gap: 15px; }
    .time-unit { padding: 20px 30px; min-width: 100px; }
    .time-unit span { font-size: 2rem; }
    .eventos-grid { grid-template-columns: 1fr; }
    header { min-height: 240px; }
    header .nombres { font-size: 1.6rem; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .grid-item { min-height: 100px; }
}



/* Animaciones suaves */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.8s ease-out;
}

/* ===== Mejoras RSVP y galería móvil ===== */

/* --- Tarjeta del formulario RSVP --- */
.confirmacion-card {
  max-width: 1000px;
  margin: 24px auto 0;
  background: rgba(255,255,255,0.98);
  color: #222;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

/* Recolocar el form dentro de la tarjeta y estilo general */
#rsvp-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

/* Campos que ocupan todo el ancho */
#rsvp-form .full {
  grid-column: 1 / -1;
}

/* Etiquetas y campos */
#rsvp-form label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
  font-size: 0.95rem;
}
#rsvp-form input[type="text"],
#rsvp-form input[type="email"],
#rsvp-form input[type="number"],
#rsvp-form select,
#rsvp-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  color: #222;
  font-size: 1rem;
  outline: none;
  transition: box-shadow .12s ease, transform .06s ease;
}
#rsvp-form textarea { min-height: 120px; resize: vertical; }

/* Focus */
#rsvp-form input:focus,
#rsvp-form select:focus,
#rsvp-form textarea:focus {
  box-shadow: 0 10px 30px rgba(102,126,234,0.14);
  transform: translateY(-2px);
  border-color: rgba(102,126,234,0.85);
}

/* Radios mejor presentados */
.radio-group {
  display: flex;
  gap: 12px;
  align-items: center;
}
.radio-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.06);
  background: #f6f7fb;
  cursor: pointer;
  user-select: none;
  color: #333;
}
.radio-pill input { margin: 0; accent-color: #667eea; }

/* Acciones y botones */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 6px;
  grid-column: 1 / -1;
}

/* Botón principal (píldora) */
#rsvp-submit {
  background: linear-gradient(90deg,#667eea,#764ba2);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(102,126,234,0.18);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
#rsvp-submit:hover { transform: translateY(-3px); box-shadow: 0 16px 44px rgba(102,126,234,0.22); }
#rsvp-submit:active { transform: translateY(-1px); }

/* Botón secundario neutro */
.button-secondary {
  background: transparent;
  color: #333;
  border: 1px solid rgba(0,0,0,0.08);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}

/* Mensaje de estado */
#rsvp-status { margin-left: 6px; color: #333; font-weight: 600; }

/* --- Estilos para la sección de selección de menú --- */
.menu-section {
  margin-top: 20px;
}

.guest-menu {
  margin-bottom: 15px;
  padding: 15px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #f8f9fa;
}

.guest-menu label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.guest-menu .radio-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.guest-menu .radio-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: white;
  cursor: pointer;
  user-select: none;
  color: #333;
  transition: all 0.2s ease;
}

.guest-menu .radio-pill:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.guest-menu .radio-pill input {
  margin: 0;
  accent-color: #667eea;
}

.guest-menu .radio-pill input:checked + span {
  font-weight: 600;
}

/* --- Galería: fallback robusto para móviles (aspect ratio) --- */
/* caja con proporción usando pseudo-elemento y posicionamiento absoluto
   esto evita que algunos navegadores móviles colapsen la altura */
.grid-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: #eee;
  min-height: 110px; /* respaldo */
}

/* Pseudo-element para forzar altura proporcional (4:3) */
.grid-item::before {
  content: "";
  display: block;
  padding-top: 75%; /* 4/3 = 75% */
}

/* Imagen posicionada sobre el pseudo-elemento */
.grid-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease, opacity .18s ease;
  opacity: 1;
}

/* Si hay hover/scale */
.grid-item:hover img { transform: scale(1.05); }

/* Si por alguna razón la imagen no carga, mostramos un icono o color neutro */
.grid-item img:not([src]) { opacity: 0; }

/* Asegurar que en móviles las miniaturas siempre aparezcan */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.45rem; }
  .grid-item { min-height: 100px; }
}

/* Responsivo: el formulario pasa a una columna en pantallas pequeñas */
@media (max-width: 900px) {
  #rsvp-form { grid-template-columns: 1fr; gap: 12px; padding: 0; }
  .actions { justify-content: center; }
  .confirmacion-card { padding: 18px; margin: 12px; }
}
/* Fix: asegurar miniaturas visibles en móviles */
#grid .grid-item {
  position: relative !important;   /* needed for absolute img */
  overflow: hidden !important;
  border-radius: 8px;
  background: #eee;
  min-height: 110px;               /* respaldo en caso de que el pseudo-element no funcione */
}

/* pseudo-element fallback para forzar proporción (4:3) */
#grid .grid-item::before {
  content: "";
  display: block;
  padding-top: 75%; /* 4/3 = 75% */
}

/* Imagen absolutamente posicionada sobre la caja */
#grid .grid-item img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  opacity: 1 !important;
  -webkit-transform: translateZ(0); /* trigger compositing on some mobiles */
}

#grid .grid-item:first-child img {
  object-fit: cover !important;
  object-position: center bottom !important;
}
