# Panel de administración de Golden Body (Decap CMS).
# Login: DecapBridge (PKCE). El token de GitHub vive en DecapBridge, nunca en este repo.
# En local: `npx -y pnpm@12.16.1 admin` (decap-server) + `npx -y pnpm@12.16.1 dev` → http://localhost:4321/admin/index.html
locale: es
local_backend: true
backend:
  name: git-gateway
  repo: Frankmoises7/clinica-estetica
  branch: main
  auth_type: pkce
  base_url: https://auth.decapbridge.com
  auth_endpoint: /sites/6b54261d-d7d6-4079-9a50-21ba7988d2eb/pkce
  auth_token_endpoint: /sites/6b54261d-d7d6-4079-9a50-21ba7988d2eb/token
  gateway_url: https://gateway.decapbridge.com
  # Cada cambio queda en el historial con quién lo hizo.
  commit_messages:
    create: Create {{collection}} “{{slug}}” - {{author-name}} <{{author-login}}> via DecapBridge
    update: Update {{collection}} “{{slug}}” - {{author-name}} <{{author-login}}> via DecapBridge
    delete: Delete {{collection}} “{{slug}}” - {{author-name}} <{{author-login}}> via DecapBridge
    uploadMedia: Upload “{{path}}” - {{author-name}} <{{author-login}}> via DecapBridge
    deleteMedia: Delete “{{path}}” - {{author-name}} <{{author-login}}> via DecapBridge
    openAuthoring: Message {{message}} - {{author-name}} <{{author-login}}> via DecapBridge

auth:
  email_claim: email
  first_name_claim: first_name
  last_name_claim: last_name
  avatar_url_claim: avatar_url

site_url: https://www.goldenbody.cl
display_url: https://www.goldenbody.cl
logo:
  src: /marca/emblema.png

media_folder: src/assets/subidas
public_folder: /src/assets/subidas

slug:
  encoding: ascii
  clean_accents: true
  sanitize_replacement: '-'

