# ===========================================================
# Origina Santa Fe — configuración de servidor (Apache/Hostinger)
# ===========================================================

# --- Compresión ---
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json image/svg+xml
</IfModule>

# --- Caché por tipo de archivo ---
<IfModule mod_expires.c>
  ExpiresActive On

  # HTML: nunca se cachea, así los deploys se ven al instante
  ExpiresByType text/html "access plus 0 seconds"

  # CSS y JS: se versionan con ?v=YYYYMMDD, se pueden cachear poco
  ExpiresByType text/css                "access plus 1 hour"
  ExpiresByType application/javascript  "access plus 1 hour"

  # Estáticos inmutables
  ExpiresByType image/webp   "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType font/woff2   "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\.(html)$">
    Header set Cache-Control "no-cache, must-revalidate"
  </FilesMatch>
  <FilesMatch "\.(webp|svg|woff2)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# --- MIME types ---
<IfModule mod_mime.c>
  AddType image/webp .webp
  AddType font/woff2 .woff2
</IfModule>

# --- URLs limpias (opcional): /gracias en vez de /gracias.html ---
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}\.html -f
  RewriteRule ^(.*)$ $1.html [L]
</IfModule>

ErrorDocument 404 /entrega-inmediata.html
