html, body {
  height: auto;       /* deja que crezca */
  min-height: 100vh;  /* al menos la pantalla completa */
  overflow-y: auto;   /* activa scroll vertical si hace falta */
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', serif;
}

body {
  margin: 0;
  font-family: 'Cormorant Garamond';
  background-color: #fdfdfd;
  color: #333;
  overflow-x: hidden;
  font-size: 17px;
}

.hidden {
  display: none !important;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 60%;
  max-width: 180px;
  background-color: #f5f0e6;
  padding: 80px 20px 20px 20px; /* 👈 espacio arriba (antes era 20px) */
  height: 100vh;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: 1001;
}


.sidebar:not(.oculto) {
  transform: translateX(0);
  opacity: 1;
}

.sidebar > ul > li:first-child {
  margin-top: 15%; /* ya no necesitamos un margen solo en el primero */
}

.sidebar > ul {
  margin-top: 0;
  padding-left: 0;
}

/* Main */
.main {
  transition: margin-left 0.3s ease;
  padding: 20px;
  margin-left: 0;
  height: auto;       /* crece con lo que haya dentro */
  min-height: 100%;  /* ocupa como mínimo toda la pantalla */
}

.main.desplazado {
  margin-left: 10%;
}

#catalogTitle {
  text-align: center;
  font-size: 28px;
  margin-bottom: 20px;
}

/* Botones flotantes */
.hamburguesa,
.perfil {
  position: fixed;
  top: 15px;
  font-size: 22px;
  background: white;         /* círculo blanco */
  border: none;
  cursor: pointer;
  z-index: 1100;
  color: #1976d2;            /* color del icono */
  
  /* Estilo circular */
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.hamburguesa {
  left: 15px;   /* esquina izquierda */
  font-size: 24px;
}

.perfil {
  right: 15px;  /* esquina derecha */
}

.hamburguesa:hover,
.perfil:hover {
  background: #f0f0f0;       /* gris claro al pasar el ratón */
  transform: scale(1.05);    /* efecto zoom suave */
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul li {
  margin: 16px 0;
}

ul a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  display: inline-block;
  line-height: 1.2;
}

.submenu {
  margin-left: 14px;
  margin-top: 6px;
  padding-left: 0;
}

.submenu li {
  margin: 6px 0;
}

/* --- Catálogo en grid uniforme --- */
#catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));   /*Ancho de cada casilla del grid*/
  gap: 14px; /* un poquito más de espacio para hover */
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  overflow: visible; /* permite que las sombras y transform no se corten */
}

/* Prendas */
/* Botón + moderno */
.addBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 145px;
  height: 220px;
  font-size: 36px;
  color: #1976d2;
  cursor: pointer;
  border: 2px dashed #1976d2;
  background: #f0f4ff;
  border-radius: 18px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.addBtn:hover {
  background: #e0e8ff;
  transform: scale(1.05);
}

/* Prenda moderna */
.prenda {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* reparte imagen arriba y marca abajo */
  align-items: center;
  width: 145px;
  height: 220px; 
  border-radius: 18px;    /*Lo redondeado que son los bordes*/
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.prenda:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

.prenda img {
  width: 100%;
  height: 170px;   /* o lo que necesites */
  object-fit: cover;
  display: block;
  border-radius: 18px;
}

/* Botón eliminar moderno */
.eliminarBtn {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #ff5252;
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.eliminarBtn:hover {
  transform: scale(1.1);
}

/* Botón de la paleta */
.colorSelector {
  position: absolute;   /* importante */
  bottom: 8px;
  top: 6px;             /* arriba */
  left: 6px;            /* izquierda */
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: #eee;
  cursor: pointer;
  border: 1px solid #ccc;
  z-index: 10;          /* encima de la imagen */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.colorSelector:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Modal moderno */
.colorModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  z-index: 3000;
  display: none;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.filaColores {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}




/* Notificación */
#notification {
  background-color: #4CAF50;
  color: white;
  padding: 8px;
  margin: 10px auto;
  width: fit-content;
  border-radius: 6px;
  font-weight: bold;
}

/* Pantalla de inicio */
#homeScreen {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  text-align: center;
  color: white;
  background: url('images/vittorio.jpg') no-repeat center center / cover;
  overflow: hidden;
}

#homeScreen .home-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1;
}

