:root {
  --bg: #e8e0d1;
  --bg-deep: #d8ccb6;
  --surface: #f4ede0;
  --surface-2: #ebe1cf;
  --text: #1d242d;
  --muted: #5d665f;
  --brand: #0d6f6d;
  --brand-strong: #0a5250;
  --accent: #28b2a5;
  --border: #c6b59a;
  --border-strong: #a99374;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 34px rgba(71, 48, 21, 0.1);
  --shadow-hover: 0 20px 44px rgba(44, 24, 5, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Segoe UI", "Noto Sans", sans-serif;
  color: var(--text);
  line-height: 1.55;
  background:
    radial-gradient(
      circle at 0% 0%,
      rgba(255, 255, 255, 0.45),
      transparent 46%
    ),
    radial-gradient(
      circle at 100% 12%,
      rgba(40, 178, 165, 0.14),
      transparent 34%
    ),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

a {
  color: var(--brand-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1140px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border-strong);
  background: rgba(244, 237, 224, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 18px rgba(59, 37, 12, 0.11);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-mark {
  inline-size: 2rem;
  block-size: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #0d6f6d, #1f7fa7);
  box-shadow: 0 8px 16px rgba(13, 111, 109, 0.3);
  color: #fff;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 700;
  text-transform: lowercase;
}

.brand-text {
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.08rem;
}

.brand-core {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.24rem;
  letter-spacing: 0.02em;
  color: #1c2830;
  font-weight: 700;
}

.brand-domain {
  font-size: 0.94rem;
  color: #2c6b7a;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(255, 255, 255, 0.38);
  color: var(--text);
  font-weight: 700;
  gap: 0.35rem;
}

.main-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.main-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.main-nav a:hover {
  background: rgba(13, 111, 109, 0.12);
  border-color: rgba(13, 111, 109, 0.3);
  text-decoration: none;
  transform: translateY(-1px);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  position: static;
  margin-left: 0.75rem;
}

.breadcrumbs {
  padding-top: 0.95rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  color: #5f6d65;
  font-size: 0.94rem;
}

.breadcrumbs li::after {
  content: "/";
  margin-left: 0.45rem;
}

.breadcrumbs li:last-child::after {
  content: "";
}

.site-main {
  padding: 1.2rem 0 2.8rem;
}

.hero,
.page-intro,
.category-block,
.tool-page,
.legal-page,
.future-wall,
.categories-hub,
.image-credit-note {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
  margin-bottom: 1rem;
}

.hero {
  display: grid;
  gap: 1rem;
  align-items: center;
}

.hero-copy-block h1 {
  margin-top: 0;
  margin-bottom: 0.55rem;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.1;
}

.eyebrow {
  margin-top: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 800;
}

.hero-copy {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1rem 0 0.9rem;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-pills span {
  background: rgba(13, 111, 109, 0.12);
  border: 1px solid rgba(13, 111, 109, 0.3);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-visual {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.hero-visual img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  max-block-size: 520px;
  object-fit: cover;
}

.visual-badge {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  background: rgba(13, 111, 109, 0.74);
  color: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.88rem;
}

.future-wall {
  display: grid;
  gap: 0.8rem;
}

.future-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.32);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.future-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.future-card img {
  display: block;
  inline-size: 100%;
  block-size: 200px;
  object-fit: cover;
}

.future-card p {
  margin: 0;
  padding: 0.75rem;
  font-weight: 600;
}

.categories-hub h2 {
  margin-top: 0;
}

.category-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.category-hub-card {
  display: grid;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

.category-hub-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.hub-icon {
  font-size: 1.1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.section-head a {
  border: 1px solid rgba(13, 111, 109, 0.35);
  background: rgba(13, 111, 109, 0.12);
  border-radius: 999px;
  padding: 0.3rem 0.68rem;
  font-weight: 700;
}

.section-head a:hover {
  text-decoration: none;
  background: rgba(13, 111, 109, 0.22);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.8rem;
}

.tool-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.36);
  padding: 0.86rem;
  transform-style: preserve-3d;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.tool-card-glow {
  position: absolute;
  inset: -30% -20% auto;
  height: 180px;
  background: radial-gradient(
    circle,
    rgba(79, 204, 183, 0.36) 0%,
    rgba(79, 204, 183, 0) 72%
  );
  transform: translate3d(calc(var(--mx, 50) * 1% - 50%), -50%, 0);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.tool-card:hover .tool-card-glow,
.tool-card:focus-within .tool-card-glow,
.tool-card.is-tilting .tool-card-glow {
  opacity: 1;
}

.tool-card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

.tool-card h3 a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
}

.tool-icon {
  font-size: 1.1rem;
}

.tool-card-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 0.4rem;
  font-weight: 700;
}

.tool-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.tool-card-meta span {
  border: 1px solid rgba(13, 111, 109, 0.26);
  background: rgba(13, 111, 109, 0.1);
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.tool-card-cta::after {
  content: "→";
  margin-left: 0.32rem;
  transition: transform 160ms ease;
}

.tool-card:hover .tool-card-cta::after {
  transform: translateX(3px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  padding: 0.66rem 1rem;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(145deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 8px 20px rgba(13, 111, 109, 0.33);
}

.btn-primary:hover {
  text-decoration: none;
  background: linear-gradient(145deg, var(--brand-strong), #17897f);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
}

.search-form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.search-form input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
  background: rgba(255, 255, 255, 0.45);
}

.search-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 111, 109, 0.14);
}

.tool-header h1 {
  margin-top: 0;
}

.privacy-note {
  border-left: 3px solid rgba(13, 111, 109, 0.36);
  padding-left: 0.65rem;
  color: #36493f;
}

.tool-workbench {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.37);
  padding: 0.95rem;
  overflow: hidden;
  /* Prevent child overflow */
  position: relative;
}

.tool-seo-block {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.34);
  padding: 0.95rem;
}

.tool-seo-block h2 {
  margin-top: 0;
}

.tool-controls {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  padding: 0.7rem;
  border: 1px solid rgba(13, 111, 109, 0.22);
  border-radius: 10px;
  background: rgba(13, 111, 109, 0.06);
  overflow: hidden;
}

.tool-controls label {
  display: grid;
  gap: 0.32rem;
  font-size: 0.93rem;
  font-weight: 600;
}

.tool-controls input:not([type="checkbox"]):not([type="radio"]),
.tool-controls select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.48rem 0.56rem;
  background: rgba(255, 255, 255, 0.72);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tool-controls .control-row {
  display: grid;
  gap: 0.55rem;
}

.tool-controls input[type="checkbox"],
.tool-controls input[type="radio"] {
  width: auto;
  max-width: none;
  min-width: auto;
  padding: 0;
  margin: 0;
  border: 0;
  justify-self: start;
}

.image-preview-card {
  border: 1px solid rgba(13, 111, 109, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.65rem;
  overflow: hidden;
}

.image-preview-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
  max-width: 100%;
  min-width: 0;
  border-radius: 8px;
}

.preview-meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.image-preview {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(52vh, 360px);
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  margin-inline: auto;
}

/* Forzar que nada se salga del viewport */
html,
body {
  overflow-x: hidden;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

.site-main,
.container {
  max-width: 100%;
  overflow-x: hidden;
}

/* --- Editor de Recorte Profesional (Cropper.js) --- */
.crop-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(13, 111, 109, 0.04);
  border: 1px solid rgba(13, 111, 109, 0.15);
  border-radius: 12px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 111, 109, 0.2);
}

.crop-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 1.5rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.crop-main-area {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.crop-container {
  width: 100% !important;
  max-width: 100% !important;
  height: 500px;
  /* Altura fija para el contenedor base */
  max-height: 65vh;
  /* Limitar altura según el dispositivo */
  background: #1a1e22;
  border-radius: 12px;
  overflow: hidden !important;
  position: relative;
  display: block;
  border: 4px solid #1a1e22;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.crop-image {
  display: block;
  max-width: 100%;
}

/* Forzar que el canvas interno de Cropper.js no se desborde */
.cropper-container {
  max-width: 100% !important;
  max-height: 100% !important;
}

.crop-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  padding: 2rem;
  position: absolute;
  inset: 0;
}

.crop-placeholder p {
  margin: 0;
  font-size: 0.95rem;
}

.crop-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preview-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  overflow: hidden;
}

.preview-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.img-preview {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #eee;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.meta-info {
  background: var(--brand-strong);
  color: #fff;
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta-item span {
  opacity: 0.8;
  font-size: 0.8rem;
}

/* Cropper.js Overrides to match theme */
.cropper-view-box,
.cropper-face {
  border-radius: 0;
}

.cropper-line {
  background-color: var(--accent);
}

.cropper-point {
  background-color: var(--accent);
  width: 8px;
  height: 8px;
}

.cropper-bg {
  background-image: none !important;
  background-color: #1a1e22 !important;
}

@media (max-width: 860px) {
  .crop-workspace {
    grid-template-columns: 1fr;
  }

  .crop-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .preview-box {
    flex: 1;
    min-width: 160px;
  }

  .meta-info {
    flex: 1;
    min-width: 160px;
  }
}

@media (max-width: 480px) {
  .crop-container {
    height: 320px;
  }

  .crop-controls-grid {
    grid-template-columns: 1fr;
  }
}

.drop-zone {
  border: 2px dashed rgba(13, 111, 109, 0.52);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.38);
  padding: 1rem;
  text-align: center;
  margin-bottom: 0.65rem;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.drop-zone.dragover {
  border-color: var(--brand-strong);
  background: rgba(40, 178, 165, 0.17);
  transform: scale(1.005);
}

.drop-zone input[type="file"] {
  position: absolute;
  opacity: 0;
  inline-size: 1px;
  block-size: 1px;
}

.hint,
.status-text {
  color: var(--muted);
}

.file-list {
  margin-top: 0.7rem;
  margin-bottom: 0.8rem;
}

.hidden {
  display: none;
}

.faq-section details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.41);
  padding: 0.7rem;
  margin-bottom: 0.6rem;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.faq-section details[open] {
  border-color: var(--border-strong);
  box-shadow: 0 8px 20px rgba(49, 31, 12, 0.12);
}

.site-footer {
  border-top: 1px solid var(--border-strong);
  background: rgba(244, 237, 224, 0.95);
  box-shadow: inset 0 10px 18px rgba(57, 36, 12, 0.07);
}

.footer-grid {
  padding: 1.6rem 0 1rem;
  display: grid;
  gap: 1rem;
}

.footer-grid h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

.footer-grid p {
  margin: 0;
  color: var(--muted);
}

.footer-links {
  display: grid;
  gap: 0.4rem;
}

.footer-links a {
  width: fit-content;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 0.72rem 0 1.1rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 0.93rem;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(11px);
  transition:
    opacity 380ms ease,
    transform 460ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.image-credit-note p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.image-credit-note h2 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.2rem;
  }

  .future-wall {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 1.3rem;
  }

  .tool-controls .control-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex;
  }

  .js-ready .main-nav {
    display: none;
    position: absolute;
    inset: calc(100% + 8px) 1rem auto 1rem;
    background: #f2e8d8;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    padding: 0.5rem;
    flex-direction: column;
    margin-left: 0;
  }

  .js-ready .main-nav.is-open {
    display: flex;
  }

  .header-inner {
    position: relative;
  }
}

