/* Sistema de Diseño "Artesanos" - Paleta Cálida & Artesanal */
:root {
  --bg-main: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-subtle: #F4EFE6;
  --bg-dark: #2C1D11;
  
  --primary-brown: #5C4033;
  --primary-dark: #3E2723;
  --terracotta: #C06C4C;
  --terracotta-hover: #A55537;
  --beige-light: #F7F3EB;
  --beige-medium: #E8DEC9;
  --warm-gold: #C5A059;
  --warm-gold-hover: #B08B45;

  --text-primary: #2B231D;
  --text-secondary: #6B5B52;
  --text-muted: #9E8C81;
  --text-light: #F7F3EB;

  --border-color: #E6DDD0;
  --border-focus: #C06C4C;

  /* Sombras Táctiles Multicapa */
  --shadow-sm: 0 4px 15px rgba(62, 39, 35, 0.05);
  --shadow-md: 0 10px 30px rgba(62, 39, 35, 0.08);
  --shadow-lg: 0 20px 40px rgba(62, 39, 35, 0.12);
  --shadow-craft-sm: 0 4px 14px rgba(62, 39, 35, 0.06);
  --shadow-craft-md: 0 12px 28px -6px rgba(62, 39, 35, 0.1), 0 4px 12px -2px rgba(192, 108, 76, 0.06);
  --shadow-craft-lg: 0 22px 42px -10px rgba(44, 29, 17, 0.18), 0 8px 20px -4px rgba(192, 108, 76, 0.14);
  --shadow-glow: 0 0 25px rgba(192, 108, 76, 0.22);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Curvas de Transición y Aceleración Artesanales */
  --ease-out-craft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: visible;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  -webkit-overflow-scrolling: touch;
}

/* Prevenir zoom no deseado al hacer tap en inputs en iOS */
@media (max-width: 768px) {
  html {
    font-size: 14.5px;
  }
}

.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  display: none;
  justify-content: center;
  align-items: center;
}

/* Cortinas laterales blancas de la animación */
.intro-curtain {
  position: absolute;
  top: 0;
  width: 50vw;
  height: 100vh;
  background: #FFFFFF;
  z-index: 9997;
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.intro-left {
  left: 0;
  transform-origin: left center;
}

.intro-right {
  right: 0;
  transform-origin: right center;
}

/* Línea vertical marrón que baja al centro */
.intro-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 0;
  background: var(--primary-brown, #5C4033);
  z-index: 9998;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(92, 64, 51, 0.4);
  animation: lineGrow 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Animación de crecimiento de la línea vertical */
@keyframes lineGrow {
  0% {
    height: 0%;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    height: 100vh;
    opacity: 1;
  }
}

/* Cuando se activa la apertura */
.intro-overlay.open .intro-left {
  transform: translateX(-100%);
}

.intro-overlay.open .intro-right {
  transform: translateX(100%);
}

.intro-overlay.open .intro-line {
  opacity: 0;
  transition: opacity 0.35s ease-out;
}

/* Animación de la página principal (Fade In de blanco + Zoom In suave) */
.page-anim-ready {
  animation: pageZoomIn 0.85s var(--ease-out-craft) forwards;
  transform-origin: center center;
}

@keyframes pageZoomIn {
  0% {
    opacity: 0;
    transform: scale(0.98);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

/* Animación de revelado progresivo y suave para tarjetas */
@keyframes smoothFadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Micro-animaciones del Sistema de Diseño */
@keyframes craftShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulseSubtleGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(192, 108, 76, 0.25);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(192, 108, 76, 0);
  }
}

@keyframes pulseGoldGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.3);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(197, 160, 89, 0);
  }
}

.artisan-card, .project-card, .review-card, .category-card {
  animation: smoothFadeUp 0.65s var(--ease-out-craft) both;
}

/* Retardo escalonado para que las tarjetas de la cuadrícula entren en cascada fluida */
.directory-grid > *:nth-child(1) { animation-delay: 0.04s; }
.directory-grid > *:nth-child(2) { animation-delay: 0.10s; }
.directory-grid > *:nth-child(3) { animation-delay: 0.16s; }
.directory-grid > *:nth-child(4) { animation-delay: 0.22s; }
.directory-grid > *:nth-child(5) { animation-delay: 0.28s; }
.directory-grid > *:nth-child(6) { animation-delay: 0.34s; }
.directory-grid > *:nth-child(n+7) { animation-delay: 0.40s; }

.category-grid > *:nth-child(1) { animation-delay: 0.05s; }
.category-grid > *:nth-child(2) { animation-delay: 0.10s; }
.category-grid > *:nth-child(3) { animation-delay: 0.15s; }
.category-grid > *:nth-child(4) { animation-delay: 0.20s; }
.category-grid > *:nth-child(5) { animation-delay: 0.25s; }
.category-grid > *:nth-child(6) { animation-delay: 0.30s; }
.category-grid > *:nth-child(n+7) { animation-delay: 0.35s; }

