/**
 * Tilbudsliste – design efter Figma (Østergaard Interiéur).
 * Farverne kan overskrives med CSS-variabler på :root.
 */

:root {
    --webko-ink: #212121;
    --webko-bg: #f6f2eb;
    --webko-line: rgba(33, 33, 33, .1);
    --webko-white: #fff;
    --webko-error: #b3261e;
}

/* -------------------------------------------------------------------------
 * Count
 * ---------------------------------------------------------------------- */

span[data-webko-list-count] {
    font-size: 10px;
    color: #F6F2EB;
    background: #BE745C;
    width: 18px;
    height: 18px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-left: 5px;
    line-height: 100%;
}

span[data-webko-list-count]:empty {
    display: none;
}


/* -------------------------------------------------------------------------
 * Knapper
 * ---------------------------------------------------------------------- */

.webko-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 22px;
    border: 1px solid var(--webko-ink);
    border-radius: 0;
    background: transparent;
    color: var(--webko-ink);
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.webko-button:hover,
.webko-button--dark {
    background: var(--webko-ink);
    color: var(--webko-bg);
}

.webko-button--dark:hover {
    background: transparent;
    color: var(--webko-ink);
}

.webko-button--small {
    gap: 6px;
    padding: 5px 12px;
    font-size: 13px;
}

.webko-button--block {
    display: flex;
    width: 100%;
}

.webko-button[disabled] {
    opacity: .3;
    cursor: not-allowed;
}

.webko-button[disabled]:hover {
    background: transparent;
    color: var(--webko-ink);
}

.webko-button--dark[disabled]:hover {
    background: var(--webko-ink);
    color: var(--webko-bg);
}

.webko-button__arrow {
    width: 16px;
    height: 7px;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url(../images/arrow-right.svg) no-repeat center / contain;
    mask: url(../images/arrow-right.svg) no-repeat center / contain;
    display: none;
}

.webko-button--small .webko-button__arrow {
    width: 13px;
}

/* Produktsiden: knappen ligger på sin egen linje under "Læg i kurv". */
.webko-button.add-to-list {
    display: flex;
    width: 100%;
    margin-top: 10px;
}

.webko-button.add-to-list.is-disabled {
    opacity: .4;
    pointer-events: none;
}

/* -------------------------------------------------------------------------
 * Link med antal
 * ---------------------------------------------------------------------- */

.webko-list-link {
    color: inherit;
    text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Siden
 * ---------------------------------------------------------------------- */

.webko-list {
    color: var(--webko-ink);
}

.webko-list__table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Tom liste */

.webko-empty {
    display: flex;
    flex-direction: column;
    padding: 40px 40px;
    border: 1px solid var(--webko-line);
}

.webko-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 30px;
    border: 1px solid var(--webko-ink);
    display: none;
}

.webko-empty__icon svg {
    width: 24px;
    height: 24px;
    fill: var(--webko-ink);
}

.webko-empty__title {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.webko-empty__text {
    max-width: 420px;
    margin: 0 0 40px;
    font-size: 16px;
    line-height: 1.6;
    opacity: .7;
}

.webko-empty__steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 420px;
    margin: 0 0 40px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.webko-empty__steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--webko-line);
    font-size: 15px;
    line-height: 1.4;
}

.webko-empty__steps li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.webko-empty__step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background: var(--webko-ink);
    color: var(--webko-bg);
    font-size: 13px;
    font-weight: 500;
    border-radius: 100px;
}

.webko-empty__requirements {
    margin: 24px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.webko-list__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.webko-list__actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* -------------------------------------------------------------------------
 * Varelinjer
 * ---------------------------------------------------------------------- */

.webko-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 25px 10px 20px;
    border: 1px solid var(--webko-line);
}

.webko-row__select {
    display: flex;
    flex-shrink: 0;
}

.webko-row__checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1px solid var(--webko-ink);
    border-radius: 0;
    background: var(--webko-bg);
    cursor: pointer;
}

.webko-row__checkbox:checked {
    background: var(--webko-ink) url(../images/input-check.svg) no-repeat center / 12px;
}

.webko-row__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 78px;
    flex-shrink: 0;
    padding: 5px;
    box-sizing: border-box;
    background: var(--webko-white);
}

.webko-row__image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.webko-row__info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.webko-row__name {
    color: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.3;
    text-decoration: none;
}

.webko-row__sku {
    font-size: 13px;
    line-height: 1.5;
}

.webko-row__addons {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    opacity: .6;
}

.webko-row__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 120px;
    text-align: right;
}

.webko-row__price-current {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.webko-row__price-before {
    font-size: 10px;
    line-height: 1.5;
    opacity: .5;
    text-decoration: line-through;
}

.webko-row__buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Antal */

.webko-qty {
    display: flex;
    align-items: center;
    width: 98px;
    height: 48px;
    flex-shrink: 0;
    border: 1px solid var(--webko-ink);
}

.webko-qty__button {
    width: 35px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--webko-ink);
    font-size: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.webko-qty__button::after {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    margin: 0 auto;
    background-color: currentColor;
    -webkit-mask: url(../images/qty-minus.svg) no-repeat center / contain;
    mask: url(../images/qty-minus.svg) no-repeat center / contain;
}

.webko-qty__button--up::after {
    -webkit-mask-image: url(../images/qty-plus.svg);
    mask-image: url(../images/qty-plus.svg);
}

.webko-qty__input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--webko-ink);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
}

