/**
 * AW Loop Variation Popup — modal styling.
 * Accentkleur komt als --awcf-vp-accent uit de module-instelling
 * (inline style vanuit functions.php, default #00b1cf).
 */

html.awcf-vp-lock,
html.awcf-vp-lock body {
    overflow: hidden;
}

.awcf-vp-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
}

.awcf-vp-overlay.is-open {
    display: flex;
}

.awcf-vp-dialog {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    -webkit-overflow-scrolling: touch;
}

/* Kop */
.awcf-vp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.awcf-vp-head__kicker {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.awcf-vp-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #efeae3;
    color: #333;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.awcf-vp-close:hover {
    background: #e2dbd1;
}

/* Productkop: afbeelding + titel + prijs */
.awcf-vp-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.awcf-vp-product__image img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    background: #f7f7f7;
    display: block;
}

.awcf-vp-product__title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

.awcf-vp-product__price {
    font-size: 14px;
    color: #444;
}

.awcf-vp-product__price del {
    opacity: 0.6;
    margin-right: 6px;
}

/* Formulier */
.awcf-vp-body table.variations {
    width: 100%;
    border: 0;
    margin: 0 0 8px;
}

.awcf-vp-body table.variations th,
.awcf-vp-body table.variations td {
    border: 0;
    padding: 6px 0;
    background: none;
    vertical-align: middle;
}

.awcf-vp-body table.variations th.label {
    font-weight: 600;
    font-size: 14px;
    color: #222;
    padding-right: 12px;
    white-space: nowrap;
}

.awcf-vp-body table.variations select {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
}

.awcf-vp-body .reset_variations {
    font-size: 12px;
    color: #888;
}

.awcf-vp-body .woocommerce-variation-price {
    margin: 8px 0;
    font-size: 17px;
    font-weight: 700;
    color: #222;
}

.awcf-vp-body .woocommerce-variation-availability {
    font-size: 13px;
    margin-bottom: 8px;
}

/* Aantal + knop */
.awcf-vp-body .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 12px;
}

.awcf-vp-body .quantity {
    flex: 0 0 auto;
}

.awcf-vp-body .quantity .qty {
    width: 70px;
    height: 100%;
    min-height: 46px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-align: center;
    font-size: 15px;
}

.awcf-vp-body .single_add_to_cart_button {
    flex: 1 1 auto;
    border: 0;
    border-radius: 10px;
    background: var(--awcf-vp-accent, #00b1cf);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 18px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.awcf-vp-body .single_add_to_cart_button:hover {
    filter: brightness(0.92);
}

.awcf-vp-body .single_add_to_cart_button.disabled,
.awcf-vp-body .single_add_to_cart_button.wc-variation-selection-needed {
    opacity: 0.5;
    cursor: not-allowed;
}

.awcf-vp-body .single_add_to_cart_button.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Laden / fouten */
.awcf-vp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 0;
    color: #666;
    font-size: 14px;
}

.awcf-vp-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #eee;
    border-top-color: var(--awcf-vp-accent, #00b1cf);
    border-radius: 50%;
    animation: awcf-vp-spin 0.8s linear infinite;
}

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

.awcf-vp-error {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fdecea;
    color: #b71c1c;
    font-size: 13px;
}

/* Succes-scherm */
.awcf-vp-success {
    text-align: center;
    padding: 12px 0 4px;
}

.awcf-vp-success__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--awcf-vp-accent, #00b1cf);
}

.awcf-vp-success__text {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.awcf-vp-success__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* !important op de kleuren: thema-link-styling (groene <a>) mag de
   knoptekst in de modal niet overschrijven. */
.awcf-vp-btn {
    display: inline-block;
    border: 0;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    background: var(--awcf-vp-accent, #00b1cf);
    color: #fff !important;
}

.awcf-vp-btn:hover,
.awcf-vp-btn:focus,
.awcf-vp-btn:visited {
    filter: brightness(0.92);
    color: #fff !important;
}

.awcf-vp-btn--ghost,
.awcf-vp-btn--ghost:hover,
.awcf-vp-btn--ghost:focus,
.awcf-vp-btn--ghost:visited {
    background: #efeae3;
    color: #333 !important;
}

.awcf-vp-btn--ghost:hover {
    background: #e2dbd1;
    filter: none;
}

/* Mobiel: bottom-sheet */
@media (max-width: 600px) {
    .awcf-vp-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .awcf-vp-dialog {
        max-width: none;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    }
}