/* Transición suave de imágenes desde blanco/placeholder */
.artisan-img, .project-media {
  background-color: #FFFFFF;
  transition: opacity 0.5s ease, transform 0.4s var(--ease-out-craft), box-shadow 0.4s var(--ease-out-craft);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Contenedores */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Tipografía */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.25;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  background-color: var(--beige-medium);
  color: var(--primary-brown);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 650px;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Botones con Micro-interacción Táctil */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease-spring), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  font-size: 0.95rem;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background-color: var(--terracotta);
  color: #FFF;
  box-shadow: 0 6px 18px rgba(192, 108, 76, 0.25);
}

.btn-primary:hover {
  background-color: var(--terracotta-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(192, 108, 76, 0.35);
}

.btn-primary:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 4px 10px rgba(192, 108, 76, 0.2);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--primary-dark);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--beige-light);
  border-color: var(--terracotta);
  color: var(--terracotta);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.96);
}

.btn-gold {
  background-color: var(--warm-gold);
  color: #FFF;
  box-shadow: 0 6px 18px rgba(197, 160, 89, 0.25);
}

.btn-gold:hover {
  background-color: var(--warm-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(197, 160, 89, 0.35);
}

.btn-gold:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 4px 10px rgba(197, 160, 89, 0.2);
}

/* Header & Navbar */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition-normal);
  padding: 1.25rem 0;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 221, 208, 0.5);
}

.header.scrolled {
  padding: 0.8rem 0;
  box-shadow: var(--shadow-md);
  background: rgba(250, 247, 242, 0.95);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(192, 108, 76, 0.25);
  transition: transform 0.2s ease;
}

.logo:hover img {
  transform: scale(1.06);
}

.logo i {
  color: var(--terracotta);
  font-size: 1.6rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0 auto;
}

.nav-link {
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--terracotta);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--terracotta);
  transition: var(--transition-fast);
  border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: auto;
  padding-top: 7.2rem;
  padding-bottom: 2.8rem;
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background-image: url('images/hero_bg_1786534843103.png');
  background-size: cover;
  background-position: center;
  opacity: 0.45;
  mask-image: linear-gradient(to right, transparent, black 40%);
  -webkit-mask-image: linear-gradient(to right, transparent, black 40%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  animation: smoothFadeUp 0.8s var(--ease-out-craft) forwards;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background-color: rgba(192, 108, 76, 0.1);
  color: var(--terracotta);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(192, 108, 76, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(192, 108, 76, 0.15);
}

.hero-title {
  font-size: 3.2rem;
  line-height: 1.15;
  margin-bottom: 0.8rem;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.hero-title span {
  color: var(--terracotta);
  font-style: italic;
  position: relative;
  display: inline-block;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.4rem;
  line-height: 1.6;
}

/* Hero Search Box con Halo Reactivo */
.hero-search-box {
  background: var(--bg-card);
  padding: 0.5rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-craft-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-color);
  max-width: 600px;
  transition: border-color 0.25s ease, box-shadow 0.3s var(--ease-out-craft), transform 0.25s var(--ease-out-craft);
}

.hero-search-box:focus-within {
  border-color: var(--terracotta);
  box-shadow: 0 12px 35px rgba(192, 108, 76, 0.2), 0 0 0 3px rgba(192, 108, 76, 0.12);
  transform: translateY(-2px);
}

.hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.7rem 1.2rem;
  font-size: 0.95rem;
  background: transparent;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.hero-search-input::placeholder {
  color: var(--text-muted);
}

/* Stats Counter con Micro-Interacciones */
.hero-stats {
  display: flex;
  justify-content: flex-start;
  gap: 2.2rem;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  transition: transform 0.2s var(--ease-spring);
}

.stat-item:hover {
  transform: translateY(-3px);
}

.stat-item h4 {
  font-size: 1.8rem;
  color: var(--primary-dark);
  font-family: var(--font-heading);
}

.stat-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Categorías Section */
.categories-section {
  padding: 3rem 0 2rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.8rem 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.28s var(--ease-spring), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.28s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.category-card:hover, .category-card.active {
  background: var(--beige-light);
  border-color: var(--terracotta);
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-craft-md);
}

.category-card:active {
  transform: translateY(-2px) scale(0.98);
}

.category-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(192, 108, 76, 0.08);
  border: 1px solid rgba(192, 108, 76, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s var(--ease-spring), background 0.2s ease, box-shadow 0.25s ease;
}

.category-card:hover .category-icon, .category-card.active .category-icon {
  background: rgba(192, 108, 76, 0.18);
  border-color: var(--terracotta);
  transform: scale(1.14) rotate(4deg);
  box-shadow: 0 8px 18px rgba(192, 108, 76, 0.24);
}

.category-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-dark);
}

