/* ============================================================
   Kenzol Kentekencheck — frontend styling
   Strategy: scope everything under .kenzol-kc with a CSS reset
   so theme styles don't bleed in. Keep specificity simple and
   consistent. Use !important sparingly, only where themes are
   notorious for overrides (buttons, headings, list items).
   ============================================================ */


/* ---------- 1. CSS Reset within the widget ---------- */

.kenzol-kc,
.kenzol-kc *,
.kenzol-kc *::before,
.kenzol-kc *::after {
    box-sizing: border-box;
}

.kenzol-kc {
    /* Tokens */
    --kc-text:        #1a1a1a;
    --kc-text-muted:  #6b6b6b;
    --kc-border:      #e5e5e5;
    --kc-bg:          #ffffff;
    --kc-bg-soft:     #f5f5f5;
    --kc-bg-chip:     #ececec;
    --kc-primary:     #e30613;
    --kc-cta:         #f59100;
    --kc-cta-hover:   #d97f00;
    --kc-success:     #2ea043;
    --kc-success-soft:#eaf7ed;
    --kc-badge:       #e89525;
    --kc-radius:      14px;
    --kc-radius-sm:   8px;

    max-width: 880px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--kc-text);
    text-align: left;
}

/* Reset common theme styling for elements inside the widget */
.kenzol-kc h1,
.kenzol-kc h2,
.kenzol-kc h3,
.kenzol-kc h4,
.kenzol-kc h5,
.kenzol-kc h6 {
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.3;
    color: var(--kc-text);
    text-transform: none;
    letter-spacing: normal;
}

.kenzol-kc p,
.kenzol-kc span,
.kenzol-kc small,
.kenzol-kc strong,
.kenzol-kc div,
.kenzol-kc a,
.kenzol-kc label {
    color: inherit;
    text-transform: none;
    letter-spacing: normal;
    line-height: inherit;
    font-family: inherit;
}

.kenzol-kc p {
    margin: 0;
    padding: 0;
}

.kenzol-kc a {
    text-decoration: none;
    color: inherit;
}

.kenzol-kc ul,
.kenzol-kc ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kenzol-kc li {
    margin: 0;
    padding: 0;
}

.kenzol-kc button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.kenzol-kc input,
.kenzol-kc select,
.kenzol-kc textarea {
    font-family: inherit;
    font-size: inherit;
    color: var(--kc-text);
    margin: 0;
    box-shadow: none;
}


/* ---------- 2. Card container ---------- */

.kenzol-kc__card {
    background: var(--kc-bg);
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius);
    padding: 1.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.kenzol-kc__card[hidden] {
    display: none;
}

.kenzol-kc__card + .kenzol-kc__card {
    margin-top: 1rem;
}


/* ---------- 3. Search header ---------- */

.kenzol-kc__search-header {
    margin-bottom: 1.25rem;
}

.kenzol-kc__title {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--kc-text) !important;
}

.kenzol-kc__subtitle {
    color: var(--kc-text-muted) !important;
    font-size: 0.95rem;
}


/* ---------- 4. Kenteken form ---------- */