.webko-qty__input::-webkit-outer-spin-button,
.webko-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Ikonknapper */

.webko-icon-button {
    display: block;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background-color: var(--webko-ink);
    color: transparent;
    font-size: 0;
    cursor: pointer;
    -webkit-mask: url(../images/row-cart.svg) no-repeat center / contain;
    mask: url(../images/row-cart.svg) no-repeat center / contain;
    transition: opacity .15s ease;
}

.webko-icon-button:hover {
    opacity: .6;
}

.webko-icon-button--more {
    -webkit-mask-image: url(../images/row-more.svg);
    mask-image: url(../images/row-more.svg);
}

.webko-row__buttons .added_to_cart {
    display: none;
}

/* Menu (Rediger / række-menu) */

.webko-menu {
    position: relative;
}

.webko-menu__items {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    display: none;
    min-width: 165px;
    border: 1px solid var(--webko-ink);
    background: var(--webko-ink);
}

.webko-menu.is-open .webko-menu__items {
    display: block;
}

.webko-menu__item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: var(--webko-bg);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.webko-menu__item:hover {
    background: rgba(255, 255, 255, .1);
}

/* Total */

.webko-list__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.webko-list__total-label,
.webko-list__total-price {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.01em;
}

.webko-list__total-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.webko-list__hint {
    margin: 0;
    font-size: 13px;
    opacity: .6;
    text-align: right;
}

/* -------------------------------------------------------------------------
 * Popups
 * ---------------------------------------------------------------------- */

.webko-popup[hidden] {
    display: none !important;
}

.webko-popup {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(33, 33, 33, .6);
    opacity: 0;
    transition: opacity .25s ease;
}

.webko-popup.is-open {
    opacity: 1;
    pointer-events: auto;
}

.webko-popup__inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--webko-bg);
    color: var(--webko-ink);
    transform: translateY(40px);
    transition: transform .25s ease;
}

.webko-popup.is-open .webko-popup__inner {
    transform: translateY(0);
}

.webko-popup__inner.is-loading {
    cursor: wait;
}

.webko-popup__inner.is-loading * {
    pointer-events: none;
    opacity: .6;
}

.webko-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 25px;
    border-bottom: 1px solid var(--webko-line);
}

.webko-popup__title {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -.02em;
}

.webko-popup__close {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.webko-popup__content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 25px;
    overflow: auto;
}

.webko-popup__footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 25px;
    border-top: 1px solid var(--webko-line);
}

.webko-popup__error {
    color: var(--webko-error);
    font-size: 14px;
}

.webko-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.webko-field label {
    font-size: 13px;
}

.webko-field input,
.webko-field textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--webko-ink);
    border-radius: 0;
    background: var(--webko-white);
    color: var(--webko-ink);
    font: inherit;
    font-size: 16px;
}

.webko-field.has-error input,
.webko-field.has-error textarea {
    border-color: var(--webko-error);
}

.webko-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.webko-field-row--30-70 {
    grid-template-columns: 3fr 7fr;
}

.webko-field--checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.webko-field--checkbox input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 1px solid var(--webko-ink);
    background: var(--webko-white);
    cursor: pointer;
}

.webko-field--checkbox input:checked {
    background: var(--webko-ink) url(../images/input-check.svg) no-repeat center / 12px;
}

.webko-field--checkbox label {
    cursor: pointer;
}

.webko-field.has-error input[type="checkbox"] {
    border-color: var(--webko-error);
}

.webko-field__headline {
    display: block;
    font-size: 15px;
}

.webko-field__description {
    display: block;
    font-size: 12px;
    opacity: .6;
}

/* -------------------------------------------------------------------------
 * Mobil
 * ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .webko-row {
        flex-wrap: wrap;
        row-gap: 15px;
    }

    .webko-row__info {
        flex: 1 1 200px;
    }

    .webko-row__price {
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .webko-empty {
        padding: 50px 24px;
    }

    .webko-empty__title {
        font-size: 24px;
    }

    .webko-list__actions,
    .webko-list__actions-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .webko-list__actions .webko-button {
        width: 100%;
    }

    .webko-menu__items {
        right: 0;
        left: 0;
    }

    .webko-row__image {
        width: 64px;
        height: 64px;
    }

    .webko-row__info {
        flex-basis: 100%;
        order: 1;
    }

    .webko-qty {
        order: 2;
    }

    .webko-row__price {
        order: 3;
        margin-left: auto;
    }

    .webko-row__buttons {
        order: 4;
    }

    .webko-list__total {
        flex-direction: column;
        align-items: stretch;
    }

    .webko-list__total-right {
        justify-content: space-between;
    }

    .webko-field-row,
    .webko-field-row--30-70 {
        grid-template-columns: 1fr;
    }
}