.category-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Directory Section */
.directory-section {
  padding: 4rem 0 7rem;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (max-width: 1200px) {
  .directory-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 860px) {
  .directory-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 560px) {
  .directory-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Paginación Dinámica del Directorio */
.directory-pagination-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.directory-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--primary-dark);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.18s var(--ease-spring), border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--terracotta);
  background: var(--bg-subtle);
  color: var(--terracotta);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(192, 108, 76, 0.18);
}

.pagination-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.pagination-btn.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(192, 108, 76, 0.35);
  transform: scale(1.04);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Artisan Card */
.artisan-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-craft-sm);
  transition: transform 0.3s var(--ease-out-craft), box-shadow 0.3s var(--ease-out-craft), border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.artisan-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-craft-lg);
  border-color: rgba(192, 108, 76, 0.4);
}

.artisan-card:active {
  transform: translateY(-3px) scale(0.99);
}

.artisan-img-wrapper {
  position: relative;
  padding: 1rem 0;
  overflow: hidden;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.artisan-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 16px rgba(62, 39, 35, 0.15);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.35s ease;
}

.artisan-card:hover .artisan-img {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(62, 39, 35, 0.22);
}

.artisan-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(44, 29, 17, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--beige-light);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease;
}

.artisan-card:hover .artisan-badge {
  transform: translateY(-1px);
}

.artisan-new-badge {
  position: absolute;
  top: 3.3rem;
  left: 1rem;
  background: linear-gradient(135deg, #2E7D32, #43A047);
  color: #FFFFFF;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 5;
  animation: pulseNewBadge 2.5s infinite ease-in-out;
}

@keyframes pulseNewBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.artisan-rating {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: var(--primary-dark);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.artisan-rating i {
  color: var(--warm-gold);
}

.artisan-rating.no-reviews {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(220, 210, 195, 0.6);
  padding: 0.25rem 0.6rem;
  gap: 0.35rem;
}

.artisan-rating.no-reviews i {
  color: #BDBDBD;
}

.artisan-body {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.artisan-name {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
  color: var(--primary-dark);
}

.artisan-trade {
  color: var(--terracotta);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.artisan-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.artisan-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-subtle);
}

.artisan-meta i {
  color: var(--terracotta);
}

.artisan-footer {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Section "Unirse / Registro" Banner */
.join-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1A0E07 100%);
  color: var(--text-light);
  border-radius: var(--radius-lg);
  padding: 4.5rem 3rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-craft-lg);
  margin: 4rem 0;
  border: 1px solid rgba(192, 108, 76, 0.2);
}

.join-banner-bg {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 50%;
  height: 120%;
  background: radial-gradient(circle, rgba(192, 108, 76, 0.25) 0%, rgba(197, 160, 89, 0.08) 50%, transparent 70%);
  animation: floatGentle 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.join-banner-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.join-banner h2 {
  color: #FFF;
  font-size: 2.8rem;
  margin-bottom: 1.2rem;
}

.join-banner p {
  color: var(--beige-medium);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 12, 7, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
  cursor: pointer;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: var(--bg-card);
  border-radius: 24px;
  max-width: 750px;
  width: 100%;
  height: auto;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: translateY(24px) scale(0.95);
  transition: transform 0.35s var(--ease-spring);
  border: 1px solid var(--border-color);
  cursor: default;
  overflow: hidden !important;
  box-sizing: border-box;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

/* ── Botón cerrar: área fija NO scrollable ── */
.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: none;
  color: var(--primary-dark);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s var(--ease-spring), background-color 0.2s ease, color 0.2s ease;
  z-index: 25;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--terracotta);
  color: #FFF;
  transform: scale(1.1) rotate(90deg);
}

.modal-close:active {
  transform: scale(0.92);
}

/* ── Cuerpo scrollable del modal — la scrollbar queda DENTRO del recuadro ── */
.modal-body {
  padding: 2.5rem 2rem 2.5rem 2.5rem;
  overflow-y: auto !important;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  margin: 12px 10px 12px 0;

  /* Firefox */
  scrollbar-width: thin !important;
  scrollbar-color: #5C4033 #F4EFE6 !important;
}

/* Chrome / Edge / Safari */
.modal-body::-webkit-scrollbar {
  width: 10px !important;
  display: block !important;
}

.modal-body::-webkit-scrollbar-track {
  background: #F4EFE6 !important;
  border-radius: 10px !important;
}