/* --- Herramienta de PDF Interactiva --- */
.pdf-tool-header {
  margin-bottom: 1rem;
}

.info-alert.pdf-mode {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.pdf-item-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  cursor: grab;
  list-style: none;
  /* Quitar viñetas */
  transition:
    transform 0.1s,
    box-shadow 0.1s,
    background-color 0.2s;
}

.pdf-item-card:hover {
  background-color: #fbfbfb;
  border-color: var(--border-strong);
}

.pdf-item-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  border-style: dashed;
}

.pdf-item-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.pdf-item-number {
  width: 24px;
  height: 24px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pdf-item-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
}

.pdf-item-size {
  font-size: 0.75rem;
  color: var(--muted);
}

.btn-item-remove {
  border: none;
  background: none;
  color: #ef4444;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}

.btn-item-remove:hover {
  background: #fee2e2;
}

@media (max-width: 600px) {
  .pdf-item-name {
    max-width: 180px;
  }
}

/* --- Herramienta de Imagenes a PDF (Galeria) --- */
.images-pdf-configs {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.images-pdf-configs * {
  box-sizing: border-box;
  max-width: 100%;
}

.images-pdf-count {
  margin: 0;
  width: fit-content;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.images-pdf-sort-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.images-pdf-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.images-pdf-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.images-pdf-thumb-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  user-select: none;
  cursor: grab;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.images-pdf-thumb-item:active {
  cursor: grabbing;
}

.images-pdf-thumb-item.is-dragging {
  opacity: 0.35;
  transform: scale(0.96);
}

.images-pdf-thumb-item.is-drop-target .images-pdf-thumb-wrap {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 111, 109, 0.2);
}

.images-pdf-thumb-wrap {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f7f7f7;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.images-pdf-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  display: block;
}

.images-pdf-thumb-index {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.images-pdf-ghost {
  opacity: 0.92;
  transform-origin: center;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.2);
}

body.images-pdf-dragging {
  cursor: grabbing;
}

/* --- Herramienta de Dividir PDF (Visual Feedback) --- */
.split-pdf-configs {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.split-status-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.file-name-pill,
.pages-count-pill {
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-strong);
}

.pages-count-pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-strong);
}

