/*
 * YZC Dashboard - Side cart
 *
 * De variabelen --yzc-sc-width, --yzc-sc-overlay en --yzc-sc-z worden door
 * includes/yzc-woocommerce-sidecart.php inline op .yzc-sidecart-root gezet uit
 * de instellingen; dit bestand blijft daardoor statisch en cachebaar.
 *
 * De afrekenknop krijgt zijn kleuren, randen, padding en typografie op runtime
 * van een onzichtbare proefknop (thema-knop of uk-button-variant), zodat hier
 * niets hardgecodeerd staat wat per shop verschilt.
 */

.yzc-sidecart-root {
    --yzc-sc-width: 430px;
    --yzc-sc-overlay: 0.45;
    --yzc-sc-z: 9999;
}

html.yzc-sidecart-open,
body.yzc-sidecart-open {
    overflow: hidden;
}

.yzc-sidecart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, var(--yzc-sc-overlay));
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: var(--yzc-sc-z);
}

.yzc-sidecart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.yzc-sidecart {
    position: fixed;
    top: 0;
    bottom: 0;
    width: var(--yzc-sc-width);
    max-width: 100vw;
    z-index: calc(var(--yzc-sc-z) + 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: #fff;
    color: #222;
    text-align: left;
    transition: transform .3s ease;
}

.yzc-sidecart--right {
    right: 0;
    transform: translateX(100%);
    box-shadow: -4px 0 20px rgba(0, 0, 0, .15);
}

.yzc-sidecart--left {
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, .15);
}

.yzc-sidecart.is-open {
    transform: translateX(0);
}

.yzc-sidecart *,
.yzc-sidecart *::before,
.yzc-sidecart *::after {
    box-sizing: border-box;
}

/* Kop */

.yzc-sidecart__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.yzc-sidecart__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    color: inherit;
}

.yzc-sidecart__close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.yzc-sidecart__close:hover,
.yzc-sidecart__close:focus-visible {
    background: #f1f1f1;
}

/* Gratis-verzendbalk */

.yzc-sidecart__shipping {
    flex: 0 0 auto;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.yzc-sidecart__shipping-text {
    display: block;
    margin-bottom: 8px;
}

.yzc-sidecart__shipping-track {
    height: 6px;
    border-radius: 3px;
    background: #ececec;
    overflow: hidden;
}

.yzc-sidecart__shipping-bar {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: currentColor;
    transition: width .3s ease;
}

/* Regels */

.yzc-sidecart__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4px 20px 10px;
    transition: opacity .15s ease;
}

.yzc-sidecart__body[aria-busy="true"] {
    opacity: .55;
}

.yzc-sidecart__status {
    margin: 0;
    padding: 24px 0;
    color: #777;
    font-size: 14px;
}

.yzc-sidecart__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.yzc-sidecart__item {
    position: relative;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    padding: 14px 34px 14px 0;
    border-bottom: 1px solid #eee;
}

.yzc-sidecart__thumb {
    display: block;
    width: 56px;
    height: auto;
    border-radius: 4px;
}

.yzc-sidecart__name {
    display: block;
    color: inherit;
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
}

.yzc-sidecart__meta {
    margin: 4px 0 0;
    color: #777;
    font-size: 12px;
    line-height: 1.4;
}

.yzc-sidecart__row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.yzc-sidecart__price {
    color: #777;
    font-size: 13px;
}

.yzc-sidecart__item-remove {
    position: absolute;
    top: 12px;
    right: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f1f1;
    color: #333;
    font-size: 20px;
    line-height: 26px;
    cursor: pointer;
}

.yzc-sidecart__item-remove:hover,
.yzc-sidecart__item-remove:focus-visible {
    background: #e4e4e4;
}

/* Aantal */

.yzc-sidecart__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.yzc-sidecart__qty-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.yzc-sidecart__qty-btn:hover:not(:disabled) {
    background: #ececec;
}

.yzc-sidecart__qty-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.yzc-sidecart__qty-num {
    min-width: 32px;
    text-align: center;
    font-size: 14px;
}

.yzc-sidecart__qty-fixed {
    font-size: 14px;
    color: #777;
}

/* Voet */

.yzc-sidecart__footer {
    flex: 0 0 auto;
    border-top: 1px solid #eee;
    padding: 14px 20px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

.yzc-sidecart__notices {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 4px;
    background: #fdf2f2;
    color: #8a1f1f;
    font-size: 13px;
    line-height: 1.4;
}

.yzc-sidecart__notices p {
    margin: 0 0 4px;
}

.yzc-sidecart__notices p:last-child {
    margin-bottom: 0;
}

.yzc-sidecart__totals {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
}

.yzc-sidecart__checkout {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    /* Vervangen door de gekopieerde stijl van de proefknop; dit is de vangnetlaag. */
    padding: 14px;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font-weight: 600;
}

.yzc-sidecart__checkout[aria-disabled="true"] {
    opacity: .5;
    pointer-events: none;
}

.yzc-sidecart__links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}

.yzc-sidecart__link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.yzc-sidecart__extra {
    margin-top: 12px;
    font-size: 13px;
    text-align: center;
}

.yzc-sidecart__extra p {
    margin: 0 0 6px;
}

.yzc-sidecart__extra p:last-child {
    margin-bottom: 0;
}

.yzc-sidecart__extra img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* De proefknop mag nooit in beeld komen. */
.yzc-sidecart-probe {
    position: absolute !important;
    left: -9999px !important;
    top: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 480px) {
    .yzc-sidecart {
        width: 100vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yzc-sidecart,
    .yzc-sidecart-overlay,
    .yzc-sidecart__shipping-bar,
    .yzc-sidecart__body {
        transition: none;
    }
}