.modal-body::-webkit-scrollbar-thumb {
  background-color: #5C4033 !important;
  border-radius: 10px !important;
  border: 2px solid #F4EFE6 !important;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background-color: #3E2723 !important;
}

/* Modal Form Styles */
.form-group {
  margin-bottom: 1.4rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--terracotta);
  background: #FFF;
  box-shadow: 0 0 0 4px rgba(192, 108, 76, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Detail Modal Styling */
.modal-header-hero {
  height: 280px;
  position: relative;
  overflow: hidden;
}

.modal-header-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-header-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem 2.5rem 1.5rem;
  background: linear-gradient(to top, rgba(44, 29, 17, 0.9) 0%, transparent 100%);
  color: #FFF;
}

.modal-header-overlay h2 {
  color: #FFF;
  font-size: 2.2rem;
}

.contact-info-box {
  background: var(--beige-light);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  border: 1px solid var(--border-color);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.contact-item i {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  color: var(--terracotta);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--beige-medium);
  padding: 5rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-brand h3 {
  color: #FFF;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-title {
  color: #FFF;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--text-muted);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
}

.footer-links a i {
  width: 20px;
  font-size: 1.05rem;
  color: var(--terracotta);
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-links a:hover i {
  transform: scale(1.15);
  color: var(--warm-gold);
}

.footer-bottom {
  padding-top: 2.5rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Pestañas del Panel de la Tienda */
.tab-btn {
  background: transparent;
  border: none;
  padding: 0.8rem 1.4rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--terracotta);
}

.tab-btn.active {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
}

/* Promo Badge en Tarjetas de Artesano */
.promo-badge {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, var(--warm-gold) 0%, #B08B45 100%);
  color: #FFF;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.4);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: pulseGold 2s infinite;
}

@keyframes pulseGold {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Galería de Trabajos */
.artisan-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.artisan-gallery-item {
  height: 110px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.artisan-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.artisan-gallery-item img:hover {
  transform: scale(1.1);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.toast {
  background: var(--primary-dark);
  color: #FFF;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: slideInRight 0.4s ease forwards;
  border-left: 4px solid var(--terracotta);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Modal "Gestionar Mi Tienda" (Escala compacta al 85% & Gran Espacio) ── */
#shopManageModal .modal-card {
  max-width: 1260px;
  width: 95vw;
  height: 90vh;
  max-height: 90vh;
  border-radius: 22px;
  background: #FCFAF8;
  border: 1px solid rgba(192, 108, 76, 0.15);
  box-shadow: 0 30px 80px rgba(44, 29, 17, 0.25);
  font-size: 0.85rem;
}

#shopManageModal .modal-body {
  padding: 1.6rem 2.2rem 2.2rem 2.2rem;
}

/* Barra de pestañas segmentada moderna (Sticky para máxima comodidad) */
.shop-tabs-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #FCFAF8;
  padding: 0.3rem 0 0.6rem 0;
  margin-bottom: 1.2rem;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  border-bottom: 1px solid rgba(230, 221, 208, 0.7);
}

.shop-tabs-nav .tab-btn {
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.82rem;
  color: #6D4C41;
  background: #F0EAE1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.shop-tabs-nav .tab-btn:hover {
  color: var(--terracotta);
  background: #FFFFFF;
  border-color: var(--terracotta);
}

.shop-tabs-nav .tab-btn.active {
  color: var(--primary-dark);
  background: #FFFFFF;
  border-color: var(--terracotta);
  box-shadow: 0 3px 10px rgba(62, 39, 35, 0.08);
  font-weight: 700;
}

/* Tarjetas y Contenedores Interiores del Panel */
.dashboard-card {
  background: #FFFFFF;
  border: 1px solid #EBE4DA;
  border-radius: 16px;
  padding: 1.3rem 1.6rem;
  box-shadow: 0 3px 15px rgba(62, 39, 35, 0.03);
  margin-bottom: 1.2rem;
}

.dashboard-card-title {
  font-size: 1.05rem;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Inputs & Form Elements dentro de shopManageModal (85% scale) */
#shopManageModal .form-group {
  margin-bottom: 0.9rem;
}

#shopManageModal .form-label {
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

#shopManageModal .form-input,
#shopManageModal .form-select,
#shopManageModal .form-textarea {
  padding: 0.65rem 0.95rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

#shopManageModal .btn {
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
}

/* ==========================================================================
   SISTEMA RESPONSIVE 100% PROFESIONAL (Móviles, iPhone, Tablets & Desktop)
   ========================================================================== */

/* ── Botón Menú Móvil & Drawer ── */
.mobile-nav-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--primary-dark);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  z-index: 1001;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-toggle:hover, .mobile-nav-toggle:active {
  background: var(--beige-light);
  color: var(--terracotta);
}

.mobile-menu-drawer {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(250, 247, 242, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 15px 35px rgba(44, 29, 17, 0.15);
  padding: 1.5rem 1.5rem calc(2rem + env(safe-area-inset-bottom, 0));
  z-index: 999;
  flex-direction: column;
  gap: 1.2rem;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

.mobile-menu-drawer.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.2rem;
}

.mobile-nav-links .nav-link {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.6rem 0.4rem;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.mobile-nav-links .nav-link:hover, .mobile-nav-links .nav-link:active {
  background: var(--bg-subtle);
  color: var(--terracotta);
}

.mobile-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mobile-auth-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.2rem;
  font-size: 0.95rem;
}

/* ── Media Queries: Tablets y Laptops Compactas (max-width: 992px) ── */
@media (max-width: 992px) {
  .header:not(#mainHeader.perfil-header) .nav-links { display: none; }
  .mobile-nav-toggle { display: flex; }
  
  .header .nav-links {
    gap: 0.8rem;
  }
  
  .hero-title { font-size: clamp(2.2rem, 5.5vw, 3.2rem); }
  .hero-bg { width: 100%; opacity: 0.22; mask-image: none; -webkit-mask-image: none; }
  
  .directory-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.3rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* ── Media Queries: Smartphones y Tablets Pequeñas (max-width: 768px) ── */
@media (max-width: 768px) {
  .container { padding: 0 1.2rem; }
  
  /* Navbar */
  .header {
    padding: 0.75rem 0;
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }
  .header.scrolled { padding: 0.55rem 0; }
  .logo { font-size: 1.35rem; }
  #navAuthActions { display: none !important; } /* Siempre drawer en móviles */
  
  /* Hero */
  .hero {
    padding-top: calc(5.2rem + env(safe-area-inset-top, 0));
    padding-bottom: 3.2rem;
    min-height: auto;
  }
  
  .hero-badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1rem;
  }
  
  .hero-title {
    font-size: clamp(1.9rem, 7vw, 2.6rem);
    margin-bottom: 1rem;
    line-height: 1.2;
  }
  
  .hero-description {
    font-size: 0.98rem;
    margin-bottom: 1.6rem;
    line-height: 1.55;
  }
  
  .hero-search-box {
    padding: 0.5rem;
    flex-direction: column;
    border-radius: 16px;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .hero-search-box i.fa-magnifying-glass {
    display: none;
  }

  .hero-search-input {
    padding: 0.75rem 1rem;
    font-size: 16px !important; /* Previene auto-zoom en iOS */
    width: 100%;
    box-sizing: border-box;
  }
  
  .hero-search-box .btn {
    width: 100%;
    border-radius: 12px;
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-top: 1.8rem;
    padding-top: 1.5rem;
  }
  
  .stat-item h4 {
    font-size: 1.4rem;
  }
  
  .stat-item p {
    font-size: 0.78rem;
  }

  /* Categorías */
  .categories-section {
    padding: 3.2rem 0 2rem;
  }
  
  .section-title {
    font-size: 1.85rem;
  }
  
  .section-subtitle {
    font-size: 0.95rem;
  }
  
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.8rem;
  }
  
  .category-card {
    padding: 1.2rem 0.75rem;
    border-radius: 14px;
  }
  
  .category-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .category-name {
    font-size: 0.9rem;
  }
  
  .category-count {
    font-size: 0.78rem;
  }

  /* Directorio */
  .directory-section {
    padding: 3rem 0;
  }
  
  .directory-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }
  
  .artisan-card-media {
    height: 210px;
  }

  /* Banner Unirse */
  .join-banner {
    padding: 2.2rem 1.4rem;
    margin-top: 3rem;
    border-radius: 18px;
  }
  
  .join-banner h2 {
    font-size: 1.5rem;
    margin-bottom: 0.7rem;
  }
  
  .join-banner p {
    font-size: 0.92rem;
    margin-bottom: 1.4rem;
  }
  
  .join-banner .btn {
    width: 100%;
    justify-content: center;
  }

  /* Modales Universales en Móvil (Full-height o Bottom-sheet Friendly) */
  .modal-overlay {
    padding: 0.5rem;
    align-items: flex-end; /* Efecto bottom-sheet táctil cómodo */
  }
  
  .modal-card {
    border-radius: 20px 20px 0 0;
    max-height: 92dvh !important;
    width: 100% !important;
    margin: 0 !important;
  }
  
  .modal-body {
    padding: 1.3rem 1.1rem calc(1.8rem + env(safe-area-inset-bottom, 0)) !important;
    margin: 4px 0 !important;
  }
  
  .modal-close {
    top: 0.8rem;
    right: 0.8rem;
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
    background: rgba(0, 0, 0, 0.06);
  }
  
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.8rem !important;
  }
  
  /* Inputs tamaño táctil óptimo y legible en iPhone */
  .form-input, .form-select, .form-textarea {
    font-size: 16px !important; /* Estándar iOS para evitar zoom automático */
    padding: 0.75rem 1rem !important;
    border-radius: 10px !important;
  }

  /* Panel de Gestión de Tienda en Móvil */
  #shopManageModal .modal-card {
    width: 100% !important;
    height: 94dvh !important;
    max-height: 94dvh !important;
    border-radius: 20px 20px 0 0 !important;
  }
  
  #shopManageModal .modal-body {
    padding: 1.1rem 0.9rem calc(2rem + env(safe-area-inset-bottom, 0)) !important;
  }
  
  .dashboard-card {
    padding: 1.1rem 1rem !important;
    border-radius: 14px !important;
    margin-bottom: 1rem !important;
  }

  .shop-tabs-nav {
    gap: 0.4rem !important;
    padding-bottom: 0.6rem !important;
  }

  .shop-tabs-nav .tab-btn {
    padding: 0.55rem 0.85rem !important;
    font-size: 0.82rem !important;
  }

  /* Footer */
  .footer {
    padding: 3.5rem 0 calc(2rem + env(safe-area-inset-bottom, 0));
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }

  /* Perfil y Proyectos en Móvil */
  .profile-hero {
    padding-top: calc(5.5rem + env(safe-area-inset-top, 0)) !important;
  }

  .profile-details-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .profile-header-card {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    gap: 1.2rem !important;
  }

  .profile-info {
    min-width: 100% !important;
  }

  .profile-info h1 {
    font-size: 1.95rem !important;
  }

  .profile-meta-chips {
    justify-content: center !important;
    gap: 0.5rem !important;
  }

  .profile-actions-box {
    width: 100% !important;
    min-width: 100% !important;
  }

  .profile-actions-box .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.85rem 1.2rem !important;
  }

  /* CRM en Tablet / Móvil */
  .crm-header {
    padding: 0.8rem 1rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.8rem !important;
  }

  .crm-nav {
    padding: 0 0.8rem !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    gap: 0.6rem !important;
    -webkit-overflow-scrolling: touch;
  }

  .crm-nav-item {
    font-size: 0.85rem !important;
    padding: 0.75rem 0.4rem !important;
  }

  .crm-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.8rem !important;
  }

  .crm-stat-card {
    padding: 1rem 0.8rem !important;
    gap: 0.8rem !important;
  }

  .crm-stat-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.1rem !important;
  }
}