.kenzol-kc__form--plate {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.kenzol-kc__plate {
    flex: 1 1 280px;
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, #ffd200 0%, #f5c500 100%);
    border: 2px solid #1a1a1a;
    border-radius: var(--kc-radius-sm);
    overflow: hidden;
    height: 60px;
}

.kenzol-kc__plate-flag {
    flex: 0 0 40px;
    background: #003399;
    color: #ffd200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    gap: 4px;
}

.kenzol-kc__plate-stars {
    font-size: 0.55rem;
}

.kenzol-kc__plate-input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0 1rem;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    color: #1a1a1a;
    outline: none;
    height: 100%;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

.kenzol-kc__plate-input::placeholder {
    color: rgba(26, 26, 26, 0.35);
}


/* ---------- 5. Manual selection form ---------- */

.kenzol-kc__form--manual {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kenzol-kc__select-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.kenzol-kc__select-wrap {
    display: flex;
    align-items: center;
    background: var(--kc-bg);
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius-sm);
    overflow: hidden;
    height: 50px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.kenzol-kc__select-wrap.is-active {
    background: var(--kc-success-soft);
    border-color: var(--kc-success);
}

.kenzol-kc__step-num {
    flex: 0 0 32px;
    text-align: center;
    color: var(--kc-text-muted);
    font-weight: 600;
    line-height: 48px;
    border-right: 1px solid var(--kc-border);
}

.kenzol-kc__select-wrap.is-completed .kenzol-kc__step-num {
    display: none;
}

.kenzol-kc__select-check {
    flex: 0 0 32px;
    text-align: center;
    color: var(--kc-success);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 48px;
    border-right: 1px solid var(--kc-border);
    display: none;
}

.kenzol-kc__select-wrap.is-completed .kenzol-kc__select-check {
    display: block;
}

.kenzol-kc__select {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0 2.5rem 0 0.875rem;
    font-size: 0.95rem;
    color: var(--kc-text);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    outline: none;
    height: 48px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 10px 7px;
}

.kenzol-kc__select:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


/* ---------- 6. Buttons ---------- */

/* All button styling is consolidated here so theme overrides
   only need to be neutralized once. !important is used because
   themes typically have very specific button selectors. */

.kenzol-kc__btn,
.kenzol-kc__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0 !important;
    border-radius: var(--kc-radius-sm) !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    box-shadow: none !important;
}

.kenzol-kc__btn[disabled],
.kenzol-kc__cta[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Dark "Zoek" button (plate form) */
.kenzol-kc__btn--dark {
    background: #1a1a1a !important;
    color: #ffffff !important;
    min-width: 110px;
    height: 60px;
    padding: 0 1.5rem;
    font-size: 1rem !important;
}

.kenzol-kc__btn--dark:hover {
    background: #2c2c2a !important;
    color: #ffffff !important;
}

.kenzol-kc__btn-arrow {
    font-size: 1.2rem;
    line-height: 1;
    font-weight: 400;
}

/* Primary red "Zoek mijn olie" button (manual form) */
.kenzol-kc__btn--manual-submit {
    background: var(--kc-primary) !important;
    color: #ffffff !important;
    height: 50px;
    padding: 0 1.5rem;
    font-size: 0.95rem !important;
    align-self: flex-start;
}

.kenzol-kc__btn--manual-submit:hover:not([disabled]) {
    filter: brightness(0.92);
    color: #ffffff !important;
}

/* Secondary buttons (reset / other actions) */
.kenzol-kc__btn--secondary {
    background: var(--kc-bg-soft) !important;
    color: var(--kc-text) !important;
    height: 42px;
    padding: 0 1.25rem;
    font-size: 0.875rem !important;
}

.kenzol-kc__btn--secondary:hover {
    background: #ededed !important;
}

.kenzol-kc__btn--ghost {
    background: transparent !important;
    color: var(--kc-text-muted) !important;
    text-decoration: underline !important;
    padding: 0.25rem 0.5rem;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

/* Orange "Bekijk product" CTA */
.kenzol-kc__cta {
    background: var(--kc-cta) !important;
    color: #ffffff !important;
    padding: 10px 16px !important;
    font-size: 0.875rem !important;
    width: 100%;
}

.kenzol-kc__cta:hover {
    background: var(--kc-cta-hover) !important;
    color: #ffffff !important;
}

.kenzol-kc__cta svg {
    width: 14px;
    height: 14px;
}

/* Spinner inside buttons */
.kenzol-kc__btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: kc-spin 0.6s linear infinite;
}

.kenzol-kc.is-loading .kenzol-kc__btn-spinner {
    display: inline-block;
}

.kenzol-kc.is-loading .kenzol-kc__btn-text {
    opacity: 0.6;
}

@keyframes kc-spin {
    to { transform: rotate(360deg); }
}


/* ---------- 7. Vehicle summary ---------- */

.kenzol-kc__vehicle {
    background: var(--kc-bg-soft);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.kenzol-kc__vehicle-info strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--kc-text) !important;
    margin-bottom: 2px;
}

.kenzol-kc__vehicle-info small {
    font-size: 0.85rem;
    color: var(--kc-text-muted) !important;
}


/* ---------- 8. Recommended specs callout ---------- */

.kenzol-kc__specs {
    background: var(--kc-success-soft);
    border-left: 3px solid var(--kc-success);
    padding: 0.875rem 1.125rem;
    border-radius: 0 var(--kc-radius-sm) var(--kc-radius-sm) 0;
    margin-bottom: 1.25rem;
}

.kenzol-kc__specs-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--kc-text) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.kenzol-kc__specs-value {
    font-size: 0.9rem;
    color: var(--kc-text) !important;
    font-weight: 500;
    word-break: break-word;
}


