/* Action controls on public pages share the same type, geometry and focus ring. */
:root {
  --cbd-corner-radius: 9px;
  --cbd-gold: #d4af37;
  --cbd-ink: #001f3f;
  --cbd-accent-text: var(--cbd-ink);
  --cbd-soft-surface: #f1f5f9;
}

/* The nearest surface determines the readable foreground, including nested cards. */
:where(.bg-navy-800, .bg-navy-900, .bg-slate-800, .bg-slate-900, .bg-black,
  #navbar, #mobile-menu, footer, header.text-white, header:has(picture),
  .article-nav, .article-hero, .answer, .cases-hero, .case-cta, .case-photo figcaption,
  .about-founder-brand, .service-guidance-box, .about-trust-card, .quote-form-panel,
  .blog-card, .shine-on-hover:has(> img), .cbd-on-dark) {
  --cbd-accent-text: var(--cbd-gold);
  --cbd-soft-surface: #173853;
}
:where(.bg-white, .bg-slate-50, .bg-slate-100, .bg-gray-50, .bg-gold-400,
  .bg-amber-50, .case-study, .note, .warning, .info-box, .warning-box, .cbd-on-light) {
  --cbd-accent-text: var(--cbd-ink);
  --cbd-soft-surface: #f1f5f9;
}
body :is(.bg-gold-400\/5, .bg-gold-400\/10, .bg-gold-400\/15, .bg-gold-400\/20, .bg-gold-400\/40),
body .hover\:bg-gold-400\/10:hover,
body .hover\:bg-gold-400\/20:hover {
  background-color: var(--cbd-soft-surface);
}
body :is(.text-gold-300, .text-gold-400, .text-gold-500, .text-gold-600),
body :is(.hover\:text-gold-400, .hover\:text-gold-500, .hover\:text-gold-600):hover,
body .group:hover :is(.group-hover\:text-gold-400, .group-hover\:text-gold-500, .group-hover\:text-gold-600) {
  color: var(--cbd-accent-text) !important;
}
body :is(.bg-gold-400, .bg-gold-500),
body .hover\:bg-gold-400:hover:not(.cbd-button) {
  color: var(--cbd-ink);
}
/* Gold labels and actions can sit inside sections that force light text. */
body :is(.bg-gold-400, .bg-gold-500):is(.text-navy-800, .text-navy-900, .cbd-button--gold),
body :is(.bg-gold-400, .bg-gold-500) :is(.text-navy-800, .text-navy-900),
body :is(button, a).cbd-button.cbd-button--gold {
  color: var(--cbd-ink) !important;
}
body ::selection { color: var(--cbd-ink); background-color: var(--cbd-gold); }

/* The same corner radius applies to static cards and cards rendered by the blog. */
body :is(
  .about-principle-card,
  .about-trust-card,
  .about-founder-brand,
  .about-founder-copy,
  .answer,
  .article-cta,
  .blog-card,
  .blog-preview-card,
  .case-photo,
  .case-study,
  .cases-proof-note,
  .cbd-card,
  .contact-card,
  .electrical-card,
  .faq-item,
  .featured-star-card,
  .highlight-box,
  .home-case-card,
  .home-confidence-card,
  .home-trust-chip,
  .home-service-pill,
  .hero-badge,
  .trust-badge,
  .nav-service-badge,
  .nav-dropdown-link,
  .info-box,
  .mechanic-card,
  .note,
  .price-card,
  .price-reference,
  .quote-form-panel label:has(input[type="checkbox"]),
  .pricing-card,
  .quote-form-panel,
  .review-card,
  .service-card,
  .service-catalog-card,
  .service-guidance-box,
  .stat-card,
  .step-box,
  .type-card,
  .warning,
  .warning-box,
  .secondary-service-grid > a,
  .related > a,
  .cases-button,
  .article-cta a,
  :is(div, section, aside, article, li, a, span).rounded-sm
) {
  /* Some legacy cards set their radius inline or override it on phones. */
  border-radius: var(--cbd-corner-radius) !important;
}
body :is(.blog-card, .blog-preview-card, .home-case-card, .case-photo, .service-catalog-card),
body .cbd-card:has(> picture, > img, > .blog-img-zoom) {
  overflow: clip;
}