/* ── Media Queries: Pantallas muy pequeñas / Móviles compactos (max-width: 480px) ── */
@media (max-width: 480px) {
  .container { padding: 0 0.9rem; }
  
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .category-card {
    padding: 1rem 0.5rem;
  }
  
  .btn {
    padding: 0.75rem 1.2rem;
    font-size: 0.92rem;
  }

  .crm-stats-grid {
    grid-template-columns: 1fr !important;
  }

  .modal-overlay {
    padding: 0 !important;
  }

  .modal-card {
    border-radius: 18px 18px 0 0 !important;
    max-height: 94dvh !important;
  }

  .modal-body {
    padding: 1.2rem 0.9rem calc(2rem + env(safe-area-inset-bottom, 0)) !important;
  }
}

/* ── Insignias de Funcionalidades del Taller (Encargos & Visitable) ── */
.badge-feature {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  line-height: 1.2;
}

.badge-custom-orders {
  background: rgba(197, 160, 89, 0.14);
  color: #7D5C14;
  border: 1px solid rgba(197, 160, 89, 0.45);
}

.badge-visitable {
  background: rgba(192, 108, 76, 0.12);
  color: var(--terracotta);
  border: 1px solid rgba(192, 108, 76, 0.35);
}

/* ── Precios y Ficha Técnica de Proyectos ── */
.project-card-price-badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  background: rgba(44, 29, 17, 0.85);
  color: #FFF;
  backdrop-filter: blur(6px);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.project-price-tag {
  background: rgba(197, 160, 89, 0.18);
  color: #7D5C14;
  border: 1.5px solid var(--warm-gold);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.project-tech-sheet {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 15px rgba(62, 39, 35, 0.03);
}

.tech-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.tech-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tech-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tech-val {
  font-size: 0.95rem;
  color: var(--primary-dark);
  font-weight: 700;
}

/* ── Botones Flotantes: Asistencia y Chat (Posicionamiento armonioso) ── */
#btnFloatingSupport {
  position: fixed !important;
  bottom: calc(2rem + env(safe-area-inset-bottom, 0)) !important;
  right: 6.8rem !important;
  z-index: 3900 !important;
  background: var(--primary-dark);
  color: #FFF;
  border: none;
  border-radius: 30px;
  padding: 0.75rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(62, 39, 35, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  touch-action: manipulation;
}

#btnFloatingSupport:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(62, 39, 35, 0.45);
  background: #2C1D11;
}

