/**
 * Auto Overzicht Plugin — Frontend Styles
 * Design: Werkplaats aesthetic (Wim Quist / Dieter Rams)
 */

/* ============================
   Fonts
   ============================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* ============================
   Design Tokens
   ============================ */
:root {
    --aop-bg:          #F5F5F5;  /* Werkplaats Grijs */
    --aop-text:        #1E1E1E;  /* Motor Olie Zwart */
    --aop-border:      #DCDCDC;  /* Staal Lijn */
    --aop-accent:      #d70a0d;
    --aop-accent-hover:#b00809;
    --aop-white:       #FFFFFF;
    --aop-modal-bg:    rgba(30, 30, 30, 0.80);
    --aop-font-body:   'DM Sans', sans-serif;
    --aop-gap:         24px;
    --aop-radius:      2px;
}

/* Force DM Sans everywhere */
.aop-filters,
.aop-filters label,
.aop-filters select,
.aop-card,
.aop-card__title,
.aop-card__price,
.aop-card__specs,
.aop-card__btn,
.aop-modal__title,
.aop-modal__row dt,
.aop-modal__row dd,
.aop-modal__description,
.aop-contact__heading,
.aop-contact__sub,
.aop-contact__input,
.aop-geen-resultaten {
    font-family: 'DM Sans', sans-serif !important;
}

/* ============================
   Filters
   ============================ */
.aop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: var(--aop-gap);
    font-family: var(--aop-font-body);
    font-size: 14px;
    color: var(--aop-text);
}

.aop-filters label {
    font-weight: 500;
    margin-right: 4px;
}

.aop-filters select {
    font-family: var(--aop-font-mono);
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid var(--aop-border);
    border-radius: var(--aop-radius);
    background: var(--aop-white);
    color: var(--aop-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231E1E1E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* ============================
   Grid
   ============================ */
.aop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--aop-gap);
}

@media (max-width: 1024px) {
    .aop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .aop-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================
   Card
   ============================ */
.aop-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--aop-border);
    background: var(--aop-white);
    border-radius: var(--aop-radius);
    overflow: hidden;
    font-family: var(--aop-font-body);
    color: var(--aop-text);
}

.aop-card__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--aop-bg);
}

.aop-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aop-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--aop-font-mono);
    font-size: 13px;
    color: var(--aop-border);
}

.aop-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.aop-card__title {
    font-family: var(--aop-font-mono);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.aop-card__divider,
.aop-modal__divider {
    height: 1px;
    background: var(--aop-border);
    margin: 0 0 12px 0;
}

.aop-card__price {
    font-family: var(--aop-font-mono);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.aop-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-family: var(--aop-font-mono);
    font-size: 13px;
    color: var(--aop-text);
    opacity: 0.7;
    margin-bottom: 16px;
}

.aop-card__btn {
    margin-top: auto;
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-family: var(--aop-font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--aop-white);
    background: var(--aop-accent);
    border: none;
    border-radius: var(--aop-radius);
    cursor: pointer;
    transition: background 0.15s ease;
    letter-spacing: 0.02em;
}

.aop-card__btn:hover {
    background: var(--aop-accent-hover);
}

/* ============================
   Modal
   ============================ */
.aop-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.aop-modal[aria-hidden="false"] {
    display: flex;
}

.aop-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--aop-modal-bg);
}

.aop-modal__content {
    position: relative;
    z-index: 1;
    background: var(--aop-white);
    border-radius: var(--aop-radius);
    max-width: 720px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--aop-border);
}

.aop-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--aop-white);
    border: 1px solid var(--aop-border);
    border-radius: var(--aop-radius);
    cursor: pointer;
    color: var(--aop-text);
    line-height: 1;
}

.aop-modal__close:hover {
    background: var(--aop-bg);
}

.aop-modal__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--aop-bg);
}

.aop-modal__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aop-modal__details {
    padding: 28px;
}

.aop-modal__title {
    font-family: var(--aop-font-mono);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
    color: var(--aop-text);
}

.aop-modal__data {
    margin: 0;
    padding: 0;
}

.aop-modal__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--aop-bg);
}

.aop-modal__row:last-child {
    border-bottom: none;
}

.aop-modal__row dt {
    font-family: var(--aop-font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--aop-text);
    opacity: 0.6;
}

.aop-modal__row dd {
    font-family: var(--aop-font-mono);
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: var(--aop-text);
}

.aop-modal__description {
    font-family: var(--aop-font-body);
    font-size: 15px;
    line-height: 1.65;
    color: var(--aop-text);
    opacity: 0.85;
    margin-top: 8px;
}

/* Staggered animation */
.aop-modal__content .aop-modal__image {
    opacity: 0;
    animation: aop-fadein 0.2s ease forwards;
    animation-delay: 0ms;
}

.aop-modal__content .aop-modal__title {
    opacity: 0;
    animation: aop-fadein 0.2s ease forwards;
    animation-delay: 0ms;
}

.aop-modal__content .aop-modal__data {
    opacity: 0;
    animation: aop-fadein 0.2s ease forwards;
    animation-delay: 100ms;
}

.aop-modal__content .aop-modal__description {
    opacity: 0;
    animation: aop-fadein 0.2s ease forwards;
    animation-delay: 200ms;
}

@keyframes aop-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================
   No results
   ============================ */
.aop-geen-resultaten {
    font-family: var(--aop-font-body);
    font-size: 16px;
    color: var(--aop-text);
    opacity: 0.5;
    text-align: center;
    padding: 60px 20px;
}

/* ============================
   Contact Form
   ============================ */
.aop-contact__heading {
    font-family: var(--aop-font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--aop-text);
    margin: 16px 0 12px 0;
}

.aop-contact__sub {
    font-family: var(--aop-font-body);
    font-size: 14px;
    color: var(--aop-text);
    opacity: 0.6;
    margin: 4px 0 0 0;
}

.aop-contact__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aop-contact__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 500px) {
    .aop-contact__row {
        grid-template-columns: 1fr;
    }
}

.aop-contact__input {
    font-family: var(--aop-font-body);
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid var(--aop-border);
    border-radius: var(--aop-radius);
    background: var(--aop-bg);
    color: var(--aop-text);
    width: 100%;
    box-sizing: border-box;
}

.aop-contact__input:focus {
    outline: none;
    border-color: var(--aop-accent);
}

.aop-contact__textarea {
    resize: none;
}

.aop-contact__success {
    text-align: center;
    padding: 24px 0;
}

.aop-modal__contact {
    opacity: 0;
    animation: aop-fadein 0.2s ease forwards;
    animation-delay: 300ms;
}
