/*
Theme Name: New CES Child – Jesús Pons
Theme URI: https://jesuspons.cl/
Description: Personalizaciones seguras del tema New CES para Jesús Pons.
Author: Destacados.cl
Template: new-ces
Version: 1.0.17
Text Domain: new-ces-child
*/

:root {
  --jp-red: #cf2137;
  --jp-red-dark: #a40619;
  --jp-ink: #393939;
  --jp-muted: #636363;
  --jp-soft: #f4f4f4;
  --jp-line: #e2e2e2;
  --jp-white: #fff;
}

.jp-floating-whatsapp {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #00863d;
  color: #fff;
  box-shadow: 0 4px 14px rgb(0 0 0 / 24%);
  text-decoration: none;
}
.jp-floating-whatsapp:hover { background: #006c31; }
.jp-floating-whatsapp:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #00863d; }
.jp-floating-whatsapp img { display: block; width: 30px; height: 30px; }
.jp-floating-whatsapp-label {
  display: none;
  position: absolute;
  right: 66px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  color: #393939;
  white-space: nowrap;
  font-size: 14px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 15%);
}
@media (max-width: 767px) {
  .jp-floating-whatsapp-label { display: none; }
  .jp-floating-whatsapp { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
}

body#derco-template-css {
  color: var(--jp-ink);
}

/* Subaru is independent of Derco: remove only its header brand column. */
body.post-type-archive-jp_subaru_model #header .primary > div:first-child,
body.single-jp_subaru_model #header .primary > div:first-child {
  display: none !important;
}

/* The catalog banner now presents editorial copy and the model range only. */
.jp-subaru-catalog .jp-subaru-hero .jp-subaru-cobrand { display: none; }

/* Do not crop campaign copy or cover its footer with the brands panel. */
.jp-image-home-carousel #main-slider {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1800 / 760;
}
.jp-image-home-carousel #main-slider > .container-fluid,
.jp-image-home-carousel #main-slider .content_slider,
.jp-image-home-carousel #main-slider .swiper-container,
.jp-image-home-carousel #main-slider .slider-cover,
.jp-image-home-carousel #main-slider .slide-background {
  height: 100% !important;
  min-height: 0 !important;
}
.jp-image-home-carousel #main-slider .slide-background img { object-fit: contain; }
.jp-image-home-carousel #brands { top: 0 !important; margin-top: 32px !important; }
@media (max-width: 425px) {
  .jp-image-home-carousel #main-slider { aspect-ratio: 648 / 972; }
}

#header .header-text {
  color: var(--jp-white) !important;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.1;
  max-width: 150px;
  text-transform: uppercase;
}

/* Preserve the supplied transparent logo geometry; render it white on dark bars. */
#header .img-logo-header,
#footer img[src*="jesus-pons-logo-oficial"] {
  filter: brightness(0) invert(1);
}

#header .img-logo-header {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

@media (max-width: 767px) {
  #header .img-logo-header { width: 190px; max-width: 100%; }
}

/* Reserve the real Derco badge width instead of letting it overlap the CES logo. */
#header .mobile-header .primary > div:nth-child(2) .box-name {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: none;
  padding: 16px 0;
}
@media (min-width: 768px) {
  #header .mobile-header .primary > div:first-child {
    flex: 0 0 120px;
    width: 120px;
    max-width: 120px;
  }
  #header .mobile-header .navbar-brand img {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    margin: 0 !important;
  }
  #header .mobile-header .primary > div:nth-child(2) {
    flex: 0 0 210px;
    width: 210px;
    max-width: 210px;
    margin-left: 24px;
    margin-right: 16px;
  }
  body.post-type-archive-jp_subaru_model #header .mobile-header .primary > div:nth-child(2),
  body.single-jp_subaru_model #header .mobile-header .primary > div:nth-child(2) {
    margin-left: 0;
  }
}

/* Keep the original hamburger, but give its zero-height wrapper a touch target. */
#header #open-nav {
  display: block;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

#header #open-nav #nav-icon {
  top: 10px;
  margin-top: 0;
}

#close-menu-mobile {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#open-nav:focus-visible,
#close-menu-mobile:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (min-width: 992px) {
  #header .mobile-header .primary {
    flex-wrap: nowrap;
  }

  #header .desktop-nav {
    flex: 1 1 auto;
    margin-right: 0;
    max-width: none;
    padding-left: 8px;
    padding-right: 8px;
    width: auto;
  }

  #header .desktop-nav > div,
  #header .desktop-nav > div > ul {
    width: 100%;
  }

  #header .desktop-nav > div > ul {
    justify-content: flex-end;
  }
}

.jp-page {
  background: var(--jp-white);
}

.jp-page * {
  box-sizing: border-box;
}

.jp-shell {
  margin: 0 auto;
  max-width: 1140px;
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
}

.jp-hero {
  align-items: center;
  background: var(--jp-white);
  border-bottom: 1px solid var(--jp-line);
  color: var(--jp-ink);
  display: flex;
  padding: 64px 0 48px;
  position: relative;
}