#chatFloatingButton {
  position: fixed !important;
  bottom: calc(2rem + env(safe-area-inset-bottom, 0)) !important;
  right: 1.8rem !important;
  z-index: 4000 !important;
}

#chatWindowContainer {
  position: fixed !important;
  bottom: calc(6.6rem + env(safe-area-inset-bottom, 0)) !important;
  right: 1.8rem !important;
  z-index: 4000 !important;
}

@media (max-width: 768px) {
  #btnFloatingSupport {
    bottom: calc(5.8rem + env(safe-area-inset-bottom, 0)) !important;
    right: 1.2rem !important;
    padding: 0.65rem 1.1rem !important;
    font-size: 0.85rem !important;
  }
  #chatFloatingButton {
    bottom: calc(1.2rem + env(safe-area-inset-bottom, 0)) !important;
    right: 1.2rem !important;
  }
  #chatWindowContainer {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 88dvh !important;
    max-height: 88dvh !important;
    border-radius: 20px 20px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
  }
}

/* ========================================================
   SISTEMA DE EMOTICONOS Y REACCIONES ARTESANALES
   Paleta: Tonos marrones, terracota, maderas y oro cálido
   ======================================================== */

.artisan-emoji-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.22em;
  margin: 0 1px;
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.artisan-emoji-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.artisan-emoji-inline:hover {
  transform: scale(1.22) rotate(4deg);
  filter: drop-shadow(0 2px 4px rgba(62, 39, 35, 0.25));
}

