/* Óptima Computación — estilos adicionales
   Cárgalo DESPUÉS de style.css. No modifica tus estilos existentes,
   sólo añade lo nuevo y sobrescribe el fondo del header. */

/* ------------------------------------------------------------------
   1. Fondo del header en WebP (con respaldo a JPG en navegadores viejos)
   ------------------------------------------------------------------ */
header {
  background-image: url("../img/header-bg.jpg");
  background-size: cover;
}
@supports (background-image: image-set(url("x.webp") type("image/webp"))) {
  header {
    background-image: image-set(url("../img/header-bg.webp") type("image/webp"));
  }
}
@media (max-width: 768px) {
  header { background-image: url("../img/header-bg-960.jpg"); }
  @supports (background-image: image-set(url("x.webp") type("image/webp"))) {
    header {
      background-image: image-set(url("../img/header-bg-960.webp") type("image/webp"));
    }
  }
}

/* ------------------------------------------------------------------
   2. Filtro del portafolio (reemplazo de Isotope)
   ------------------------------------------------------------------ */
.portfolio-items {
  position: relative;
}
.portfolio-items > [class*="col-"] {
  opacity: 1;
  transform: scale(1);
  transition: opacity .28s ease, transform .28s ease;
}
.portfolio-items > .is-hidden {
  opacity: 0;
  transform: scale(.85);
  position: absolute;
  pointer-events: none;
  z-index: -1;
}
@media (prefers-reduced-motion: reduce) {
  .portfolio-items > [class*="col-"] { transition: none; }
}

/* ------------------------------------------------------------------
   3. Bloque de contacto (reemplazo del formulario)
   ------------------------------------------------------------------ */
.contact-actions {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.contact-actions li { margin-bottom: 12px; }

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  padding: 13px 22px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  transition: opacity .2s ease, transform .2s ease;
}
.btn-contact i { font-size: 19px; }
.btn-contact:hover,
.btn-contact:focus {
  text-decoration: none;
  opacity: .88;
  transform: translateY(-1px);
}
.btn-contact:focus-visible {
  outline: 3px solid #ff4500;
  outline-offset: 2px;
}
.btn-wa    { background: #25d366; color: #fff; }
.btn-wa:hover, .btn-wa:focus       { color: #fff; }
.btn-tel   { background: #ff4500; color: #fff; }
.btn-tel:hover, .btn-tel:focus     { color: #fff; }
.btn-mail  { background: transparent; color: #333; border-color: #333; }
.btn-mail:hover, .btn-mail:focus   { background: #333; color: #fff; }

.contact-hours {
  font-size: 14px;
  color: #777;
  margin-top: 18px;
}

.map-embed {
  position: relative;
  padding-bottom: 56%;
  height: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #eee;
}
.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ------------------------------------------------------------------
   4. Lightbox (reemplazo de prettyPhoto)
   ------------------------------------------------------------------ */
body.oc-lb-open { overflow: hidden; }

.oc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: rgba(0, 0, 0, .88);
  animation: oc-fade .18s ease;
}
.oc-lightbox[hidden] { display: none; }

@keyframes oc-fade { from { opacity: 0; } to { opacity: 1; } }

.oc-lb-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  text-align: center;
}
.oc-lb-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 3px;
  background: #222;
}
.oc-lb-caption {
  margin-top: 14px;
  color: #fff;
  font-size: 15px;
}

.oc-lb-close,
.oc-lb-prev,
.oc-lb-next {
  position: absolute;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 0;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
  transition: background .2s ease;
}
.oc-lb-close:hover,
.oc-lb-prev:hover,
.oc-lb-next:hover { background: rgba(255, 255, 255, .3); }

.oc-lb-close:focus-visible,
.oc-lb-prev:focus-visible,
.oc-lb-next:focus-visible {
  outline: 3px solid #ff4500;
  outline-offset: 2px;
}

.oc-lb-close {
  top: 16px; right: 20px;
  width: 44px; height: 44px;
  font-size: 30px;
}
.oc-lb-prev,
.oc-lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 50px; height: 50px;
  font-size: 34px;
}
.oc-lb-prev { left: 14px; }
.oc-lb-next { right: 14px; }
.oc-lb-prev[hidden], .oc-lb-next[hidden] { display: none; }

.oc-lb-counter {
  position: absolute;
  bottom: 18px;
  left: 0; right: 0;
  text-align: center;
  color: rgba(255, 255, 255, .65);
  font-size: 13px;
}

@media (max-width: 600px) {
  .oc-lightbox { padding: 55px 8px; }
  .oc-lb-prev, .oc-lb-next { width: 40px; height: 40px; font-size: 26px; }
  .btn-contact { min-width: 100%; justify-content: center; }
}

/* ------------------------------------------------------------------
   5. Accesibilidad y detalles
   ------------------------------------------------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 3000;
  padding: 12px 20px;
  background: #ff4500;
  color: #fff;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

img { max-width: 100%; }

/* ------------------------------------------------------------------
   6. Modernización visual (2026) — mantiene la paleta original
   (naranja #ff4500, gris oscuro #222/#2b2b2b, blancos y grises).
   Solo añade acabados: tarjetas, profundidad, botones y ritmo.
   ------------------------------------------------------------------ */

:root {
  --oc-orange: #ff4500;
  --oc-orange-dark: #d93c00;
  --oc-dark: #202020;
  --oc-gray-bg: #f6f6f6;
  --oc-radius: 14px;
  --oc-shadow: 0 10px 30px rgba(20, 20, 20, .08);
  --oc-shadow-hover: 0 16px 34px rgba(20, 20, 20, .14);
}

/* Navbar: más aire alrededor del logo */
.navbar-header .page-scroll {
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
}
.navbar-header .page-scroll img {
  height: 40px;
  width: auto;
}

/* Navbar: cristal esmerilado al hacer scroll */
#menu.navbar-default {
  backdrop-filter: none;
}
#menu.navbar-default.on {
  background-color: rgba(24, 24, 24, .92) !important;
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  box-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}