.split-controls-grid {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.control-group label {
  display: flex;
  align-items: center;
  margin-bottom: 0.6rem;
  color: var(--brand-strong);
  font-weight: 700;
}

.control-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--bg);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.control-group input:focus {
  outline: none;
  border-color: var(--brand);
}

.input-hint {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.split-visual-feedback-container {
  max-height: 640px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  border: 2px dashed var(--border);
  padding: 1.25rem;
  width: 100%;
}

.split-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.split-grid-meta {
  margin: 0;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.split-grid-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand-strong);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background-color 0.2s,
    color 0.2s;
}

.split-grid-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.split-grid-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.split-visual-feedback {
  display: block;
  width: 100%;
  min-height: 230px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.split-empty-state {
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  gap: 1rem;
}

.split-pages-grid {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(6, 120px);
  gap: 0.9rem;
  padding: 0.5rem;
  justify-content: center;
  justify-items: center;
  align-items: start;
  width: 100%;
}

@media (max-width: 1100px) {
  .split-pages-grid {
    grid-template-columns: repeat(5, 118px);
  }
}

@media (max-width: 920px) {
  .split-pages-grid {
    grid-template-columns: repeat(4, 114px);
  }
}

@media (max-width: 760px) {
  .split-pages-grid {
    grid-template-columns: repeat(3, 106px);
  }
}

@media (max-width: 600px) {
  .split-grid-toolbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .split-grid-meta {
    width: 100%;
    order: 3;
  }

  .split-pages-grid {
    grid-template-columns: repeat(2, 98px);
    gap: 0.65rem;
  }
}

.split-page-thumb {
  aspect-ratio: 1 / 1.41;
  background: #f3f4f6;
  border: 4px solid transparent;
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.split-page-thumb.is-ready {
  background: #fff;
}

.split-page-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  filter: grayscale(80%);
  transition: all 0.3s;
}

.split-page-thumb.selected {
  border-color: var(--brand);
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(13, 111, 109, 0.3);
}

.split-page-thumb.selected canvas {
  opacity: 1;
  filter: grayscale(0%);
}

.page-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  transition: opacity 0.3s;
}

