/* ==========================================================================
   Ønskeliste-sidebar (udfoldes fra højre) - bygges af assets/js/wishlist.js
   Indlæses på alle sider via header.php
   ========================================================================== */

.kvwd {
    --kvwd-accent: #0077b6;
    --kvwd-accent-strong: #005f92;
    --kvwd-ink: #18283a;
    --kvwd-muted: #627385;
    --kvwd-line: #e2e8ee;
    --kvwd-hover: #f2f6f9;

    position: fixed;
    inset: 0;
    z-index: 1080;
}

.kvwd[hidden] {
    display: none;
}

.kvwd-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 22, 36, .5);
    opacity: 0;
    transition: opacity .25s ease;
}

.kvwd-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(420px, 100%);
    background: #fff;
    color: var(--kvwd-ink);
    box-shadow: -12px 0 40px rgba(9, 22, 36, .2);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.kvwd.is-open .kvwd-backdrop {
    opacity: 1;
}

.kvwd.is-open .kvwd-panel {
    transform: translateX(0);
}

.kvwd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 16px 22px;
    border-bottom: 1px solid var(--kvwd-line);
}

.kvwd-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.kvwd-count {
    font-weight: 400;
    color: var(--kvwd-muted);
}

.kvwd-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--kvwd-ink);
    cursor: pointer;
    transition: background-color .15s;
}

.kvwd-close:hover {
    background: var(--kvwd-hover);
}

.kvwd-close:focus-visible,
.kvwd-panel button:focus-visible,
.kvwd-panel a:focus-visible {
    outline: 2px solid var(--kvwd-accent);
    outline-offset: 2px;
}

.kvwd-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 22px;
}

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

.kvwd-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--kvwd-line);
}

.kvwd-item:last-child {
    border-bottom: 0;
}

.kvwd-img {
    display: block;
    aspect-ratio: 1 / 1;
    padding: 6px;
    border: 1px solid #eef2f5;
    border-radius: 10px;
    background: #fff;
}

.kvwd-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kvwd-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kvwd-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--kvwd-ink);
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kvwd-name:hover {
    color: var(--kvwd-accent-strong);
}

.kvwd-price {
    font-size: .88rem;
    font-weight: 700;
    white-space: pre-wrap;
}

.kvwd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.kvwd-qty {
    display: inline-flex;
    align-items: center;
    height: 34px;
    border: 1px solid var(--kvwd-line);
    border-radius: 10px;
    overflow: hidden;
}

.kvwd-qty button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--kvwd-ink);
    cursor: pointer;
}

.kvwd-qty button:hover:not(:disabled) {
    background: var(--kvwd-hover);
}

.kvwd-qty button:disabled {
    color: #c3ccd5;
    cursor: default;
}

.kvwd-qty-val {
    min-width: 30px;
    text-align: center;
    font-size: .9rem;
    font-weight: 600;
}

.kvwd-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--kvwd-muted);
    cursor: pointer;
}

.kvwd-remove:hover {
    background: #fdecec;
    color: #d93a2b;
}

.kvwd-foot {
    display: grid;
    gap: 10px;
    padding: 18px 22px calc(18px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--kvwd-line);
    background: #fafbfc;
}

.kvwd-foot[hidden] {
    display: none;
}

.kvwd-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: .95rem;
}

.kvwd-total strong {
    font-size: 1.25rem;
}

.kvwd-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 18px;
    border-radius: 12px;
    background: var(--kvwd-accent);
    color: #fff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s;
}

.kvwd-primary:hover {
    background: var(--kvwd-accent-strong);
    color: #fff;
}

.kvwd-secondary {
    min-height: 44px;
    border: 1px solid var(--kvwd-line);
    border-radius: 12px;
    background: #fff;
    color: var(--kvwd-ink);
    font-weight: 600;
    cursor: pointer;
}

.kvwd-secondary:hover {
    border-color: var(--kvwd-accent);
    color: var(--kvwd-accent);
}

.kvwd-empty,
.kvwd-loading {
    padding: 48px 8px;
    text-align: center;
    color: var(--kvwd-muted);
}

.kvwd-empty-icon {
    display: inline-flex;
    color: #b9c6d2;
}

.kvwd-empty-title {
    margin: 12px 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--kvwd-ink);
}

.kvwd-empty .kvwd-primary {
    display: inline-flex;
    margin-top: 14px;
}

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

@media (prefers-reduced-motion: reduce) {
    .kvwd-backdrop,
    .kvwd-panel {
        transition: none;
    }
}