/* Header: overlay más rico para contraste de texto sobre la foto */
header {
  background-color: #14100e;
  position: relative;
}
header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 7, .78) 0%, rgba(10, 8, 7, .55) 45%, rgba(10, 8, 7, .85) 100%);
  pointer-events: none;
}
header .intro-text { position: relative; z-index: 1; }
header .intro-text h1 {
  letter-spacing: -.5px;
}
header .intro-text p {
  font-size: 20px;
}
@media (max-width: 480px) {
  .intro-text H1 { font-size: 42px; }
  header .intro-text p { font-size: 17px; }
}
@media (max-width: 360px) {
  .intro-text H1 { font-size: 34px; }
}

/* En móvil/tablet, el padding original (250px arriba, 200px abajo) deja
   una franja enorme sin la foto de fondo visible antes del texto. Se
   compacta y se fija una altura mínima para que la imagen se note. */
@media (max-width: 768px) {
  header { min-height: 70vh; }
  .intro-text {
    padding-top: 120px;
    padding-bottom: 80px;
  }
}
@media (max-width: 480px) {
  header { min-height: 60vh; }
  .intro-text {
    padding-top: 100px;
    padding-bottom: 60px;
  }
}

/* Botones: acento sólido con elevación sutil */
.btn-default,
#contact-section .btn {
  border-radius: 999px;
  padding: 12px 30px;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 6px 18px rgba(255, 69, 0, .18);
}
.btn-default:hover, .btn-default:focus,
#contact-section .btn:hover, #contact-section .btn:focus {
  box-shadow: 0 10px 24px rgba(255, 69, 0, .3);
  transform: translateY(-2px);
}
header .btn-default {
  background-color: var(--oc-orange);
  border-color: var(--oc-orange);
  color: #fff;
}
header .btn-default:hover, header .btn-default:focus {
  background-color: var(--oc-orange-dark);
  border-color: var(--oc-orange-dark);
  color: #fff;
}

