/* ============================================================================
   Personalization banner — VLP + VDP
   Reached only via @import from vlp-2020.css and vdp-2020.css, so any edit
   here requires `gulp minifyCss` before it can ship.
   ============================================================================ */

/* Theme tokens. Declared at :root rather than on .pm-invib-section because the
   carousel pager is a SIBLING of the slides and the promo grid card renders in a
   different subtree entirely — neither could inherit from the panel. */
:root {
    --pmib-panel-bg: #f4f4f4;
    --pmib-text-color: #131313;
    --pmib-muted-color: #555555;
    --pmib-offer-color: #AD0C34;
    --pmib-fineprint-color: #406C34;
    --pmib-accent-color: #AD0C34;
    --pmib-rule-color: #d3d3d3;
    --pmib-cta-bg: #111111;
    --pmib-cta-color: #ffffff;
    --pmib-banner-max-width: none;   /* `none` lets the banner match the page container width; set a length here to cap it */
}

/* Dark is a designed palette, not a background swap: the light accents measure
   2.07 (offer red) and 2.46 (fineprint green) against #262626 and are unreadable.
   Every value carrying text here meets WCAG AA on the dark panel. --pmib-rule-color
   is deliberately below that bar; it draws hairline dividers, not text.

   The class is applied to plugin-rendered wrappers rather than <body>, because
   dealer themes do not reliably call WordPress's body_class(). Custom properties
   inherit downward, so declaring them on a wrapper reaches every descendant. */
.pmib-theme-dark {
    --pmib-panel-bg: #262626;
    --pmib-text-color: #f5f5f5;
    --pmib-muted-color: #cfcfcf;
    --pmib-offer-color: #FF6B85;
    --pmib-fineprint-color: #8FCB7A;
    --pmib-accent-color: #f2c230;
    --pmib-rule-color: #4a4a4a;
    --pmib-cta-bg: #f2c230;
    --pmib-cta-color: #1a1a1a;
}

.pm-invib-section {
    padding: 20px 15px;
    color: var(--pmib-text-color);
}

/* vlp-2020.css sizes .inv-promotion-slider at 75% for the dealer's promo image
   banners. The offer panel is a content block and needs the full column. The id
   gives us specificity over that rule without editing it, so any other slider
   using the class is unaffected. Capped so the vehicle row does not stretch on
   ultrawide screens. The cap is a token so it can be lifted in one line. */
#vlp-promotions .inv-promotion-slider {
    width: 100%;
    max-width: var(--pmib-banner-max-width);
    margin: 0 auto;
}

/* vlp-2020.css sets `.slick-track { display: flex !important; align-items: center }`.
   A flex track takes its tallest item's height, so with slides of very different
   heights a short slide is centred far down the track — and adaptiveHeight shrinks
   .slick-list to that short slide's height, leaving it below the visible window and
   invisible. Aligning to the top keeps every slide starting at the top of the list
   whatever the track's height. The ccps promo slider already carries this same
   override, for the same reason. */
#vlp-promotions .inv-promotion-slider .slick-track {
    align-items: flex-start !important;
}

/* .inv-promotion-block centers its contents for the dealer's own IB promos;
   this layout is left-aligned. */