#homeScreen .home-content {
  position: relative;
  z-index: 2;
  padding: 20px;
  max-width: 90%;
}

#homeScreen h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

#homeScreen p {
  font-size: 22px;
  opacity: 0.95;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Overlay con fade */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.activo {
  opacity: 1;
  pointer-events: all;
}

/* Main con desplazamiento suave */
.main {
  transition: transform 0.3s ease;
}

.main.desplazado {
  transform: translateX(200px);
}


/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal:not(.oculto) {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 80%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: aparecer 0.3s ease;
}

@keyframes aparecer {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Menú desplegable del perfil con fade */
.perfil-menu {
  position: absolute;
  top: 65px; /* separado del botón perfil */
  right: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  padding: 10px 0;
  min-width: 150px;
  z-index: 1100;

  /* Fade y pequeño slide */
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Cuando está activo */
.perfil-menu.activo {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Estilos internos del menú */
.perfil-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.perfil-menu li {
  padding: 3px 16px;
}

.perfil-menu li a {
  text-decoration: none;
  color: #333;
  display: block;
}

.perfil-menu li a:hover {
  background-color: #f0f0f0;
}

/* Carrusel de selección de fondo */
.fondo-carrusel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 180px;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fondo-carrusel.activo {
  opacity: 1;
  pointer-events: all;
}

.carrusel-contenido {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px;
  height: 180px;
  background: rgba(0,0,0,0.6);
  border-radius: 10px 10px 0 0;
  align-items: center;
}

.carrusel-contenido img {
  height: 160px;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s ease, border 0.2s ease;
}

.carrusel-contenido img:hover {
  transform: scale(1.05);
  border: 3px solid white;
}

.fondo-carrusel-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  justify-content: center; 
  align-items: flex-end;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1200;
}

.fondo-carrusel-overlay.activo {
  opacity: 1;
  pointer-events: all;
}

.texto-menu {
  cursor: default;
  position: fixed;       /* fijo junto a la hamburguesa */
  top: 15px;             /* mismo top que la hamburguesa */
  left: 85px;            /* separado de la hamburguesa */
  font-size: 24px;       /* más grande */
  font-weight: 600;      /* más grueso */
  color: #000;           /* negro */
  opacity: 0;             /* oculto por defecto */
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1100;          /* encima del contenido */
  display: flex;
  align-items: center;    /* centra verticalmente con la hamburguesa */
  height: 53px;           /* mismo alto que el botón */
}


.texto-menu.visible {
  opacity: 1;
  transform: translateX(0);
}

.eliminarBtn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ff4d4d;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

/* Contenedor de la paleta de color arriba a la izquierda */
.controlesPrenda {
  position: absolute;
  top: 6px;      /* arriba de la prenda */
  left: 6px;     /* margen desde el lateral */
  display: flex;
  gap: 6px;
  z-index: 10;
}

/* Mantener el bloque de marca debajo de la prenda */
.marcaDiv {
  width: 90%;
  padding: 6px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  font-size: 14px; /* 🔹 tamaño de letra del botón */
  position: relative; /* necesario para el dropdown */
  overflow: hidden;
}


/* Input de marca */
.marcaInput {
  width: 100%;
  padding: 6px;
  box-sizing: border-box;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* Dropdown de sugerencias*/
.marcaDropdown {
  position: absolute;         /* ahora se posiciona respecto al body */
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  z-index: 9999;              /* siempre por encima */
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}


.marcaDropdown.hidden {
  display: none;
}
.marcaInput.hidden {
  position: absolute; /* fuera del flujo para no empujar nada */
  opacity: 0;
  pointer-events: none;
}


.marcaItem {
  padding: 6px 8px;
  cursor: pointer;
}

.marcaItem:hover {
  background-color: #f0f0f0;
}

.marcaDropdown, .marcaDropdown .marcaItem, .marcaInput {
  font-size: 12px;
}

/* 🧵 Modal moderno para editar catálogo */
.modal-content h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

/* 🧩 Grid de categorías */
.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(45%,160px), 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* 🧺 Tarjetas de categoría */
.categoria-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.categoria-card:hover {
  background: #e3f2fd;
  transform: scale(1.02);
}

.categoria-card input[type="checkbox"] {
  accent-color: #1976d2;
  width: 18px;
  height: 18px;
}

/* 💾 Botones del modal */
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.guardar-btn,
.cerrar-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.guardar-btn {
  background-color: #1976d2;
  color: white;
}

.guardar-btn:hover {
  background-color: #1565c0;
  transform: scale(1.05);
}

.cerrar-btn {
  background-color: #e0e0e0;
  color: #333;
}

.cerrar-btn:hover {
  background-color: #d5d5d5;
  transform: scale(1.05);
}

/* 🔽 Contenedor del botón de ordenar */
.ordenar-container {
  position: relative;
  display: inline-block;
  margin-bottom: 16px; /* separación respecto al catálogo */
}

/* 🔘 Botón principal */
#ordenarBtn {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1976d2, #125ea2);
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: background 0.3s ease, transform 0.2s ease;
}

#ordenarBtn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #1565c0, #0d47a1);
}

/* 📂 Dropdown moderno */
.dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 200px;
  overflow: hidden;
  z-index: 200;

  /* animación de entrada */
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* activo */
.dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* opciones */
.dropdown .opcion {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.dropdown .opcion:hover {
  background: #f5f9ff;
  padding-left: 20px; /* efecto de desplazamiento */
}

.prenda .contenido {
  padding: 10px;
  font-size: 14px;
}

/* Botón de filtrar (igual que ordenar) */
.filtrar-container {
  position: relative;
  display: inline-block;
  margin-bottom: 16px; /* separación respecto al catálogo */
}

#filtrarBtn {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1976d2, #125ea2);
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: background 0.3s ease, transform 0.2s ease;  position: relative;
  margin-left: 8px; /* separa de otros botones si quieres */
}

#filtrarBtn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #1565c0, #0d47a1);
}