/* Ritmo vertical: las secciones originales dejaban demasiado aire (100px
   arriba/abajo + 40-50px extra de títulos y "space"). Se compacta todo. */
#about-section,
#services-section,
#works-section,
#contact-section,
#facebook-section {
  padding: 64px 0;
}
.section-title { padding-bottom: 28px; }
.space { margin-top: 26px; }

/* Títulos de sección: más aire y jerarquía */
.section-title h2 {
  font-weight: 800;
  color: #232323;
  letter-spacing: -.5px;
  line-height: 1.2;
}
.section-title hr {
  border-radius: 2px;
}

/* Servicios: cuadrícula real (CSS Grid) para que las 3 tarjetas de cada
   fila queden con el mismo alto y un espacio real entre ellas, sin
   pelear con los % de Bootstrap. */
#services-section .row {
  display: grid;
  margin-left: 0;
  margin-right: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
/* El clearfix de Bootstrap (.row:before/:after { display:table }) se
   convierte en celdas fantasma dentro de un grid y descuadra el orden.
   No hace falta clearfix aquí: los hijos ya no flotan. */
#services-section .row::before,
#services-section .row::after,
#about-section .row::before,
#about-section .row::after {
  content: none;
}
#services-section .row > [class*="col-"] {
  width: auto;
  float: none;
}
#services-section .service {
  background: #fff;
  border-radius: var(--oc-radius);
  padding: 42px 34px;
  box-shadow: var(--oc-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
#services-section .service:hover {
  transform: translateY(-6px);
  box-shadow: var(--oc-shadow-hover);
}
#services-section i.fa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 69, 0, .1);
  margin-right: 0;
  margin-bottom: 18px;
  font-size: 26px;
}
@media (max-width: 991px) {
  #services-section .row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  #services-section .row { grid-template-columns: 1fr; gap: 20px; }
}

/* Acerca: mismo patrón de cuadrícula que Servicios */
#about-section .row {
  display: grid;
  margin-left: 0;
  margin-right: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
#about-section .row > [class*="col-"] {
  width: auto;
  float: none;
}
#about-section .col-md-4 {
  background: #fff;
  border-radius: var(--oc-radius);
  padding: 40px 32px;
  box-shadow: var(--oc-shadow);
}
#about-section i.fa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 69, 0, .1);
  margin-bottom: 16px;
  font-size: 22px;
  color: var(--oc-orange);
}
@media (max-width: 767px) {
  #about-section .row { grid-template-columns: 1fr; gap: 20px; }
}

/* Portafolio: esquinas redondeadas y elevación al pasar el mouse */
.portfolio-item {
  border-radius: var(--oc-radius);
  overflow: hidden;
  box-shadow: var(--oc-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--oc-shadow-hover);
}
.portfolio-item .hover-bg img {
  transition: transform .5s ease;
}
.portfolio-item:hover .hover-bg img {
  transform: scale(1.06);
}
ol.type li a {
  padding: 8px 4px;
  transition: color .2s ease;
}

/* Contacto: mismo patrón de grid que Servicios/Acerca, para que las dos
   tarjetas ("Información de contacto" y "Escríbenos directamente")
   queden alineadas en la misma línea con un espacio real entre ellas. */