.pm-invib-section .pm-invib-mainrow {
    background-color: var(--pmib-panel-bg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.pm-invib-section .pm-invib-vehicleinfo {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pm-invib-section .pm-invib-topcols {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pm-invib-section .vehicleinfo-image { text-align: center; }
.pm-invib-section .vehicleinfo-image img {
    max-width: 260px;
    width: 100%;
    height: 140px;
    object-fit: cover;
    margin: auto;
}

.pm-invib-section .vehicleinfo-details { display: flex; flex-direction: column; gap: 8px; }
.pm-invib-section .vehicle-name { font-weight: 700; font-size: 24px; line-height: 120%; }
.pm-invib-section .main-details { font-size: 16px; line-height: 120%; }
.pm-invib-section .main-details span:not(:first-child)::before { content: "|"; margin: 0 4px; }
.pm-invib-section .secondary-details {
    font-size: 11px;
    line-height: 150%;
    color: var(--pmib-fineprint-color);
}

.pm-invib-section .vehicleinfo-claimcta a {
    background-color: var(--pmib-cta-bg);
    color: var(--pmib-cta-color);
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    line-height: 100%;
    transition: transform 120ms ease-in-out;
}
.pm-invib-section .vehicleinfo-claimcta a:hover,
.pm-invib-section .vehicleinfo-claimcta a:focus {
    transform: translateY(-2px);
    color: var(--pmib-cta-color);
    text-decoration: none;
}

.pm-invib-section .pm-invib-vehicleoffer { display: flex; flex-direction: column; gap: 8px; }
.pm-invib-section .vehicleoffer-title {
    font-weight: 700;
    font-size: 24px;
    line-height: 120%;
    color: var(--pmib-offer-color);
}
.pm-invib-section .vehicleoffer-details {
    font-size: 16px;
    line-height: 120%;
}
.pm-invib-section .vehicleoffer-details span:not(:first-child)::before { content: "|"; margin: 0 4px; }
.pm-invib-section .vehicleoffer-disclaimer { font-size: 11px; line-height: 100%; }

/* ---- Pager -----------------------------------------------------------------
   Appended once to #vlp-promotions, outside .inv-promotion-slider, so it is
   not itself a slide. It counts every slide in the shared slider, including
   the dealer's own Intelligent Banner promos.
   -------------------------------------------------------------------------- */
#vlp-promotions .pm-invib-slidenav { padding-top: 24px; }
#vlp-promotions .slidenav-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}
#vlp-promotions .slidenav-row svg { display: block; }
#vlp-promotions .slidenav-row button {
    border: 0;
    padding: 0;
    background-color: transparent !important;
    display: block;
    color: var(--pmib-text-color);
    transition: transform 120ms ease-in-out;
}
#vlp-promotions .slidenav-previous button:hover { transform: translateX(-2px); }
#vlp-promotions .slidenav-next button:hover { transform: translateX(2px); }
#vlp-promotions .slidenav-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 100%;
    color: var(--pmib-text-color);
}
/* Nothing to navigate to with a single slide. */
#vlp-promotions.pmib-single-promo .pm-invib-slidenav { display: none; }

/* ---- Breakpoints ---------------------------------------------------------- */
@media only screen and (min-width: 768px) {
    .pm-invib-section:not(.pm-invib-section--card) .pm-invib-vehicleinfo { flex-direction: row; }
}

/* Two columns only on the wide VLP banner. VDP renders into a much narrower
   column via --card and stays stacked at every width. 992px rather than 768px
   because at tablet widths two columns leave the offer terms too cramped. */
@media only screen and (min-width: 992px) {
    .pm-invib-section:not(.pm-invib-section--card) .pm-invib-topcols {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }
    .pm-invib-section:not(.pm-invib-section--card) .pm-invib-topcols > .pm-invib-vehicleinfo,
    .pm-invib-section:not(.pm-invib-section--card) .pm-invib-topcols > .pm-invib-vehicleoffer {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* VDP renders into a narrower column, so it holds the stacked layout longer
   and steps the headings down a size. */
.pm-invib-section--card { padding: 20px 10px 30px; }
.pm-invib-section--card .vehicle-name { font-size: 20px; }
.pm-invib-section--card .vehicleoffer-title { font-size: 20px; }

@media only screen and (min-width: 1200px) {
    .pm-invib-section--card .pm-invib-vehicleinfo { flex-direction: row; }
}

/* ---- Dark-theme corrections -------------------------------------------------
   Two problems only dark exposes.

   1. The promo disclaimer and the carousel pager render OUTSIDE the dark panel,
      on the page background — which stays light in both themes. They must not
      take on-panel tokens. Fixed values matching the reference design.

   2. The dealer theme ships `body, div, li, p { color: #333 }`. Inheritance has
      no specificity, so that directly-matching rule beats the colour inherited
      from .pm-invib-section and these render dark-on-dark. They need the token
      applied explicitly rather than inherited.
   -------------------------------------------------------------------------- */
.pmib-theme-dark .ccps-promo-block .ipb-disclaimer { color: #777; }
.pmib-theme-dark #vlp-promotions .slidenav-row button { color: #1f1f1f; }
.pmib-theme-dark #vlp-promotions .slidenav-pagination { color: #131313; }

.pmib-theme-dark .pm-invib-section .vehicle-name,
.pmib-theme-dark .pm-invib-section .main-details,
.pmib-theme-dark .pm-invib-section .vehicleoffer-details,
.pmib-theme-dark .pm-invib-section .vehicleoffer-disclaimer {
    color: var(--pmib-text-color);
}

/* The banner's panel has to line up with the search bar and inventory grid below
   it. Two insets stand in the way: bootstrap's .col-xs-12 padding on
   #vlp-promotions, and this component's own horizontal padding. The page content
   edge comes from bootstrap row negative margins, so both have to go.

   Scoped to #vlp-container, which only the VLP view renders — VDP has no such
   wrapper and its far narrower column keeps its inset. */
#vlp-container #vlp-promotions {
    padding-left: 0;
    padding-right: 0;
}
#vlp-container .pm-invib-section {
    padding-left: 0;
    padding-right: 0;
}