.split-page-thumb.selected .page-overlay {
  opacity: 0;
}

.split-page-thumb .page-num {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.split-page-thumb.selected .page-num {
  background: var(--brand);
}

/* --- Herramienta de Metadatos v3 (Ciberseguridad) --- */
.metadata-tool-layout-v3 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.metadata-header-area {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.metadata-identity-simple {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.metadata-file-icon {
  width: 48px;
  height: 48px;
  background: var(--bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}

.metadata-filename-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--text);
  word-break: break-all;
}

.status-badge {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  width: fit-content;
}

.status-badge.processing {
  background: #e2e8f0;
  color: #475569;
}

.status-badge.warning {
  background: #fee2e2;
  color: #b91c1c;
}

.status-badge.info {
  background: #e0f2fe;
  color: #0369a1;
}

.status-badge.success {
  background: #dcfce7;
  color: #15803d;
}

.metadata-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
}

.metadata-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

.metadata-card h3 {
  margin-top: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-strong);
  border-bottom: 2px solid var(--bg);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.metadata-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #f2f2f2;
  font-size: 0.92rem;
  transition: background 0.2s;
}

.meta-row:hover {
  background: #fafafa;
}

.meta-row span {
  color: var(--muted);
  font-weight: 500;
}

.meta-row strong {
  color: var(--text);
}

.info-alert.security-mode {
  background: #f0fdf4;
  border: 1px solid #dcfce7;
  color: #166534;
  padding: 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  line-height: 1.5;
}

.meta-cleaned-success {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.meta-cleaned-success h4 {
  margin: 1rem 0;
  font-size: 1.3rem;
  color: var(--brand-strong);
}

@media (max-width: 900px) {
  .metadata-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