#contact-section .row {
  display: grid;
  margin-left: 0;
  margin-right: 0;
  grid-template-columns: 5fr 7fr;
  gap: 26px;
}
#contact-section .row::before,
#contact-section .row::after {
  content: none;
}
#contact-section .row > [class*="col-"] {
  width: auto;
  float: none;
}
#contact-section .col-md-5,
#contact-section .col-md-7 {
  background: #fff;
  border-radius: var(--oc-radius);
  padding: 40px 34px;
  box-shadow: var(--oc-shadow);
}
@media (max-width: 767px) {
  #contact-section .row { grid-template-columns: 1fr; gap: 20px; }
}
.map-embed {
  border-radius: var(--oc-radius);
  box-shadow: var(--oc-shadow);
}
.map-embed iframe {
  border-radius: var(--oc-radius);
}
.map-embed .fb-embed-placeholder {
  position: absolute;
  inset: 0;
  border-radius: var(--oc-radius);
}

/* ------------------------------------------------------------------
   7. Sección de Facebook
   ------------------------------------------------------------------ */
#facebook-section {
  background-color: #fff;
}
.fb-card {
  background: var(--oc-gray-bg);
  border-radius: var(--oc-radius);
  padding: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
}
.fb-card-copy { flex: 1 1 320px; }
.fb-card-copy h3 {
  font-size: 24px;
  color: #232323;
  margin-bottom: 10px;
}
.fb-card-copy p { margin-bottom: 22px; }
.btn-fb {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #1877f2;
  color: #fff;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(24, 119, 242, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-fb:hover, .btn-fb:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(24, 119, 242, .35);
}
.fb-embed-wrap {
  flex: 1 1 340px;
  min-height: 280px;
  border-radius: var(--oc-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--oc-shadow);
}
.fb-embed-placeholder {
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  border: 0;
  width: 100%;
  background: #fff;
  color: #555;
  font: inherit;
}
.fb-embed-placeholder i {
  font-size: 34px;
  color: #1877f2;
}
.fb-embed-placeholder strong {
  color: #232323;
  font-size: 16px;
}
.fb-embed-placeholder span {
  font-size: 13px;
  color: #888;
}
@media (max-width: 600px) {
  .fb-card { padding: 26px 14px; }
  .fb-embed-wrap {
    flex-basis: 100%;
    /* El widget de Facebook recorta su encabezado por debajo de ~340px
       de ancho; se saca del padding de la tarjeta para ganar ese espacio. */
    margin-left: -14px;
    margin-right: -14px;
  }
}

/* Tablet: el menú de una sola línea queda muy justo entre 768–991px */
@media (min-width: 768px) and (max-width: 991px) {
  #menu { padding-left: 4px; padding-right: 4px; }
  #menu.navbar-default .navbar-nav > li > a {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 11px;
    letter-spacing: 0;
  }
}

/* ------------------------------------------------------------------
   8. Aviso de cookies
   ------------------------------------------------------------------ */
#cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 4000;
  max-width: 760px;
  margin: 0 auto;
  background: #1b1b1b;
  color: #e6e6e6;
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .35);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
#cookie-banner[hidden] { display: none; }
#cookie-banner p {
  margin: 0;
  color: #cfcfcf;
  font-size: 14px;
  line-height: 1.5;
  flex: 1 1 320px;
}
#cookie-banner a { color: #ff8a5c; text-decoration: underline; }
.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cookie-actions button {
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.cookie-actions button:hover { transform: translateY(-1px); }
#cookie-accept {
  background: var(--oc-orange);
  color: #fff;
}
#cookie-reject {
  background: transparent;
  border-color: #555;
  color: #e6e6e6;
}
#cookie-settings-link {
  background: transparent;
  border: 0;
  color: #aaa;
  text-decoration: underline;
  padding: 8px 4px;
  font-weight: 400;
}
@media (max-width: 500px) {
  #cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 18px; }
  .cookie-actions { width: 100%; }
  .cookie-actions button { flex: 1; }
}

