/* ===== GALLERY SECTION ===== */
.gallery-page-section {
  padding: 110px 0;
  background: linear-gradient(130deg, rgba(7, 40, 80, 0.04) 0%, rgba(7, 40, 80, 0.1) 35%, #fff 100%);
}

.gallery-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  margin-bottom: 50px;
}

.gallery-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gallery-main-title {
  font-family: 'NeoTech Bold', 'Arial Black', Arial, sans-serif;
  font-size: 2.9rem;
  color: var(--primary-blue);
  line-height: 1.15;
}

.gallery-subtitle {
  font-size: 1.1rem;
  color: var(--gray-text);
  max-width: 520px;
}

.gallery-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.gallery-stat-card {
  background: white;
  padding: 22px 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(7, 40, 80, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: rgba(7, 40, 80, 0.6);
  letter-spacing: 1.2px;
  font-weight: 700;
}

.gallery-stat-value {
  font-family: 'NeoTech Bold', 'Arial Black', Arial, sans-serif;
  font-size: 2.1rem;
  color: var(--primary-blue);
}

.gallery-stat-hint {
  font-size: 0.85rem;
  color: var(--gray-text);
}

.gallery-hero-visual {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(240, 111, 12, 0.9), rgba(7, 40, 80, 0.9));
  color: white;
  display: flex;
  align-items: center;
  min-height: 280px;
  box-shadow: var(--shadow);
}

.gallery-hero-blur {
  position: absolute;
  inset: 0;
  background-image: url('/assets/img/gallery-pattern.png');
  background-size: cover;
  opacity: 0.12;
}

.gallery-hero-preview {
  position: relative;
  padding: 35px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gallery-hero-preview h3 {
  font-family: 'NeoTech Bold', 'Arial Black', Arial, sans-serif;
  font-size: 1.7rem;
  margin: 0;
}

.gallery-hero-preview p {
  color: rgba(255, 255, 255, 0.85);
}

.gallery-hero-tag {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.gallery-upload-card {
  margin: 0 0 48px 0;
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(7, 40, 80, 0.08);
}

.gallery-upload-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.gallery-upload-card-header h3 {
  margin: 0 0 4px 0;
  font-family: 'NeoTech Bold', 'Arial Black', Arial, sans-serif;
  color: var(--primary-blue);
}

.gallery-upload-card-header p {
  margin: 0;
  color: var(--gray-text);
}

.gallery-admin-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.gallery-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-form-label {
  color: var(--primary-blue);
  font-weight: 600;
}

.gallery-form-input {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(7, 40, 80, 0.15);
  background: rgba(7, 40, 80, 0.02);
}

.gallery-file-input-help {
  font-size: 0.8rem;
  color: var(--gray-text);
}

.gallery-btn-primary {
  background: linear-gradient(135deg, var(--primary-orange), #ff8c42);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(240, 111, 12, 0.3);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.gallery-btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.gallery-btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.gallery-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(240, 111, 12, 0.4);
}

.gallery-btn-primary:active {
  transform: translateY(0);
}

.gallery-filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.gallery-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-filter-chip {
  border: 1px solid rgba(7, 40, 80, 0.15);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
  color: var(--primary-blue);
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.gallery-filter-chip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(240, 111, 12, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease;
  pointer-events: none;
  will-change: width, height;
}

.gallery-filter-chip:hover::before {
  width: 200px;
  height: 200px;
}

.gallery-filter-chip:hover {
  border-color: rgba(240, 111, 12, 0.6);
  color: #f06f0c;
  transform: translateY(-1px);
}

.gallery-filter-chip.active {
  background: linear-gradient(135deg, var(--primary-blue), #0d3a6b);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(7, 40, 80, 0.2);
  transform: scale(1.02);
}

.gallery-filter-hint {
  color: var(--gray-text);
  font-size: 0.9rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.5s ease-out forwards;
  will-change: transform;
  background: white;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }

.gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(240, 111, 12, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 32px rgba(7, 40, 80, 0.2);
}

.gallery-item:hover .gallery-overlay {
  background: linear-gradient(180deg, rgba(7, 40, 80, 0) 0%, rgba(7, 40, 80, 0.9) 100%);
}

.gallery-image {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 40, 80, 0) 0%, rgba(7, 40, 80, 0.8) 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  transition: var(--transition-smooth);
  z-index: 2;
}

.gallery-overlay-category {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: 999px;
  color: white;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.gallery-overlay-title {
  color: white;
  font-family: 'NeoTech Bold', 'Arial Black', Arial, sans-serif;
  font-size: 1.2rem;
  margin: 0;
}

.gallery-delete-image-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(220, 38, 38, 0.95);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
  transition: var(--transition-smooth);
  z-index: 3;
  backdrop-filter: blur(5px);
}

.gallery-delete-image-btn:hover {
  background: rgba(220, 38, 38, 1);
  transform: scale(1.1);
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.4);
}

.gallery-delete-image-btn:active {
  transform: scale(0.95);
}

.gallery-empty {
  background: white;
  padding: 80px 30px;
  border-radius: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(7, 40, 80, 0.08);
}

.gallery-empty h3 {
  font-family: 'NeoTech Bold', 'Arial Black', Arial, sans-serif;
  color: var(--primary-blue);
  margin-bottom: 12px;
}

.gallery-empty p {
  color: var(--gray-text);
}

.gallery-empty-icon {
  font-size: 48px;
  margin-bottom: 14px;
}

/* ===== MODAL/LIGHTBOX PARA IMÁGENES ===== */
.gallery-image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.gallery-image-modal-content {
  position: relative;
  max-width: 60vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: scaleIn 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.gallery-modal-image-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 6px;
}

.gallery-modal-image {
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  background: transparent;
}

.gallery-close-modal-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 10001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.gallery-close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.gallery-modal-info {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.95), rgba(75, 85, 99, 0.95));
  backdrop-filter: blur(15px);
  padding: 12px 18px;
  border-radius: 10px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-modal-category-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-orange), #ff8c42);
  color: white;
  padding: 5px 14px;
  border-radius: 18px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(240, 111, 12, 0.3);
}

.gallery-modal-title {
  color: white;
  font-family: 'NeoTech Bold', 'Arial Black', Arial, sans-serif;
  font-size: 1.5rem;
  margin: 0 0 10px 0;
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gallery-modal-description {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
  font-style: italic;
}

/* Responsive para el modal */
@media (max-width: 768px) {
  .gallery-image-modal-overlay {
    padding: 10px;
  }
  
  .gallery-image-modal-content {
    max-width: 95vw;
    max-height: 90vh;
    padding: 15px;
  }
  
  .gallery-modal-image {
    max-height: 50vh;
  }
  
  .gallery-close-modal-btn {
    top: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  
  .gallery-modal-title {
    font-size: 1.2rem;
  }
  
  .gallery-modal-info {
    max-width: 100%;
    padding: 10px 16px;
  }
}