.artisan-emoji-sticker {
  display: inline-block;
  padding: 0.25rem;
  animation: artisanStickerPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.2s ease;
}

.artisan-emoji-sticker:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 4px 10px rgba(192, 108, 76, 0.35));
}

@keyframes artisanStickerPop {
  0% { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  70% { transform: scale(1.15) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Popover Flotante del Selector */
.artisan-emoji-picker-container {
  position: fixed;
  z-index: 999999;
  animation: aepFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aepFadeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.artisan-emoji-picker-panel {
  width: 330px;
  max-width: calc(100vw - 2rem);
  height: 410px;
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 40px rgba(44, 29, 17, 0.22), 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-body);
}

.aep-header {
  background: linear-gradient(135deg, #2D251E 0%, #1D1510 100%);
  color: #FFFFFF;
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.aep-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.aep-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #FAF7F2;
  display: flex;
  align-items: center;
}

.aep-close-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #FFFFFF;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.15s ease;
}

.aep-close-btn:hover {
  background: rgba(255,255,255,0.25);
}

.aep-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.aep-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.aep-search-input {
  width: 100%;
  background: #FAF7F2;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 0.45rem 2rem 0.45rem 2.2rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.aep-search-input:focus {
  border-color: var(--terracotta);
  background: #FFFFFF;
}

.aep-search-clear {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem;
}

/* Pestañas de categoría */
.aep-tabs {
  display: flex;
  background: #F4EFE6;
  padding: 0.35rem 0.5rem;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.aep-tab {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.aep-tab:hover {
  background: rgba(192, 108, 76, 0.12);
  color: var(--primary-dark);
}

.aep-tab.active {
  background: var(--terracotta);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(192, 108, 76, 0.3);
}

/* Rejilla de Emoticonos */
.aep-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: #FAF7F2;
  align-content: start;
}

.aep-emoji-item {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.15s ease, border-color 0.15s ease;
  padding: 0.4rem;
}

.aep-emoji-item:hover {
  transform: scale(1.15);
  border-color: var(--terracotta);
  box-shadow: 0 6px 14px rgba(192, 108, 76, 0.2);
  z-index: 2;
  background: #FFFDF9;
}

.aep-emoji-item:active {
  transform: scale(0.95);
}

.aep-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Pie de vista previa */
.aep-preview-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
}

.aep-preview-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aep-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#aepPreviewName {
  font-size: 0.82rem;
  color: var(--primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#aepPreviewCode {
  font-size: 0.72rem;
  color: var(--terracotta);
  font-family: monospace;
}

.aep-hint-badge {
  font-size: 0.68rem;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* Barra rápida de reacciones para Chat */
.chat-quick-reactions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  background: #FAF7F2;
  border-top: 1px solid rgba(0,0,0,0.04);
  overflow-x: auto;
}

.chat-reaction-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  font-size: 0.8rem;
}

.chat-reaction-btn:hover {
  transform: scale(1.18);
  background: var(--bg-subtle);
  border-color: var(--terracotta);
}

.btn-emoji-trigger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.btn-emoji-trigger:hover {
  background: rgba(192, 108, 76, 0.12);
  color: var(--terracotta);
  transform: scale(1.1);
}

/* ── Sistema de Reordenación Drag & Drop de Multimedia en Proyectos ── */
.project-media-item-card {
  background: #FFFFFF;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  flex-wrap: wrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  position: relative;
}

.project-media-item-card.is-dragging {
  opacity: 0.4;
  transform: scale(0.98);
  border: 2px dashed var(--warm-gold) !important;
  box-shadow: 0 8px 24px rgba(197, 160, 89, 0.25) !important;
}

.project-media-item-card.drag-over-target {
  border: 2px solid var(--terracotta) !important;
  box-shadow: 0 0 16px rgba(192, 108, 76, 0.3) !important;
  transform: translateY(-3px);
  background: rgba(192, 108, 76, 0.03) !important;
}

.project-step-card-item.is-dragging {
  opacity: 0.45;
  transform: scale(0.96);
  border: 2px dashed var(--warm-gold) !important;
  box-shadow: 0 8px 24px rgba(197, 160, 89, 0.3) !important;
}

.project-step-card-item.drag-over-target {
  border: 2px solid var(--terracotta) !important;
  box-shadow: 0 0 16px rgba(192, 108, 76, 0.35) !important;
  transform: translateY(-4px);
  background: rgba(192, 108, 76, 0.04) !important;
}

.drag-grip-handle {
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.5rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
  font-size: 1.1rem;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.drag-grip-handle:hover,
.project-media-item-card:hover .drag-grip-handle {
  color: var(--terracotta);
  border-color: var(--terracotta);
  background: rgba(192, 108, 76, 0.08);
}

.drag-grip-handle:active {
  cursor: grabbing;
}

.btn-reorder-nav {
  background: var(--bg-subtle);
  color: var(--primary-dark);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reorder-nav:hover {
  background: var(--terracotta);
  color: #FFFFFF;
  border-color: var(--terracotta);
  transform: scale(1.08);
}

.btn-reorder-cover {
  background: rgba(197, 160, 89, 0.15);
  color: var(--warm-gold-hover);
  border: 1px solid var(--warm-gold);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-reorder-cover:hover {
  background: var(--warm-gold);
  color: #FFFFFF;
  transform: scale(1.04);
}

.btn-reorder-del {
  background: #FFEBEE;
  color: #D32F2F;
  border: 1px solid #FFCDD2;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-reorder-del:hover {
  background: #D32F2F;
  color: #FFFFFF;
  border-color: #D32F2F;
}

/* ==========================================================================
   UTILIDADES DE ANIMACIÓN Y ACCESIBILIDAD (PREFERS-REDUCED-MOTION)
   ========================================================================== */

.animate-float {
  animation: floatGentle 4s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, var(--terracotta) 0%, var(--warm-gold) 50%, var(--terracotta) 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: craftShimmer 6s linear infinite;
}

.pulse-badge {
  animation: pulseSubtleGlow 2.5s infinite ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .join-banner-bg,
  .hero-badge,
  .animate-float,
  .animate-shimmer,
  .pulse-badge {
    animation: none !important;
  }
}

/* ── Grid Minimalista de Previsualización Multimedia (Proyectos) ── */
.minimal-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.85rem;
  margin-top: 0.6rem;
}

.minimal-media-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-subtle, #F7F5F0);
  border: 2px solid var(--border-color, #E2E8F0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: grab;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.minimal-media-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.09);
  border-color: #CBD5E0;
}

.minimal-media-card.is-cover {
  border-color: var(--warm-gold, #C5A059) !important;
  box-shadow: 0 3px 12px rgba(197, 160, 89, 0.2);
}

.minimal-media-card.is-dragging {
  opacity: 0.35;
  transform: scale(0.94);
  border: 2px dashed var(--warm-gold) !important;
}

.minimal-media-card.drag-over-target {
  border: 2px solid var(--terracotta) !important;
  box-shadow: 0 0 16px rgba(192, 108, 76, 0.35) !important;
  transform: scale(1.04);
}

.minimal-media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.minimal-media-badge-cover {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: var(--warm-gold, #C5A059);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.minimal-media-badge-pos {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

.minimal-media-badge-video {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

.minimal-media-del-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  border: none;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3;
}

.minimal-media-del-btn:hover {
  background: #E53E3E;
  transform: scale(1.1);
}

.minimal-media-controls {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 3px;
  z-index: 3;
}

.minimal-media-ctrl-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: all 0.15s ease;
}

.minimal-media-ctrl-btn:hover {
  background: #FFFFFF;
  color: var(--terracotta);
  transform: scale(1.08);
}
