/* ==========================================
   1. ESTILOS GENERALES Y RESETS
=========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.portfolio-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #ffffff;
  color: #1d1d1f;
  padding-top: 100px;
}

/* ==========================================
   2. ENCABEZADO SUPERIOR Y MENÚ DOCK
=========================================== */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #1d1d1f;
}

.brand-logo {
  height: 36px;
  width: auto;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand span {
  color: #0071e3;
}

/* Menú Dock Estilo Mac */
.mac-dock {
  display: flex;
  background: rgba(240, 240, 245, 0.8);
  padding: 6px 12px;
  border-radius: 30px;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dock-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  color: #555555;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dock-btn:hover,
.dock-btn.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   3. CONTENEDOR Y BARRA DE FILTROS
=========================================== */
.portfolio-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 60px 20px;
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.filter-btn {
  background: #f5f5f7;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #6e6e73;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: #1d1d1f;
  color: #ffffff;
}

/* ==========================================
   4. RETÍCULA DE TARJETAS DE PORTAFOLIO
=========================================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
}

.portfolio-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.card-image {
  position: relative;
  width: 100%;
  height: 240px;
  background-color: #f8f8f8;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

.card-info p {
  font-size: 14px;
  color: #6e6e73;
  line-height: 1.5;
}
/* ==========================================
   ENCUADRE EXCLUSIVO TARJETAS RETOQUE (940x1215)
=========================================== */

/* Aplicar relación de aspecto 3:4 a la miniatura de la tarjeta de producto */
.portfolio-card[data-category="producto"] .card-image {
  height: auto;
  aspect-ratio: 940 / 1215;
  background-color: #f8f8f8;
}

/* Mostrar la imagen completa centrada sin recortes laterales ni verticales */
.portfolio-card[data-category="producto"] .card-image img {
  object-fit: contain;
  padding: 8px;
}
/* ==========================================
   5. VENTANA MODAL / LIGHTBOX
=========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 900px;
  width: 90%;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background: #e0e0e0;
}

.modal-body {
  display: flex;
  flex-direction: row;
  gap: 32px;
  align-items: center;
  width: 100%;
}

.modal-gallery {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.modal-info {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.modal-specs {
  margin-top: 20px;
}

.modal-specs h4 {
  font-size: 13px;
  text-transform: uppercase;
  color: #86868b;
  margin-bottom: 10px;
}

.modal-specs ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #424245;
}

/* Estilo base general para cualquier imagen del modal */
.modal-img-container {
  width: 100%;
  background-color: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
}

.modal-img-container img {
  width: 100%;
  height: auto;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}

/* REGLA EXCLUSIVA 940x1215 PARA PRODUCTO Y TEXTIL */
.modal-overlay.is-product-retouch .modal-img-container {
  max-width: 420px;
  width: 100%;
  aspect-ratio: 940 / 1215;
}

.modal-overlay.is-product-retouch .modal-img-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 16px;
}

.modal-nav button {
  background: #f5f5f7;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-nav button:hover {
  background: #e5e5ea;
}

#modal-counter {
  font-size: 13px;
  color: #86868b;
  font-weight: 500;
}

.modal-cta {
  display: block;
  background: #1d1d1f;
  color: #ffffff;
  text-align: center;
  padding: 14px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-top: 24px;
  transition: background 0.2s ease;
}

.modal-cta:hover {
  background: #000000;
}

/* Botón flotante de WhatsApp */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #25d366;
  color: #ffffff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.08);
}

/* Responsivo para dispositivos móviles */
@media (max-width: 768px) {
  body.portfolio-body {
    padding-top: 140px;
  }

  .top-header {
    flex-direction: column;
    height: auto;
    padding: 16px;
    gap: 12px;
  }

  .modal-body {
    flex-direction: column;
  }
}
