:root {
  --cos-ink: #32343a;
  --cos-muted: #666a73;
  --cos-paper: #fff;
  --cos-soft: #f5f6f7;
  --cos-line: #e4e6e9;
  --cos-magenta: #c90051;
  --cos-green: #709600;
  --cos-orange: #d94f0b;
  --cos-radius: 18px;
  --cos-shadow: 0 18px 50px rgba(30, 33, 40, .12);
  --cos-shell: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  color: var(--cos-ink);
  background: var(--cos-paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.admin-bar .cos-site-header { top: 32px; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--cos-magenta); text-underline-offset: .18em; }
a:hover { color: #92003b; }
h1, h2, h3 { margin: 0 0 .55em; line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(2.5rem, 7vw, 5.8rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
iframe { max-width: 100%; border: 0; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--cos-orange); outline-offset: 3px; }

.screen-reader-text,
.cos-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.cos-skip-link:focus {
  z-index: 100000;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: .65rem 1rem;
  clip: auto;
  background: #fff;
  color: #111;
}
.cos-shell { width: min(calc(100% - 2.5rem), var(--cos-shell)); margin-inline: auto; }

.cos-site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.cos-site-header.is-scrolled { border-color: var(--cos-line); box-shadow: 0 8px 28px rgba(28,31,36,.08); }
.cos-header-inner { position: relative; min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cos-brand { flex: 0 0 auto; display: inline-grid; gap: 2px; color: var(--cos-ink); text-decoration: none; }
.cos-wordmark { display: flex; gap: 3px; }
.cos-letter { display: grid; width: 28px; height: 32px; place-items: center; border-radius: 6px; color: #fff; font-size: 1.35rem; font-weight: 500; line-height: 1; }
.cos-letter-c { background: #db0054; }
.cos-letter-o { background: #8bbd00; }
.cos-letter-s { background: #eb681f; }
.cos-brand-copy { font-size: .52rem; font-weight: 750; letter-spacing: .18em; line-height: 1.15; text-align: center; text-transform: uppercase; }
.cos-main-nav { margin-left: auto; }
.cos-menu, .cos-menu ul { list-style: none; margin: 0; padding: 0; }
.cos-menu { display: flex; align-items: center; gap: .15rem; }
.cos-menu > li { position: relative; }
.cos-menu a { display: block; padding: .7rem .65rem; color: var(--cos-ink); font-size: .86rem; font-weight: 750; text-decoration: none; }
.cos-menu a:hover, .cos-menu a:focus-visible { color: var(--cos-magenta); }
.cos-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  padding: .5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(.5rem);
  border: 1px solid var(--cos-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--cos-shadow);
  transition: .18s ease;
}
.cos-menu li:hover > .sub-menu, .cos-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.cos-menu-toggle { display: none; flex: 0 0 44px; margin-left: auto; padding: .55rem; border: 0; background: transparent; }
.cos-menu-toggle > span:not(.screen-reader-text) { display: block; width: 26px; height: 2px; margin: 5px; background: var(--cos-ink); }

.cos-section { position: relative; overflow: clip; }
.cos-section-inner { padding-block: clamp(4rem, 8vw, 7rem); }
.cos-section:nth-of-type(even) { background: var(--cos-soft); }
.cos-section-heading { max-width: 780px; margin: 0 auto clamp(2rem, 5vw, 4rem); text-align: center; }
.cos-section-heading p { color: var(--cos-muted); font-size: 1.12rem; }
.cos-highlight { color: var(--cos-magenta); font-weight: 800; }
.cos-kicker { margin-bottom: .75rem; color: inherit; font-size: .82rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

.cos-hero { position: relative; min-height: calc(100svh - 82px); background: #111; color: #fff; }
.cos-slides, .cos-slide { min-height: inherit; }
.cos-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 4rem 1.25rem;
  opacity: 0;
  visibility: hidden;
  background-position: center;
  background-size: cover;
  transition: opacity .7s ease, visibility .7s ease;
}
.cos-slide.is-active, .cos-slide:first-child { opacity: 1; visibility: visible; }
.cos-slide ~ .cos-slide.is-active { opacity: 1; visibility: visible; }
.cos-slide-shade { position: absolute; inset: 0; background: linear-gradient(115deg, rgba(17,19,24,.82), rgba(17,19,24,.3)); }
.cos-slide-content { position: relative; z-index: 1; width: min(100%, 980px); text-align: center; text-shadow: 0 2px 24px rgba(0,0,0,.45); }
.cos-slide-content h2 { max-width: 980px; margin-inline: auto; color: #fff; font-size: clamp(2.5rem, 7vw, 5.8rem); }
.cos-slide-content .cos-kicker { color: #fff; }
.cos-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .75rem 1.25rem;
  border: 2px solid var(--cos-magenta);
  border-radius: 999px;
  background: var(--cos-magenta);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease;
}
.cos-button:hover { transform: translateY(-2px); background: #9f0040; color: #fff; }
.cos-slider-dots { position: absolute; z-index: 5; bottom: 2rem; left: 50%; display: flex; gap: .55rem; transform: translateX(-50%); }
.cos-slider-dots button { width: 12px; height: 12px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; }
.cos-slider-dots button[aria-current="true"] { background: #fff; }
.cos-hero-arrow { position: absolute; z-index: 5; right: 2rem; bottom: 1.3rem; color: #fff; font-size: 2rem; text-decoration: none; }

.cos-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; align-items: stretch; }
.cos-section--optometria .cos-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cos-card { overflow: hidden; border: 1px solid var(--cos-line); border-radius: var(--cos-radius); background: #fff; box-shadow: 0 8px 25px rgba(33,36,42,.06); }
.cos-card-media { aspect-ratio: 4 / 3; overflow: hidden; background: #eceeef; }
.cos-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.cos-card:hover .cos-card-media img { transform: scale(1.035); }
.cos-card-body { padding: 1.35rem; }
.cos-card-body h3 { color: var(--cos-ink); }
.cos-card-role { color: var(--cos-green); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cos-card-copy { color: var(--cos-muted); font-size: .94rem; }
.cos-card-copy p:last-child { margin-bottom: 0; }

.cos-section--que-fem-cos { background: var(--cos-ink) !important; color: #fff; }
.cos-about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; padding-block: clamp(4rem, 8vw, 7rem); }
.cos-about-copy p { color: #e5e6e8; font-size: 1.14rem; }
.cos-embed { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--cos-radius); box-shadow: var(--cos-shadow); }
.cos-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.cos-testimonials { max-width: 760px; margin-inline: auto; }
.cos-testimonial { padding: clamp(1.5rem, 4vw, 3rem); border-left: 6px solid var(--cos-orange); border-radius: 0 var(--cos-radius) var(--cos-radius) 0; background: #fff; box-shadow: var(--cos-shadow); }
.cos-testimonial p { color: var(--cos-muted); font-size: 1.1rem; }

.cos-section--mapa-360 { padding: 0; background: #111 !important; }
.cos-section--mapa-360 > p { margin: 0; }
.cos-section--mapa-360 iframe { display: block; width: 100%; height: min(72vh, 700px); }

.cos-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.cos-gallery-item { position: relative; overflow: hidden; min-height: 280px; border-radius: var(--cos-radius); background: var(--cos-ink); }
.cos-gallery-item img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; opacity: .85; transition: transform .35s ease, opacity .35s ease; }
.cos-gallery-item h3 { position: absolute; right: 1rem; bottom: 1rem; left: 1rem; margin: 0; color: #fff; text-shadow: 0 2px 10px #000; }
.cos-gallery-item:hover img { transform: scale(1.035); opacity: 1; }

.cos-section--contacte-cos { padding-block: clamp(4rem, 8vw, 7rem); background: #fff !important; }
.cos-contact { display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.cos-contact-intro { position: sticky; top: 110px; padding: 2rem; border-radius: var(--cos-radius); background: var(--cos-ink); color: #fff; }
.cos-contact-intro .cos-kicker { color: #fff; }
.cos-contact-form .cos-section-heading { margin-bottom: 2rem; text-align: left; }
.cos-contact-form .cos-section-heading p { margin: 0; }
.wpcf7-form p { margin-bottom: 1rem; }
.wpcf7-form label { display: block; font-weight: 700; }
.wpcf7-form input:not([type="submit"]), .wpcf7-form textarea, .wpcf7-form select {
  width: 100%;
  padding: .8rem 1rem;
  border: 1px solid #b9bdc5;
  border-radius: 10px;
  background: #fff;
  color: var(--cos-ink);
}
.wpcf7-form input[type="submit"] { min-height: 48px; padding: .75rem 1.25rem; border: 0; border-radius: 999px; background: var(--cos-magenta); color: #fff; font-weight: 800; cursor: pointer; }
.cos-section--contacte-cos > iframe, .cos-section--contacte-cos > p > iframe { display: block; width: 100%; margin-top: 4rem; }

.cos-entry { padding-block: clamp(3rem, 8vw, 7rem); }
.cos-entry-header { max-width: 900px; margin-bottom: 2.5rem; }
.cos-entry-content { max-width: 900px; }
.cos-entry-content > * + * { margin-top: 1.2em; }
.cos-entry-content iframe { width: 100%; }
.cos-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.cos-post-card { padding: 1.5rem; border: 1px solid var(--cos-line); border-radius: var(--cos-radius); background: #fff; }
.cos-post-card h2 { font-size: 1.4rem; }
.cos-post-card h2 a { color: var(--cos-ink); text-decoration: none; }
.cos-not-found { min-height: 55vh; }

.cos-site-footer { padding-block: 3rem; background: #25272c; color: #fff; }
.cos-site-footer a { color: #fff; }
.cos-footer-inner { text-align: center; }
.cos-footer-meta { margin-top: 1.75rem; color: #bfc2c8; font-size: .88rem; }

@media (max-width: 1080px) {
  .cos-menu-toggle { position: absolute; top: 50%; right: 0; z-index: 2; display: block; margin: 0; transform: translateY(-50%); }
  .cos-main-nav { position: absolute; top: 100%; right: 0; left: 0; display: none; max-height: calc(100vh - 82px); overflow: auto; padding: .75rem 1.25rem 1.5rem; border-bottom: 1px solid var(--cos-line); background: #fff; box-shadow: 0 18px 30px rgba(30,33,40,.1); }
  .cos-main-nav.is-open { display: block; }
  .cos-menu { display: block; }
  .cos-menu a { padding: .72rem .4rem; font-size: 1rem; }
  .cos-menu .sub-menu { position: static; min-width: 0; padding: 0 0 0 1rem; opacity: 1; visibility: visible; transform: none; border: 0; box-shadow: none; }
  .cos-section--optometria .cos-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body.admin-bar .cos-site-header { top: 46px; }
  .cos-shell { width: min(calc(100% - 1.5rem), var(--cos-shell)); }
  .cos-header-inner { min-height: 72px; }
  .cos-letter { width: 25px; height: 29px; font-size: 1.2rem; }
  .cos-hero { min-height: calc(100svh - 72px); }
  .cos-slide { background-position: 58% center; }
  .cos-slide-content { text-align: left; }
  .cos-slide-content h2 { max-width: 100%; font-size: clamp(2.4rem, 11.8vw, 3.2rem); overflow-wrap: anywhere; }
  .cos-slider-dots { left: 1.25rem; transform: none; }
  .cos-hero-arrow { right: 1.25rem; }
  .cos-card-grid, .cos-section--optometria .cos-card-grid, .cos-gallery, .cos-post-grid { grid-template-columns: 1fr; }
  .cos-about, .cos-contact { grid-template-columns: 1fr; }
  .cos-contact-intro { position: static; }
  .cos-gallery-item, .cos-gallery-item img { min-height: 240px; }
}

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

@media print {
  .cos-site-header, .cos-site-footer, .cos-slider-dots, .cos-hero-arrow { display: none !important; }
  .cos-slide { position: relative; display: none; min-height: 0; color: #000; }
  .cos-slide:first-child { display: block; }
}
