:root {
  --bg-color: #fff;
  --bg-color-2: #f5f5f5;
  --text-color: #111111;
  --accent-color: #000;
}
.dark-mode {
  --bg-color: #1b1a26;
  --bg-color-2: #313041;
  --text-color: #f5f5f5;
  --accent-color: #970000;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body, #app-container, .studio-sampler {
    height: 100%;
}
body {
  font-family: Arial, sans-serif;
  width: 100%;
  margin: auto;
  color: var(--text-color);
}
.studio-sampler{
  background-color: var(--bg-color);
  padding: 2em;
}
h1, h2, h3{
  text-align: center;
  font-weight: 400;
  margin-top: 0;
  text-transform: uppercase;
}
select, button, input, textarea {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  color: var(--text-color);
  text-transform: uppercase;
}
select, input, textarea{
  background-color: var(--bg-color-2);
  border: 1px solid ;
}
button {
  background-color: var(--bg-color);
  border: 2px solid var(--accent-color);
}
button:not(:disabled):hover{
  background-color: var(--accent-color);
  color: var(--bg-color);
}
button:disabled {
  background: var(--bg-color-2);
  border: 2px solid var(--bg-color-2);
}

/* Fullscreen overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.fullscreen-content {
    position: relative;
    height: 100%;
}
.fullscreen-content img {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;

}
.fullscreen-image {
    transition: transform 0.3s ease;
    cursor: zoom-in;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}
.fullscreen-image.zoomed {
    transform: scale(2);
    cursor: grab;
}
.fullscreen-image.zoomed:active {
    cursor: grabbing;
}
/***STUDIO SELECTOR***/
.preview-container {
  flex: 1; 
  min-height: 200px;
  position: relative;
}
.selector-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.maximize-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  cursor: pointer;
}
#zoom-btn, 
.maximize-btn {
  padding: 5px 5px;
  height: 32px;
  width: 32px;
}
.selector-info,
.selector-container{
  gap: 1rem;
  align-content: start;
  display: grid;
}
@media (min-width: 768px) {
  .selector-container {
    display: grid;
    grid-template-columns: 40% 60%;  /* 2 columnas */
    grid-template-rows: 1fr auto; /* filas: contenido y footer */
    gap: 1rem;
  }
  .selector-info {
    grid-column: 1;
    grid-row: 1;
  }
  .preview-container {
    grid-column: 2;
    grid-row: 1 / span 2; /* ocupa ambas filas */
  }
}
.by{
  text-align: center;
}
.by a{
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600; 
}
/************************/
/*****GALLERY VIEW*******/
.gallery-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.gallery-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: minmax(min-content, max-content); /* ← Esto resuelve todo */
  gap: 0.25rem;
}
.material-card {
  background: var(-);
  color: var(--text-color);
  border-radius: 1rem;
  padding: 0.5em;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
}
.material-image {
  width: 100%;
  height: 120px; /* Altura fija para todas las imágenes */
}
.material-image img {
  width: 100%;
  height: 100%; /* Ahora sí funciona con object-fit */
  object-fit: contain; /* Mantiene proporciones recortando excedentes */
}
.material-info {
  padding: 0.75rem;
}
.material-info p {
  margin: 0;
  font-weight: 300;
  font-size: 14px;
}
/* Mensaje error */
.error-message {
    text-align: center;
    padding: 2rem;
}
/**************VIEWER*****************/
/* LAYOUT visualizador 3D */
.viewer3d-container{
  height: 100%;
    display: flex;
  flex-direction: column;
}
.viewer-3d {
    position: relative;
    flex: 1; 
    display: flex;
    height: 100%;
    width: 100%;
    gap: 2rem;
    min-height: 0; 
    align-items: center;
    justify-content: center;
}
.product-viewer {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;  
}
.product-image {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.slider-container {
  position: absolute;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-height: 100%;
}
.slider-vertical {
  position: relative;
  width: 8px;
  height: 400px;
  max-height: 100%;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
}
.slider-track {
  position: absolute;
  width: 100%;
  height: 100%;
}
.slider-thumb {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 50%;
  left: -8px;
  transform: translateY(50%);
  cursor: grab;
}
.slider-thumb:active {
  cursor: grabbing;
}
.viewer-options {
  display: flex;
  max-height: 90px;
}
.options-grid {
  display: grid;
  grid-template-columns: 
    repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  height: 100%;
}
.options-grid img{
  width: 100%;
}
.error-container {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}
.error-container h2 {
    color: #dc3545;
    margin-bottom: 1rem;
}
.error-container a {
    color: #007bff;
    text-decoration: none;
}
.error-container a:hover {
    text-decoration: underline;
}

.preview-container .logo{
  position: absolute;
  right: 0;
  max-width: 160px;
}