/* Dropdown del botón de filtrar */
#filtrarDropdown {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 180px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 8px 0;
  z-index: 1000;
}

/* Mostrar dropdown cuando tenga la clase "show" */
#filtrarDropdown.show {
  display: block;
}

/* Opciones de color */
#filtrarDropdown .opcion {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
}

#filtrarDropdown .opcion:hover {
  background-color: #f0f0f0;
}

/* Subtítulos dentro del dropdown */
#filtrarDropdown .subtitulo {
  padding: 6px 16px;
  font-weight: bold;
  font-size: 12px;
  color: #666;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
}

/* Select de marcas */
#filtrarDropdown select {
  width: 100%;
  padding: 6px 12px;
  margin: 4px 0 8px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.separadorCategorias{
  padding-bottom: min(5%,3px);
}

.separadorCategorias a{
  color: #987d7d;
}

/* Clase que se aplica a la prenda cuando se maximiza */
.prenda.zoom {
  position: relative;
  z-index: 3000;
  transform: translate(var(--muevex), var(--mueveY)) scale(1.8);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  cursor: default;
}

.prenda.zoom img{
  height: 190px;
}

/* Oscurecer el fondo cuando hay zoom */
.overlay-zoom {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  z-index: 2500;
  display: none; /* Oculto por defecto */
}

.overlay-zoom.activo {
  display: block;
}

/* Ajustes para que los controles se vean bien en grande */
.prenda.zoom .colorSelector, 
.prenda.zoom .eliminarBtn {
  transform: scale(0.7); /* Reducimos los botones un poco para que no tapen la foto */
}

.prenda img:active {
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

/* Botón de borrar selección */
.btn-borrar {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff5252, #d32f2f); /* Rojo degradado */
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  margin-left: 8px;
  transition: transform 0.2s ease, opacity 0.3s ease;
}

.btn-borrar:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #ff1744, #b71c1c);
}

/* Estilo visual para saber qué prendas están seleccionadas */
.prenda.seleccionada {
  border: 3px solid #ff5252; /* Borde rojo */
  transform: scale(0.95);    /* Un poco más pequeña */
  opacity: 0.8;
}

/* Un pequeño icono check encima de la prenda seleccionada (Opcional pero queda pro) */
.prenda.seleccionada::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color: #ff5252;
  font-weight: bold;
  pointer-events: none;
  z-index: 100;
}