.cbd-button--gold {
  --button-fill: var(--cbd-gold);
  --button-ink: var(--cbd-ink);
  --button-edge: var(--cbd-ink);
  --button-hover: #fff;
}
.cbd-button--ink {
  --button-fill: #092440;
  --button-ink: #fff;
  --button-edge: #092440;
  --button-hover: #183c5c;
}
.cbd-button--light {
  --button-fill: rgba(8, 27, 47, .75);
  --button-ink: #fff;
  --button-edge: #b9c6d2;
  --button-hover: #173953;
}
.cbd-button--outline {
  --button-fill: #fff;
  --button-ink: #0a2947;
  --button-edge: #72869a;
  --button-hover: #eef3f6;
}
/* Match the destination so shared menus and article links get the same treatment. */
a.cbd-button:is([href*="wa.me/"], [href*="api.whatsapp.com/"], [href*="whatsapp.com/send"]),
#quote-form .cbd-button[type="submit"] {
  --button-fill: #d9eff8;
  --button-ink: var(--cbd-ink);
  --button-edge: #54758b;
  --button-hover: #bddfeb;
}
body a.cbd-button:is(.cbd-button--gold, .cbd-button--ink, .cbd-button--outline, .cbd-button--light)[href*="wa.me/"],
body #quote-form .cbd-button[type="submit"] {
  color: var(--cbd-ink) !important;
}
body :is(a, button).cbd-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  max-width: 100%;
  min-height: 44px;
  padding: .72rem 1.25rem;
  border: 1px solid var(--button-edge);
  border-radius: var(--cbd-corner-radius);
  background: var(--button-fill);
  color: var(--button-ink);
  font: 700 .94rem/1.3 Inter, system-ui, sans-serif;
  letter-spacing: .015em;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  box-shadow: none;
  transition: background-color .16s ease, border-color .16s ease;
}
body :is(a, button).cbd-button:hover {
  background: var(--button-hover);
  color: var(--button-ink);
  transform: none;
}
body :is(a, button).cbd-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px #1a517c;
}
.cbd-button > i { margin-inline: 0; }
:is(#contact-form, #cotizar-form, #quote-form) :is(textarea, select,
  input:not([type]), input[type="text"], input[type="tel"], input[type="email"],
  input[type="number"], input[type="date"]) {
  border-radius: var(--cbd-corner-radius);
}
body button:not(.home-case-gallery-dot, .rounded-full),
body input:is([type="submit"], [type="button"], [type="reset"]),
body [role="button"]:not(.rounded-full),
body .cases-index a,
body .cbd-lang-btn,
body a.rounded-sm.text-center[href].border {
  border-radius: var(--cbd-corner-radius);
}
.blog-filter-btn, .blog-pagination-btn {
  min-height: 44px;
  min-width: 44px;
}
body :is(.blog-filter-btn, .blog-pagination-btn).active {
  color: var(--cbd-ink);
  background: var(--cbd-gold);
  border-color: var(--cbd-gold);
}
body :is(.blog-filter-btn, .blog-pagination-btn):hover:not(.active) {
  color: white;
  background: #173853;
  border-color: var(--cbd-gold);
}
.case-service-link { margin-top: 1rem; }
.case-service-link a {
  color: #113d5e;
  font-weight: 650;
}
body :is(a.cbd-action-link, .case-service-link a) {
  border-radius: var(--cbd-corner-radius);
  text-decoration: none;
}
body :is(a.cbd-action-link, .case-service-link a):hover {
  background-color: color-mix(in srgb, currentColor 12%, transparent);
  text-decoration: none;
}
.mobile-blog-filter { display: none; }
html.mobile-nav-open, html.mobile-nav-open body { overflow: hidden; }
#mobile-menu { overscroll-behavior-y: contain; }
#mobile-menu[aria-hidden="true"] { box-shadow: none !important; }
@media (min-width: 768px) and (max-width: 1023px) {
  #navbar .hidden.md\:flex { display: none; }
  #navbar #mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
  }
}
@media (max-width: 1023px) {
  #mobile-menu:has(> #close-menu-btn) {
    align-items: stretch;
    justify-content: flex-start;
    gap: .25rem;
    padding: max(4.5rem, calc(env(safe-area-inset-top) + 3.75rem)) 1.5rem
      max(1.5rem, env(safe-area-inset-bottom));
    height: 100dvh;
    overflow-y: auto;
  }
  #mobile-menu:has(> #close-menu-btn) > .mobile-link:not(.cbd-button, .cbd-action-link) {
    display: flex;
    align-items: center;
    min-height: 46px;
    flex-shrink: 0;
    font: 500 1.2rem/1.35 Georgia, serif;
    color: white;
    border-bottom: 1px solid #31485d;
  }
  #mobile-menu:has(> #close-menu-btn) > .cbd-button {
    margin-top: .75rem;
    font: 700 1rem/1.35 Inter, system-ui, sans-serif;
    color: var(--button-ink);
  }
}
@media (max-width: 767px) {
  .mobile-blog-filter:not([hidden]) {
    display: grid;
    gap: .5rem;
    margin: 0 0 1.5rem;
    font-weight: 600;
    color: #f5f7fa;
  }
  .mobile-blog-filter select {
    width: 100%;
    min-height: 48px;
    padding: .6rem .8rem;
    border: 1px solid #71879d;
    border-radius: var(--cbd-corner-radius);
    background: #102b46;
    color: white;
    font: inherit;
    font-size: 1rem;
    color-scheme: dark;
  }
  .mobile-blog-filter:not([hidden]) + #blog-filters { display: none; }
  body.mobile-form-visible .whatsapp-float { visibility: hidden; }
  #cotizar-form :is(.form-input, #telefono-num, #country-code),
  #contact-form :is(input:not([type=checkbox]):not([type=hidden]), select, textarea) {
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }
  :is(#cotizar-form #country-code, #contact-form #form-country-code) { max-width: 5.5rem !important; }
  :is(#cotizar-form #telefono-num, #contact-form #form-telefono-num) { width: 0; flex: 1 1 0%; }
}
@media (prefers-reduced-motion: reduce) {
  body :is(a, button).cbd-button { transition: none; }
}

/* Price panels and photo badges follow the same curve as the action controls. */
:is(.featured-service-badge, .service-card-badge, .home-case-badge, .featured-service-price, .featured-service-action) {
  border-radius: var(--cbd-corner-radius);
}
.featured-star-card {
  --feature-accent: var(--cbd-gold);
  --feature-ink: #071d36;
}
.featured-star-card .featured-service-badge {
  color: var(--feature-ink);
  background: var(--feature-accent);
}
.featured-star-card .featured-service-price {
  color: #fff;
  background: #163957;
  border: 1px solid #7994a9;
}
.featured-service-price > i { color: var(--feature-accent); }
.featured-service-price .featured-price-unit { color: #e8f1f7; }
.featured-star-card .featured-service-action {
  min-height: 44px;
  background: white;
  color: var(--feature-ink);
}
.featured-star-card:is(:hover, :focus-visible) .featured-service-action { background: #e8f1f7; }
.featured-star-card :is(.text-gold-400, .ph-check-circle) { color: var(--feature-accent) !important; }

/* Keep a complete photo and the fixed navigation visible on short screens. */
:root {
  --cbd-photo-limit: calc(100vh - 112px);
}
@supports (height: 100svh) {
  :root { --cbd-photo-limit: calc(100svh - 112px); }
}
body img { max-width: 100%; max-height: var(--cbd-photo-limit); }
body .photo-portrait { justify-self: center; width: fit-content; max-width: 100%; }
body .photo-portrait img,
body .service-photo img,
body.cbd-article :is(figure, article, .article-body) img:not(.rounded-full) {
  display: block;
  width: auto;
  height: auto;
  max-height: var(--cbd-photo-limit);
  margin-inline: auto;
  object-fit: contain;
  border-radius: var(--cbd-corner-radius);
}
body .service-photo { border: 0; padding: 0; box-shadow: none; background: transparent; }
body .service-photo figcaption { padding-inline: 0; }
body :is(section, article, main, figure) img:not(.rounded-full, .absolute, [src$=".svg"], .whatsapp-float img, header img, .absolute img) {
  border-radius: var(--cbd-corner-radius);
}
/* Some article templates place their lead photo between the header and main. */
body.cbd-article img:not(.absolute, .absolute img, .rounded-full, nav img, footer img, [src*=".svg"], .whatsapp-float img) {
  border-radius: var(--cbd-corner-radius) !important;
}
body.cbd-article :is(.border-l-2, .border-l-4),
body.cbd-article :is(article, .article-body, .prose) :is(div, section, aside, a, span, blockquote):is(
  [class^="bg-"], [class*=" bg-"]
):not(.rounded-full, .overflow-hidden > div),
body.cbd-article :is(.compare-row, .quick-check > li, .overflow-x-auto:has(> table)) {
  border-radius: var(--cbd-corner-radius);
}
body :is(div, aside, span, article, a, label, figure, details, blockquote):is(.border, .border-2, .shadow-sm, .shadow-md, .shadow-xl, .rounded, .rounded-sm, .rounded-lg):not(.rounded-full, .fixed),
body :is(.blog-category-tag, .blog-filter-btn, .blog-pagination-btn, .blog-service-routes a, .blog-card [class*="bg-gold-"], .blog-preview-card [class*="bg-gold-"], .guide-label),
body span.absolute:is(.bg-gold-400, .bg-gold-500),
body div.absolute:is(.bg-gold-400, .bg-gold-500) {
  border-radius: var(--cbd-corner-radius) !important;
}
.blog-service-routes a { display: grid; align-content: center; gap: .3rem; }
.blog-service-routes a > span { margin: 0; }
body .blog-service-routes a:focus-visible,
body .blog-filter-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
body .blog-filter-btn:not(.active) { border-color: #7690a5; }

.cbd-number, .price-with-currency, .featured-price-amount, .home-process-list li > span,
.case-study__number, .step-dot, .blog-pagination-btn {
  font-family: Inter, system-ui, sans-serif !important;
  font-variant-numeric: lining-nums tabular-nums;
}
body { font-variant-numeric: lining-nums; }
/* The numeric glyphs come from the same local Inter files used by the body. */
@font-face {
  font-family: "CBD Figures"; src: url("../fonts/inter-normal-400-latin.woff2") format("woff2");
  font-weight: 400; font-display: swap; unicode-range: U+0030-0039;
}
@font-face {
  font-family: "CBD Figures"; src: url("../fonts/inter-normal-700-latin.woff2") format("woff2");
  font-weight: 600 900; font-display: swap; unicode-range: U+0030-0039;
}
body :is(h1,h2,h3,h4).font-serif, body.cbd-article :is(h1,h2,h3) {
  font-family: "CBD Figures", "Playfair Display", Georgia, serif;
}
.price-with-currency { white-space: nowrap; }
.price-currency { font: 650 .55em/1 Inter, system-ui, sans-serif; }
.coverage-summary { margin-block: .85rem 1.25rem; line-height: 1.55; }
.coverage-summary a { text-decoration: underline; text-underline-offset: .16em; }
.coverage-summary--dark { color: #e2e8f0; }
.deck-warranty { display: grid !important; grid-template-columns: auto minmax(0,1fr); gap: 1.25rem; align-items: start; }
.deck-warranty > i { display: block; font-size: 2rem; line-height: 1; width: 2rem; }

.photo-service > img, .photo-service > figure:first-child > img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: cover; border-radius: var(--cbd-corner-radius); margin: 0 0 1.15rem;
}
body .photo-service { display: block; min-width: 0; }
.photo-service figure { position: relative; margin: 0; }
.photo-service .image-reference {
  position: absolute; bottom: .55rem; right: .55rem; padding: .2rem .48rem;
  background: #071a32; color: #fff; border-radius: var(--cbd-corner-radius);
  font: 600 .68rem/1.4 Inter,system-ui,sans-serif;
}
body .photo-service--process { background: #edf4f8; border-color: #9badbd; text-align: left; }
body .photo-service--process :is(h3,p) { color: var(--cbd-ink); }
body .photo-service.bg-white\/5 :is(p, li) { color: #dce6ee; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body :is(.cbd-card,.service-card,.service-catalog-card,.home-case-card,.blog-card,.blog-preview-card,
    .electrical-card,.mechanic-card,.review-card,.price-card,.pricing-card,.about-principle-card,
    .home-confidence-card,.about-trust-card,.contact-card,.home-process-list > li,.home-guide-links a,
    .featured-star-card,.related > a,.step-box,.type-card,.stat-card) {
    transition: transform .4s cubic-bezier(.175,.885,.32,1.275), border-color .25s ease, box-shadow .3s ease;
  }
  body :is(.cbd-card,.service-card,.service-catalog-card,.home-case-card,.blog-card,.blog-preview-card,
    .electrical-card,.mechanic-card,.review-card,.price-card,.pricing-card,.about-principle-card,
    .home-confidence-card,.about-trust-card,.contact-card,.home-process-list > li,.home-guide-links a,
    .featured-star-card,.related > a,.step-box,.type-card,.stat-card):is(:hover,:focus-visible) {
    transform: translateY(-5px);
    border-color: var(--cbd-gold);
    box-shadow: 0 14px 30px rgba(7, 26, 50, .22), 0 0 0 1px var(--cbd-gold);
  }
}
@media (prefers-reduced-motion: reduce) {
  body :is(.cbd-card,.service-card,.service-catalog-card,.blog-card,.home-case-card,.featured-star-card):hover {
    transform: none !important; transition: none !important;
  }
}

/* One sine period. Its four quarter arcs meet at the slope of the sine,
   including at the tile seam. Reuse this same silhouette for both fills. */
:root {
  --cbd-wave-period: 360px;
  --cbd-wave-height: 32px;
  --cbd-wave-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 28' preserveAspectRatio='none'%3E%3Cpath d='M0 14C17.5 8.764 35 4 52.5 4S87.5 8.764 105 14S140 24 157.5 24S192.5 19.236 210 14V28H0Z'/%3E%3C/svg%3E");
}
@media (max-width: 767px) {
  :root { --cbd-wave-period: 200px; --cbd-wave-height: 22px; }
}
body footer, .cbd-article-hero { position: relative; }
body footer {
  /* The crest extends above the footer's box on the homepage as well. */
  content-visibility: visible;
  overflow: visible;
  color-scheme: dark;
  border-top: 0;
}
body footer::before, body footer::after, body .deck-hero::after, body .cbd-article-hero::after, body .ocean-divider::after,
body .hero-wave-container:not(.wave-2)::after, body > :is(header, section) + section::before,
body.cbd-article > .bg-navy-900 + main.bg-white::before {
  height: var(--cbd-wave-height);
  mask: var(--cbd-wave-shape) 0 0 / var(--cbd-wave-period) 100% repeat-x;
  animation: cbd-wave-flow 9s linear infinite;
}
body footer::before, body footer::after, body .deck-hero::after, body .cbd-article-hero::after, body .ocean-divider::after,
body .hero-wave-container:not(.wave-2)::after {
  content: "";
  display: block;
  pointer-events: none;
  position: absolute;
  inset: auto 0 -1px;
  background: var(--cbd-wave-to, #fff);
}
body footer::before, body footer::after {
  inset: auto 0 100%;
}
/* Offset two copies by one pixel to show the crest against navy as well. */
body footer::before { background: #758fa2; }
body footer::after {
  background-color: inherit;
  margin-bottom: -1px;
}
body .cbd-article-hero { overflow: hidden; }
body .cbd-article-hero::after, body .deck-hero::after { z-index: 1; }
body > .deck-hero + section::before { display: none; }
body.cbd-article.bg-navy-900 .cbd-article-hero { --cbd-wave-to: var(--cbd-ink); }
body.cbd-article .cbd-article-hero + section::before { display: none; }
/* Some articles have a navy breadcrumb band between the hero and the copy. */
body.cbd-article > .bg-navy-900:has(+ main.bg-white) { border-bottom-width: 0; }
body.cbd-article > .bg-navy-900 + main.bg-white::before {
  content: ""; display: block; background: var(--cbd-ink); transform: scaleY(-1);
}
body .ocean-divider, body .hero-wave-container:not(.wave-2) {
  height: var(--cbd-wave-height); width: 100%; overflow: hidden;
}
body .ocean-divider { position: relative; background: var(--cbd-wave-from, transparent); }
body .hero-wave-container { --cbd-wave-to: var(--cbd-ink); }
body .hero-wave-container :is(svg), body .hero-wave-container.wave-2 { display: none; }
body > :is(header, section) + section.border-y { border-top-width: 0; }
@keyframes cbd-wave-flow {
  to { mask-position: calc(-1 * var(--cbd-wave-period)) 0; }
}
@media (prefers-reduced-motion: reduce) {
  body footer::before, body footer::after, body .deck-hero::after, body .cbd-article-hero::after, body .ocean-divider::after,
  body.cbd-article > .bg-navy-900 + main.bg-white::before,
  body .hero-wave-container::after, body > :is(header, section) + section::before { animation: none !important; }
}