/* ---------- 9. Product card ---------- */

.kenzol-kc__products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.kenzol-kc__product {
    position: relative;
    display: grid;
    grid-template-columns: 120px 1fr 200px;
    gap: 1.5rem;
    align-items: stretch;
    background: var(--kc-bg);
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius);
    padding: 1.25rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kenzol-kc__product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.12);
}

.kenzol-kc__product--best {
    border-color: #2c2c2a;
    border-width: 1.5px;
}

/* Best match badge */
.kenzol-kc__badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--kc-badge);
    color: #3d2400;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Product image column */
.kenzol-kc__product-image-wrap {
    background: linear-gradient(180deg, #fafaf8, #f0f0ec);
    border-radius: 10px;
    padding: 12px;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kenzol-kc__product-image {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.kenzol-kc__product-image-placeholder {
    width: 56px;
    height: 76px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.25);
    font-size: 1.4rem;
}

/* Product body column */
.kenzol-kc__product-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.kenzol-kc__product-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--kc-text) !important;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.kenzol-kc__product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--kc-text-muted) !important;
    margin-bottom: 0.75rem;
}

.kenzol-kc__product-rating span {
    color: var(--kc-text-muted) !important;
}

.kenzol-kc__stars {
    color: #f59100 !important;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

/* Specs chips
   !important is needed here because Salient and similar themes
   apply color rules with !important on generic span selectors. */
.kenzol-kc__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.kenzol-kc__chip {
    display: inline-block;
    background: var(--kc-bg-chip) !important;
    color: var(--kc-text) !important;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.kenzol-kc__chip--primary {
    background: var(--kc-text) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.kenzol-kc__chip--more {
    background: var(--kc-bg-soft) !important;
    color: var(--kc-text-muted) !important;
    cursor: pointer;
    border: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.kenzol-kc__chip--more:hover {
    background: #ededed !important;
    color: var(--kc-text) !important;
}

.kenzol-kc__chip--hidden {
    display: none;
}

.kenzol-kc__chips.is-expanded .kenzol-kc__chip--hidden {
    display: inline-block;
}

/* Stock indicator */
.kenzol-kc__stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--kc-success) !important;
}

.kenzol-kc__stock::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kc-success);
}

/* Product aside (price + CTA) */
.kenzol-kc__product-aside {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    text-align: right;
    border-left: 1px solid var(--kc-border);
    padding-left: 1.25rem;
}

.kenzol-kc__price-old {
    font-size: 0.75rem;
    color: #999 !important;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.kenzol-kc__price {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--kc-text) !important;
    line-height: 1;
    letter-spacing: -0.02em;
}

.kenzol-kc__price small {
    font-size: 0.6em;
    font-weight: 700;
    vertical-align: super;
    color: var(--kc-text) !important;
}

.kenzol-kc__price-vat {
    font-size: 0.7rem;
    color: var(--kc-text-muted) !important;
    margin-top: 4px;
}


/* ---------- 10. Contact / fallback form ---------- */

.kenzol-kc__contact-form {
    display: grid;
    gap: 0.875rem;
}

.kenzol-kc__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.kenzol-kc__field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--kc-text);
}

.kenzol-kc__field input,
.kenzol-kc__field textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--kc-border);
    border-radius: var(--kc-radius-sm);
    background: var(--kc-bg);
    font-size: 0.95rem;
    color: var(--kc-text);
    transition: border-color 0.15s ease;
}

.kenzol-kc__field input:focus,
.kenzol-kc__field textarea:focus {
    outline: none;
    border-color: var(--kc-primary);
}


/* ---------- 11. Notices ---------- */

.kenzol-kc__error {
    background: #fde8e8;
    color: #b00020;
    padding: 0.75rem 1rem;
    border-radius: var(--kc-radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.kenzol-kc__success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--kc-success);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.kenzol-kc__disclaimer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--kc-text-muted);
    line-height: 1.5;
    margin-top: 1rem;
}