.jp-hero::after {
  content: none;
}

.jp-hero--compact {
  min-height: 0;
}

.jp-hero h1 {
  color: inherit;
  font-family: "Lato-Bold", "Lato", sans-serif;
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.15;
  margin: 0 0 24px;
  max-width: 900px;
}

.jp-hero--compact h1 {
  font-size: clamp(30px, 3.5vw, 44px);
}

.jp-hero p:not(.jp-kicker) {
  color: var(--jp-muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 790px;
}

.jp-kicker {
  color: var(--jp-red);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.jp-cta .jp-kicker {
  color: #ff7479;
}

.jp-section {
  padding-bottom: 64px;
  padding-top: 64px;
}

.jp-section--soft {
  background: var(--jp-soft);
}

.jp-section h2,
.jp-cta h2 {
  color: var(--jp-ink);
  font-family: "Lato-Bold", "Lato", sans-serif;
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.2;
  margin: 0 0 22px;
}

.jp-prose {
  font-size: 1.08rem;
  line-height: 1.8;
}

.jp-prose h2:not(:first-child) {
  margin-top: 44px;
}

.jp-grid {
  display: grid;
  gap: 24px;
}

.jp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.jp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.jp-card,
.jp-form,
.jp-stat {
  background: var(--jp-white);
  border: 1px solid var(--jp-line);
  border-radius: 22px;
  padding: 32px;
}

.jp-card {
  min-width: 0;
}

.jp-card h2,
.jp-card h3,
.jp-form h2 {
  color: var(--jp-ink);
  font-size: 1.3rem;
  font-family: "Lato-Bold", "Lato", sans-serif;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 16px;
}

.jp-card p {
  color: var(--jp-muted);
  line-height: 1.65;
}

.jp-card a {
  color: var(--jp-red);
  display: inline-block;
  font-weight: 800;
  margin-top: 8px;
}

.jp-stat {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jp-stat strong {
  color: var(--jp-red);
  font-size: 2.7rem;
  line-height: 1;
}

.jp-stat span {
  color: var(--jp-muted);
  font-weight: 700;
}

.jp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.jp-button,
.jp-page .ff-btn-submit {
  background: var(--jp-white) !important;
  border: 2px solid var(--jp-red) !important;
  border-radius: 30px !important;
  color: var(--jp-red) !important;
  display: inline-flex;
  font-family: "Lato-Bold", "Lato", sans-serif;
  font-size: 18px !important;
  font-weight: 700 !important;
  justify-content: center;
  padding: 14px 22px !important;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}

.jp-button:hover,
.jp-page .ff-btn-submit:hover {
  background: var(--jp-red-dark) !important;
  border-color: var(--jp-red-dark) !important;
  color: var(--jp-white) !important;
}

.jp-button--outline {
  background: transparent !important;
  border-color: var(--jp-ink) !important;
  color: var(--jp-ink) !important;
}

.jp-button--light {
  background: var(--jp-white) !important;
  border-color: var(--jp-white) !important;
  color: var(--jp-red) !important;
}

.jp-cta .jp-button--outline {
  border-color: var(--jp-white) !important;
  color: var(--jp-white) !important;
}

.jp-cta {
  background: var(--jp-red);
  color: var(--jp-white);
  padding: 56px 0;
}

.jp-cta .jp-shell {
  align-items: center;
  display: flex;
  gap: 32px;
  justify-content: space-between;
}

.jp-cta h2,
.jp-cta p {
  color: inherit;
}

.jp-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 36px;
}

body.jp-empty-home-carousel #main-slider { display: none !important; }
body.jp-empty-home-carousel #brands { top: 0 !important; margin-top: 32px !important; }

.jp-chip-list span {
  background: var(--jp-soft);
  border-radius: 99px;
  color: var(--jp-ink);
  font-size: .88rem;
  font-weight: 700;
  padding: 9px 14px;
}

.jp-form .ff-el-form-control {
  border-color: #cfd2d6 !important;
  border-radius: 3px !important;
  min-height: 46px;
  font-size: 16px !important;
  max-width: 100%;
}

.jp-form .ff-el-input--label label {
  color: var(--jp-ink);
  font-weight: 700;
}

.page-template-default .wrap {
  max-width: none;
  padding: 0;
}

.page-template-default .site-main > h1 {
  display: none;
}

@media (max-width: 991px) {
  .jp-grid--3,
  .jp-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .jp-shell { padding-left: 18px; padding-right: 18px; }
  .jp-hero { padding: 44px 0 32px; }
  .jp-hero p:not(.jp-kicker) { font-size: 16px; }
  .jp-section { padding-bottom: 40px; padding-top: 40px; }
  .jp-grid--2,
  .jp-grid--3,
  .jp-grid--4 { grid-template-columns: 1fr; }
  .jp-card,
  .jp-form,
  .jp-stat { padding: 24px; }
  .jp-cta .jp-shell { align-items: flex-start; flex-direction: column; }
  .jp-actions .jp-button { width: 100%; }
  .jp-page .ff-btn-submit { width: 100%; }
}
