/* ===================================
   Casa Colón - Galería + Visor 3D
   Sketchfab style + Colores Corporativos
   =================================== */

.gallery-page {
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
}

.gallery-header {
  display: none;
}

.gallery-container {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
}

/* ===================================
   Sidebar
   =================================== */

.gallery-sidebar {
  width: 260px;
  background: #1a1a1a;
  border-right: 3px solid var(--primary-blue);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.gallery-sidebar__header {
  display: block;
  padding: 2rem 1.5rem;
  background: var(--primary-blue);
  border-bottom: 3px solid #005ba8;
}

.gallery-sidebar__title {
  font-size: 1.6rem;
  margin: 0;
  color: white;
  text-align: center;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: var(--font-primary);
}

.gallery-sidebar__subtitle {
  display: none;
}

.gallery-sidebar__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem;
  background: #1a1a1a;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-sidebar__content::-webkit-scrollbar {
  display: none;
}

/* ===================================
   Grid - Cards
   =================================== */

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #111;
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 2px solid #333;
}

.gallery-item:hover {
  box-shadow: 0 8px 24px rgba(0, 113, 206, 0.3);
  border-color: var(--primary-blue);
}

.gallery-item.active {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 1px var(--primary-blue), 0 8px 24px rgba(0, 113, 206, 0.3);
}

.gallery-item__image-container {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: #111;
}

.gallery-item__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.gallery-item__overlay {
  display: none;
}

.gallery-item__info {
  padding: 0.875rem 1rem;
  background: var(--primary-blue);
  border-top: none;
}

.gallery-item.active .gallery-item__info {
  background: #005ba8;
}

.gallery-item__name {
  font-family: var(--font-secondary);
  font-size: 1.4rem;
  font-weight: 500;
  color: white;
  margin: 0;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-item:hover .gallery-item__name {
  color: white;
}

.gallery-item.active .gallery-item__name {
  color: white;
}

.gallery-item__description {
  display: none;
}

/* ===================================
   Visor 3D
   =================================== */

.viewer-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #111;
  position: relative;
}

.viewer-header {
  position: absolute;
  top: 2rem;
  right: 2rem;
  left: auto;
  bottom: auto;
  padding: 1.25rem 2rem;
  background: var(--primary-blue);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  z-index: 50;
  max-width: 400px;
  border-left: 4px solid white;
}

.viewer-header__title {
  font-size: 1.95rem;
  margin: 0;
  color: white;
  font-weight: 700;
  font-family: var(--font-primary);
}

.viewer-header__description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.4rem;
  line-height: 1.4;
}

.viewer-content {
  flex: 1;
  position: relative;
}

.viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===================================
   Estados de Carga y Vacío
   =================================== */

.viewer-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #111;
  z-index: 10;
}

.viewer-loading__spinner {
  margin-bottom: 2rem;
  width: 60px;
  height: 60px;
  border-width: 5px;
  border-color: #333;
  border-top-color: var(--primary-blue);
}

.viewer-loading__text {
  color: #aaa;
  font-size: 1.25rem;
  font-weight: 400;
}

.viewer-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #aaa;
  padding: 3rem;
  text-align: center;
}

.viewer-empty__icon {
  font-size: 5rem;
  margin-bottom: 2rem;
  opacity: 0.2;
}

.viewer-empty__title {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #e0e0e0;
  font-weight: 600;
}

.viewer-empty__subtitle {
  font-size: 1.9rem;
  opacity: 0.6;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 1400px) {
  .gallery-sidebar {
    width: 240px;
  }

  .gallery-sidebar__title {
    font-size: 1.4rem;
  }

  .gallery-item__name {
    font-size: 1rem;
  }

  .viewer-header__title {
    font-size: 1.5rem;
  }
}

@media (max-width: 1024px) {
  .gallery-sidebar {
    width: 220px;
  }

  .gallery-sidebar__content {
    padding: 0.625rem;
  }

  .gallery-grid {
    gap: 0.625rem;
  }

  .viewer-header {
    padding: 1rem 1.5rem;
    max-width: 350px;
  }

  .viewer-header__title {
    font-size: 1.35rem;
  }

  .viewer-header__description {
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  .gallery-sidebar {
    width: 180px;
  }

  .gallery-sidebar__title {
    font-size: 1.2rem;
  }

  .gallery-item__name {
    font-size: 0.9rem;
  }

  .viewer-header {
    top: 1rem;
    right: 1rem;
    max-width: none;
    left: 1rem;
  }
}