/* Enlaces legales en el footer */
.legal-links {
  margin-top: 8px;
  font-size: 12px;
}
.legal-links a { color: #999; }
.legal-links span { color: #555; padding: 0 6px; }
.legal-links-btn {
  background: transparent;
  border: 0;
  padding: 0;
  color: #999;
  text-decoration: underline;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
}
.legal-links-btn:hover, .legal-links-btn:focus { color: #ff4500; }

/* ------------------------------------------------------------------
   9. Accesibilidad — objetivos táctiles de 44×44px (guía de Apple),
   foco visible consistente y mejor contraste de texto.
   ------------------------------------------------------------------ */

/* Mejor contraste: #888 sobre blanco no llega a 4.5:1 (AA) para texto
   normal. #666 sí (~5.7:1) y mantiene el mismo tono. */
p, li, .fb-embed-placeholder span {
  color: #666;
}

/* Foco visible consistente en todos los controles interactivos */
a:focus-visible,
button:focus-visible,
.navbar-toggle:focus-visible,
.fb-embed-placeholder:focus-visible,
.legal-links-btn:focus-visible {
  outline: 3px solid #ff4500;
  outline-offset: 2px;
}

/* Objetivos táctiles ≥44×44px */
ol.type li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 8px;
}
/* El toggle solo existe <768px (regla de Bootstrap); si le ponemos
   `display` aquí sin media query, gana la cascada y se queda visible
   también en escritorio. Lo igualamos a su propio breakpoint. */
@media (max-width: 767px) {
  .navbar-toggle {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Botón de menú móvil: icono de Font Awesome en vez de las 3 barritas
   por defecto de Bootstrap (se veían como un recuadro vacío). */
.navbar-default .navbar-toggle {
  border-color: transparent;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
  border-color: transparent;
  background-color: rgba(255, 255, 255, .08);
}
.navbar-toggle .fa {
  color: #fff;
  font-size: 22px;
  line-height: 1;
}
.navbar-toggle-icon-close { display: none; }
.navbar-toggle.collapsed .navbar-toggle-icon-open { display: inline-block; }
.navbar-toggle.collapsed .navbar-toggle-icon-close { display: none; }
.navbar-toggle:not(.collapsed) .navbar-toggle-icon-open { display: none; }
.navbar-toggle:not(.collapsed) .navbar-toggle-icon-close { display: inline-block; }
#social-section .social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
#social-section .social i.fa {
  padding: 0;
}
.cookie-actions button {
  min-height: 44px;
}
.legal-links-btn {
  padding: 10px 4px;
}

/* ------------------------------------------------------------------
   10. Jerarquía de encabezados corregida (auditoría) — las tarjetas de
   Acerca/Servicios/Portafolio/Contacto usaban <h4> sueltos justo debajo
   de un <h2> (salto de nivel, rompe la navegación por encabezados de
   lectores de pantalla). Se subieron a <h3> en el HTML; aquí se
   recupera exactamente el mismo aspecto que tenían como h4 — no se
   toca css/style.css para no pisar sus reglas originales.
   ------------------------------------------------------------------ */
#about-section h3,
#services-section h3 {
  color: #666;
  font-size: 20px;
  font-weight: 500;
  border-bottom: 1px solid #ff4500;
  padding-bottom: 20px;
  display: inline-block;
}
#contact-section h3 {
  color: #666;
  font-size: 20px;
  font-weight: 500;
}
.hover-bg .hover-text > h3 {
  opacity: 0;
  transform: translateY(100%);
  transition: all .3s;
  color: #f6f6f6;
  font-size: 20px;
  font-weight: 500;
}
.hover-bg:hover .hover-text > h3 {
  opacity: 1;
  -webkit-backface-visibility: hidden;
  transform: translateY(0);
}

/* ------------------------------------------------------------------
   11. Menú móvil desplegado: Bootstrap deja solo 7.5px entre la línea
   del borde superior y el primer enlace — un poco corto. Lo subimos
   al mínimo cómodo sin tocar el resto del sistema de gutters.
   ------------------------------------------------------------------ */
@media (max-width: 767px) {
  #main-nav .navbar-nav {
    margin-top: 14px;
  }
}