.kenzol-kc__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.25rem;
}

.kenzol-kc__actions--split {
    justify-content: space-between;
}


/* ============================================================
   Mobile (<= 700px) — vertical card layout
   ============================================================ */

@media (max-width: 700px) {
    .kenzol-kc {
        margin: 1rem 0;
    }

    .kenzol-kc__card {
        padding: 1.25rem 1rem;
        border-radius: 12px;
    }

    .kenzol-kc__title {
        font-size: 1.2rem;
    }

    /* Plate form stacks vertically */
    .kenzol-kc__form--plate {
        flex-direction: column;
        gap: 0.6rem;
    }
    .kenzol-kc__btn--dark {
        width: 100%;
    }

    /* Manual selection dropdowns stack vertically */
    .kenzol-kc__select-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .kenzol-kc__btn--manual-submit {
        width: 100%;
    }

    /* Product card: single column with image on top */
    .kenzol-kc__product {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        padding-top: 1.5rem;
    }

    .kenzol-kc__product-image-wrap {
        min-height: 130px;
        max-height: 170px;
    }

    .kenzol-kc__product-image {
        max-height: 140px;
    }

    /* Reserve room for the badge */
    .kenzol-kc__product-name {
        font-size: 1.05rem;
        padding-right: 90px;
    }

    .kenzol-kc__badge {
        top: 12px;
        right: 12px;
        font-size: 0.65rem;
        padding: 4px 9px;
    }

    /* Price + CTA horizontal row at bottom */
    .kenzol-kc__product-aside {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        border-left: 0;
        border-top: 1px solid var(--kc-border);
        padding: 0.875rem 0 0;
        gap: 12px;
    }

    .kenzol-kc__product-aside > div:first-child {
        flex: 0 0 auto;
    }

    .kenzol-kc__cta {
        width: auto;
        white-space: nowrap;
    }

    .kenzol-kc__price {
        font-size: 1.5rem;
    }
}

/* Very narrow mobile */
@media (max-width: 380px) {
    .kenzol-kc__product-name {
        padding-right: 80px;
        font-size: 1rem;
    }
    .kenzol-kc__chip {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    .kenzol-kc__price {
        font-size: 1.35rem;
    }
    .kenzol-kc__cta {
        padding: 9px 12px !important;
        font-size: 0.8rem !important;
    }
}


/* ============================================================
   Compact widget (hero placement)
   ============================================================ */

.kenzol-kc-compact {
    --kc-primary: #e30613;
    max-width: 480px;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.kenzol-kc-compact *,
.kenzol-kc-compact *::before,
.kenzol-kc-compact *::after {
    box-sizing: border-box;
}

.kenzol-kc-compact__form {
    margin: 0;
}

.kenzol-kc-compact__plate {
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, #ffd200 0%, #f5c500 100%);
    border: 2px solid #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    height: 64px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.kenzol-kc-compact__plate-flag {
    flex: 0 0 44px;
    background: #003399;
    color: #ffd200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    gap: 4px;
}

.kenzol-kc-compact__plate-stars {
    font-size: 0.6rem;
}

.kenzol-kc-compact__plate-input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0 1rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    color: #1a1a1a;
    outline: none;
    height: 100%;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

.kenzol-kc-compact__plate-input::placeholder {
    color: rgba(26, 26, 26, 0.35);
}

.kenzol-kc-compact__submit {
    flex: 0 0 56px;
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.kenzol-kc-compact__submit:hover {
    background: #2c2c2a !important;
}

.kenzol-kc-compact__submit svg {
    width: 24px;
    height: 24px;
}

.kenzol-kc-compact__manual-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.95rem;
    color: #ffffff;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.kenzol-kc-compact--dark-text .kenzol-kc-compact__manual-link {
    color: #1a1a1a;
}

@media (max-width: 480px) {
    .kenzol-kc-compact__plate-input {
        font-size: 1.25rem;
    }
    .kenzol-kc-compact__plate-flag {
        flex-basis: 38px;
    }
    .kenzol-kc-compact__submit {
        flex-basis: 48px;
    }
}