collections:
  # ─────────────────────────── AJUSTES ───────────────────────────
  - name: ajustes
    label: Ajustes
    editor: { preview: false }
    files:
      - name: sitio
        label: Datos de la clínica
        file: src/content/ajustes/sitio.json
        fields:
          - { label: Nombre, name: nombre, widget: string }
          - { label: Bajada, name: bajada, widget: string, hint: 'Ej.: Clínica Estética' }
          - { label: Ciudad, name: ciudad, widget: string }
          - { label: Descripción para Google, name: descripcion, widget: text, hint: 'Aparece en Google y al compartir el enlace. Ideal: 140 a 160 caracteres.' }
          - { label: Título de la pestaña (portada), name: tituloInicio, widget: string }
          - { label: Dirección, name: direccion, widget: string }
          - { label: Dirección corta, name: direccionCorta, widget: string }
          - { label: Comuna y país, name: comuna, widget: string }
          - { label: Dirección para el mapa, name: mapsQuery, widget: string, hint: 'Lo que escribirías en Google Maps para encontrar la clínica.' }
          - { label: Enlace o número de WhatsApp, name: whatsapp, widget: string, hint: 'Enlace (wa.link/… o wa.me/…) o número de celular, ej.: +56 9 1234 5678.' }
          - { label: Instagram, name: instagram, widget: string, hint: 'Tu usuario (@golden.body.estetica) o el enlace de tu perfil.' }
          - { label: Usuario de Instagram, name: instagramUser, widget: string, hint: 'Ej.: @golden.body.estetica' }
          - { label: Enlace de la agenda de Reservo, name: reservoUrl, widget: string, required: false, hint: 'Enlace público de tu agenda online en Reservo. Si lo dejas vacío, los botones «Agendar» llevan a WhatsApp.' }
          - { label: Texto del botón principal de agenda, name: botonAgendar, widget: string, hint: 'Ej.: Agenda tu hora' }
          - label: Barra de anuncios (arriba de todo)
            name: anuncios
            widget: list
            field: { label: Anuncio, name: anuncio, widget: string }
          - label: Menú principal
            name: menu
            widget: list
            summary: '{{fields.texto}} → {{fields.enlace}}'
            hint: '«Tratamientos» (con su menú desplegable) siempre aparece primero.'
            fields:
              - { label: Texto, name: texto, widget: string }
              - { label: Enlace, name: enlace, widget: string, hint: 'Ej.: /tratamientos/hifu, /tratamientos#medicina, /#ubicacion, /agendar' }
              - { label: Destacado, name: destacado, widget: boolean, default: false, hint: 'Se muestra en color dorado.' }
          - label: Recuadro del menú de tratamientos
            name: megaPromo
            widget: object
            fields:
              - { label: Etiqueta, name: etiqueta, widget: string, required: false }
              - { label: Texto, name: texto, widget: text, required: false }
              - { label: Botón, name: boton, widget: string, required: false }
          - { label: Texto del buscador, name: placeholderBuscador, widget: string }
          - label: Pie de página
            name: pie
            widget: object
            fields:
              - { label: Frase grande, name: frase, widget: string, required: false, hint: 'Usa *asteriscos* para la cursiva dorada.' }
              - { label: Texto bajo el logo, name: texto, widget: text, required: false }
              - { label: Aviso legal, name: legal, widget: text, required: false }
              - { label: Columnas de categorías, name: columnas, widget: number, value_type: int, min: 0, max: 3, default: 3 }
          - label: Ventana de agenda
            name: agenda
            widget: object
            fields:
              - { label: Título, name: titulo, widget: string, hint: 'Usa *asteriscos* para la cursiva dorada.' }
              - { label: Texto cuando no hay Reservo, name: textoSinReservo, widget: text }
              - { label: Botón de WhatsApp, name: botonWhatsapp, widget: string }

      - name: marca
        label: Marca (logo, colores y tipografía)
        file: src/content/ajustes/marca.json
        fields:
          - label: Logo
            name: logo
            widget: object
            hint: 'Sube PNG con fondo transparente (o SVG). Un JPG con fondo blanco se verá como un recuadro.'
            fields:
              - { label: Emblema (ícono), name: emblema, widget: image, choose_url: false, hint: 'JPG, PNG o WebP. Idealmente menos de 5 MB.' }
              - { label: Firma (nombre), name: firma, widget: image, choose_url: false, hint: 'JPG, PNG o WebP. Idealmente menos de 5 MB.' }
              - { label: Emblema para fondo oscuro, name: emblemaOscuro, widget: image, choose_url: false, required: false, hint: 'Opcional. Si no lo subes, se genera solo en blanco. JPG, PNG o WebP. Idealmente menos de 5 MB.' }
              - { label: Firma para fondo oscuro, name: firmaOscuro, widget: image, choose_url: false, required: false, hint: 'Opcional. Si no la subes, se genera sola en blanco. JPG, PNG o WebP. Idealmente menos de 5 MB.' }
          - { label: Imagen al compartir en WhatsApp y redes, name: imagenCompartir, widget: image, choose_url: false, required: false, hint: 'Horizontal, idealmente 1200 × 630 px. JPG, PNG o WebP. Idealmente menos de 5 MB.' }
          - label: Colores
            name: colores
            widget: object
            fields:
              - { label: Color principal, name: principal, widget: color, allowInput: true, hint: 'Botones, arco y etiquetas. Original: #c99d76' }
              - { label: Acento, name: acento, widget: color, allowInput: true, hint: 'Detalles dorados. Original: #d8b98f' }
              - { label: Fondo, name: fondo, widget: color, allowInput: true, hint: 'Fondo de las secciones. Original: #f7f1ea' }
              - { label: Texto, name: texto, widget: color, allowInput: true, hint: 'Textos y secciones oscuras. Original: #2b221d' }
              - { label: Tarjetas, name: tarjetas, widget: color, allowInput: true, hint: 'Fondo de tarjetas y textos sobre botones; usa un color muy claro. Original: #ffffff' }
          - label: Tipografía
            name: tipografia
            widget: select
            default: clasica
            options:
              - { label: 'Clásica elegante (Fraunces + Jost) — original', value: clasica }
              - { label: 'Editorial (Playfair Display + DM Sans)', value: editorial }
              - { label: 'Romántica (Cormorant Garamond + Mulish)', value: romantica }
              - { label: 'Moderna (DM Serif Display + Outfit)', value: moderna }

      - name: paginas
        label: Textos de páginas
        file: src/content/ajustes/paginas.json
        fields:
          - label: Página «Tratamientos»
            name: tratamientos
            widget: object
            fields:
              - { label: Título, name: titulo, widget: string, hint: 'Usa *asteriscos* para la cursiva dorada.' }
              - { label: Introducción, name: intro, widget: text, hint: '{n} se reemplaza por la cantidad de tratamientos.' }
              - { label: Descripción para Google, name: descripcion, widget: text, required: false }
              - { label: Sin resultados — texto, name: sinResultados, widget: string }
              - { label: Sin resultados — botón, name: sinResultadosBoton, widget: string }
              - { label: Sin resultados — cierre, name: sinResultadosFin, widget: string }
          - label: Página «Agendar»
            name: agendar
            widget: object
            fields:
              - { label: Antetítulo, name: eyebrow, widget: string, required: false }
              - { label: Título, name: titulo, widget: string }
              - { label: Introducción, name: intro, widget: text, required: false }
              - { label: Descripción para Google, name: descripcion, widget: text, required: false }
              - { label: Título sin Reservo, name: tituloSinReservo, widget: string }
              - { label: Texto sin Reservo, name: textoSinReservo, widget: text }
          - label: Página no encontrada (404)
            name: noEncontrada
            widget: object
            fields:
              - { label: Antetítulo, name: eyebrow, widget: string, required: false }
              - { label: Título, name: titulo, widget: string }
              - { label: Texto, name: texto, widget: text, required: false }
              - { label: Botón principal, name: botonPrincipal, widget: string, required: false }
              - { label: Botón secundario, name: botonSecundario, widget: string, required: false }
          - label: Ficha de tratamiento
            name: ficha
            widget: object
            fields:
              - label: Sellos bajo la foto
                name: sellos
                widget: list
                field: { label: Sello, name: sello, widget: string }
              - { label: Nota de precio, name: nota, widget: text, required: false }
              - { label: Pregunta de evaluación, name: evaluacionPregunta, widget: string, required: false }
              - { label: Respuesta de evaluación, name: evaluacionRespuesta, widget: text, required: false }
              - { label: Título de relacionados, name: relacionadosTitulo, widget: string }

  # ─────────────────────────── PORTADA ───────────────────────────
  - name: portada
    label: Portada
    editor: { preview: false }
    files:
      - name: inicio
        label: Portada (inicio)
        file: src/content/inicio.json
        fields:
          - label: Bloques
            name: bloques
            widget: list
            typeKey: tipo
            hint: 'Arrastra los bloques para cambiar su orden. Apaga «Mostrar» para ocultar uno sin borrarlo. En los títulos, *asteriscos* = cursiva dorada.'
            types:
              - label: Portada principal (hero)
                name: hero
                widget: object
                summary: 'Hero · {{fields.titulo}}'
                fields:
                  - { label: Mostrar, name: mostrar, widget: boolean, default: true }
                  - { label: Antetítulo, name: eyebrow, widget: string, required: false }
                  - { label: Título, name: titulo, widget: text, hint: 'Un salto de línea aquí = salto de línea en la web.' }
                  - { label: Texto, name: texto, widget: text, required: false }
                  - { label: Botón principal (abre la agenda), name: botonPrincipal, widget: string }
                  - { label: Botón secundario (va a tratamientos), name: botonSecundario, widget: string, required: false }
                  - label: Cifras
                    name: cifras
                    widget: list
                    summary: '{{fields.valor}} {{fields.texto}}'
                    hint: 'Escribe {n} para mostrar la cantidad de tratamientos.'
                    fields:
                      - { label: Valor, name: valor, widget: string }
                      - { label: Texto, name: texto, widget: string }
                  - label: Etiquetas flotantes (máximo 3)
                    name: chips
                    widget: list
                    max: 3
                    summary: '{{fields.texto}}'
                    fields:
                      - { label: Texto, name: texto, widget: string }
                      - &icono { label: Ícono, name: icono, widget: select, options: [{ label: Jeringa, value: jeringa }, { label: Gota, value: gota }, { label: Brillo, value: brillo }, { label: Ondas (HIFU), value: ondas }, { label: Láser, value: laser }, { label: Pestaña, value: pestana }, { label: Rostro, value: rostro }, { label: Cuerpo, value: cuerpo }, { label: Cabello, value: cabello }, { label: Hoja, value: hoja }, { label: Perfil, value: perfil }, { label: Oreja, value: oreja }, { label: Calendario, value: calendario }, { label: Escudo, value: escudo }, { label: Reloj, value: reloj }, { label: Check, value: check }] }
                  - { label: Texto del sello circular, name: sello, widget: string, required: false, hint: 'Máximo ~45 caracteres. Ej.: AGENDA ONLINE · GOLDEN BODY · ANTOFAGASTA ·' }
              - label: Franja animada
                name: cinta
                widget: object
                summary: 'Franja animada'
                fields:
                  - { label: Mostrar, name: mostrar, widget: boolean, default: true }
                  - label: Textos
                    name: items
                    widget: list
                    field: { label: Texto, name: texto, widget: string }
              - label: Categorías
                name: categorias
                widget: object
                summary: 'Categorías · {{fields.titulo}}'
                fields:
                  - { label: Mostrar, name: mostrar, widget: boolean, default: true }
                  - { label: Antetítulo, name: eyebrow, widget: string, required: false }
                  - { label: Título, name: titulo, widget: string }
                  - { label: Texto del enlace, name: enlace, widget: string, required: false }
              - label: Más solicitados
                name: destacados
                widget: object
                summary: 'Más solicitados · {{fields.titulo}}'
                fields:
                  - { label: Mostrar, name: mostrar, widget: boolean, default: true }
                  - { label: Antetítulo, name: eyebrow, widget: string, required: false }
                  - { label: Título, name: titulo, widget: string }
                  - { label: Texto, name: texto, widget: text, required: false }
                  - { label: Cantidad de tratamientos, name: cantidad, widget: number, value_type: int, min: 1, max: 24, default: 8, hint: 'Primero los marcados como «Destacado».' }
                  - { label: Botón, name: boton, widget: string, required: false, hint: '{n} = cantidad de tratamientos.' }
              - label: Filosofía (fondo oscuro)
                name: filosofia
                widget: object
                summary: 'Filosofía'
                fields:
                  - { label: Mostrar, name: mostrar, widget: boolean, default: true }
                  - { label: Antetítulo, name: eyebrow, widget: string, required: false }
                  - { label: Cita, name: cita, widget: text }
                  - { label: Destaque (en negrita), name: destaque, widget: string, required: false }
                  - { label: Remate, name: remate, widget: text, required: false }
                  - label: Pilares
                    name: pilares
                    widget: list
                    summary: '{{fields.titulo}}'
                    fields:
                      - *icono
                      - { label: Título, name: titulo, widget: string }
                      - { label: Texto, name: texto, widget: text }
              - label: Pasos para agendar
                name: pasos
                widget: object
                summary: 'Pasos · {{fields.titulo}}'
                fields:
                  - { label: Mostrar, name: mostrar, widget: boolean, default: true }
                  - { label: Antetítulo, name: eyebrow, widget: string, required: false }
                  - { label: Título, name: titulo, widget: string }
                  - label: Pasos
                    name: pasos
                    widget: list
                    summary: '{{fields.titulo}}'
                    fields:
                      - { label: Título, name: titulo, widget: string }
                      - { label: Texto, name: texto, widget: text }
                  - { label: Botón, name: boton, widget: string, required: false }
              - label: Tratamiento destacado
                name: foco
                widget: object
                summary: 'Destacado · {{fields.eyebrow}}'
                fields:
                  - { label: Mostrar, name: mostrar, widget: boolean, default: true }
                  - { label: Antetítulo, name: eyebrow, widget: string, required: false }
                  - { label: Título, name: titulo, widget: string }
                  - { label: Foto, name: foto, widget: image, choose_url: false, hint: 'JPG, PNG o WebP. Idealmente menos de 5 MB.' }
                  - { label: Encuadre de la foto, name: fotoEncuadre, widget: select, required: false, default: centro, options: [{ label: 'Centro', value: centro }, { label: 'Arriba', value: arriba }, { label: 'Abajo', value: abajo }, { label: 'Izquierda', value: izquierda }, { label: 'Derecha', value: derecha }], hint: 'La web recorta la foto para que calce en su espacio. Elige qué parte debe quedar siempre a la vista: por ejemplo, «Arriba» si la cara queda cortada. Si lo dejas vacío, se usa «Centro».' }
                  - { label: Descripción de la foto, name: fotoAlt, widget: string, required: false, hint: 'Para personas con lector de pantalla y para Google.' }
                  - { label: Etiqueta sobre la foto, name: etiqueta, widget: string, required: false }
                  - { label: Etiqueta — segunda línea, name: etiquetaSub, widget: string, required: false }
                  - label: Preguntas
                    name: preguntas
                    widget: list
                    summary: '{{fields.pregunta}}'
                    fields:
                      - { label: Pregunta, name: pregunta, widget: string }
                      - { label: Respuesta, name: respuesta, widget: text }
                  - { label: Tratamiento, name: tratamiento, widget: relation, collection: tratamientos, value_field: '{{slug}}', search_fields: [nombre], display_fields: [nombre] }
                  - { label: Botón de agenda, name: botonAgendar, widget: string, required: false }
                  - { label: Texto del enlace a la ficha, name: enlace, widget: string, required: false }
              - label: Ubicación y mapa
                name: ubicacion
                widget: object
                summary: 'Ubicación'
                fields:
                  - { label: Mostrar, name: mostrar, widget: boolean, default: true }
                  - { label: Antetítulo, name: eyebrow, widget: string, required: false }
                  - { label: Título, name: titulo, widget: string, hint: 'La dirección, WhatsApp e Instagram salen de Ajustes → Datos de la clínica.' }

  # ─────────────────────────── CATEGORÍAS ───────────────────────────
  - name: categorias
    label: Categorías
    label_singular: Categoría
    folder: src/content/categorias
    extension: json
    format: json
    create: true
    delete: true
    identifier_field: nombre
    slug: '{{fields.corto}}'
    summary: '{{orden}} · {{nombre}}'
    sortable_fields: [orden, nombre]
    editor: { preview: false }
    description: 'El orden define cómo aparecen en la web. Si borras una categoría, sus tratamientos dejan de mostrarse hasta que les asignes otra.'
    fields:
      - { label: Nombre, name: nombre, widget: string, hint: 'Ej.: Medicina estética' }
      - { label: Nombre corto, name: corto, widget: string, hint: 'Para menús y etiquetas. Ej.: Inyectables. Al crearla, define también su dirección web y luego no cambia.' }
      - { label: Descripción, name: descripcion, widget: text }
      - { label: Foto, name: foto, widget: image, choose_url: false, required: false, hint: 'JPG, PNG o WebP. Idealmente menos de 5 MB.' }
      - { label: Encuadre de la foto, name: fotoEncuadre, widget: select, required: false, default: centro, options: [{ label: 'Centro', value: centro }, { label: 'Arriba', value: arriba }, { label: 'Abajo', value: abajo }, { label: 'Izquierda', value: izquierda }, { label: 'Derecha', value: derecha }], hint: 'La web recorta la foto para que calce en su espacio. Elige qué parte debe quedar siempre a la vista: por ejemplo, «Arriba» si la cara queda cortada. Si lo dejas vacío, se usa «Centro».' }
      - { label: Orden, name: orden, widget: number, value_type: int, default: 100, hint: 'Menor número = aparece antes.' }

  # ─────────────────────────── TRATAMIENTOS ───────────────────────────
  - name: tratamientos
    label: Tratamientos
    label_singular: Tratamiento
    folder: src/content/tratamientos
    extension: json
    format: json
    create: true
    delete: true
    identifier_field: nombre
    slug: '{{fields.nombre}}'
    summary: '{{nombre}} — {{categoria}}'
    sortable_fields: [orden, nombre, categoria]
    view_filters:
      - { label: Destacados, field: destacado, pattern: true }
      - { label: Ocultos, field: visible, pattern: false }
    editor: { preview: false }
    description: 'La dirección web de cada tratamiento se crea con su nombre y no cambia aunque luego lo renombres.'
    fields:
      - { label: Nombre, name: nombre, widget: string }
      - { label: Categoría, name: categoria, widget: relation, collection: categorias, value_field: '{{slug}}', search_fields: [nombre, corto], display_fields: [nombre] }
      - { label: Visible en la web, name: visible, widget: boolean, default: true }
      - { label: Destacado («Más solicitados»), name: destacado, widget: boolean, default: false }
      - { label: Orden, name: orden, widget: number, value_type: int, default: 500, hint: 'Menor número = aparece antes.' }
      - { label: Foto, name: foto, widget: image, choose_url: false, required: false, hint: 'Vertical (4:5), idealmente 1000 × 1250 px. JPG, PNG o WebP. Idealmente menos de 5 MB.' }
      - { label: Encuadre de la foto, name: fotoEncuadre, widget: select, required: false, default: centro, options: [{ label: 'Centro', value: centro }, { label: 'Arriba', value: arriba }, { label: 'Abajo', value: abajo }, { label: 'Izquierda', value: izquierda }, { label: 'Derecha', value: derecha }], hint: 'La web recorta la foto para que calce en su espacio. Elige qué parte debe quedar siempre a la vista: por ejemplo, «Arriba» si la cara queda cortada. Si lo dejas vacío, se usa «Centro».' }
      - { label: Bajada, name: bajada, widget: string, hint: 'Una frase corta bajo el nombre.' }
      - { label: Descripción, name: descripcion, widget: text }
      - label: Beneficios
        name: beneficios
        widget: list
        field: { label: Beneficio, name: beneficio, widget: string }
      - { label: Ideal para, name: idealPara, widget: text }
      - label: Ficha
        name: ficha
        widget: object
        fields:
          - { label: Sesiones, name: sesiones, widget: string, required: false }
          - { label: Duración, name: duracion, widget: string, required: false }
          - { label: Recuperación, name: recuperacion, widget: string, required: false }
          - { label: Resultados, name: resultados, widget: string, required: false }
      - label: Recomendaciones
        name: recomendaciones
        widget: list
        required: false
        field: { label: Recomendación, name: recomendacion, widget: string }
      - label: Preguntas frecuentes
        name: faq
        widget: list
        required: false
        summary: '{{fields.p}}'
        fields:
          - { label: Pregunta, name: p, widget: string }
          - { label: Respuesta, name: r, widget: text }
      - label: Palabras para el buscador
        name: palabras
        widget: list
        required: false
        hint: 'Sinónimos con los que la gente busca este tratamiento (ej.: botox, arrugas).'
        field: { label: Palabra, name: palabra, widget: string }
