/* ==========================================================
   Wishlist Cart — market-tf.ru
   Matches site design: #F15A29 orange, #0f0f0f dark, #F7F7F7 bg
   Mobile-first responsive
   ========================================================== */

/* ---- Page header ---- */
.wishlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.wishlist-select-all-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f0f0f;
    cursor: pointer;
    user-select: none;
}

.wishlist-select-all-wrap input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid #CCCCCC;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.wishlist-select-all-wrap input[type="checkbox"]:checked {
    background-color: #F15A29;
    border-color: #F15A29;
}

.wishlist-select-all-wrap input[type="checkbox"]:checked::after {
    content: '\2713';
    color: white;
    font-size: 13px;
    line-height: 1;
}

/* ---- Product list ---- */
#wishlist-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 120px; /* space for sticky bar */
}

/* ---- Product card ---- */
.wl-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border-radius: 16px;
    padding: 12px;
    position: relative;
    transition: box-shadow 0.2s;
}

.wl-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* checkbox col */
.wl-card__check {
    flex-shrink: 0;
}

.wl-card__check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1.5px solid #CCCCCC;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.wl-card__check input[type="checkbox"]:checked {
    background-color: #F15A29;
    border-color: #F15A29;
}

.wl-card__check input[type="checkbox"]:checked::after {
    content: '\2713';
    color: white;
    font-size: 14px;
    line-height: 1;
}

/* image col */
.wl-card__img-wrap {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    background: #F7F7F7;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.wl-card__img-wrap img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    display: block;
}

/* info col */
.wl-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wl-card__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f0f0f;
    line-height: 1.3;
    text-decoration: none;
    display: block;
}

.wl-card__name:hover {
    color: #F15A29;
}

.wl-card__price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #F15A29;
}

/* size select */
.wl-card__size-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.wl-card__size {
    width: 100%;
    max-width: 160px;
    padding: 7px 32px 7px 12px;
    border: 1.5px solid #E6E6E6;
    border-radius: 10px;
    background: #F7F7F7 url('../img/arrow-bottom.svg') no-repeat calc(100% - 10px) 50%;
    background-size: 12px;
    -webkit-appearance: none;
    appearance: none;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #0f0f0f;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.wl-card__size:focus {
    border-color: #F15A29;
}

.wl-card__size.wl-no-sizes {
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* heart button (remove) */
.wl-card__heart {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F7F7F7;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.wl-card__heart:hover {
    background: #FFE8E1;
}

.wl-card__heart svg {
    display: block;
}

/* ---- Sticky bottom bar ---- */
#wl-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #ffffff;
    border-top: 1px solid #E6E6E6;
    padding: 12px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

#wl-sticky-bar.visible {
    transform: translateY(0);
}

.wl-bar__summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wl-bar__count {
    font-size: 0.8125rem;
    color: #666;
    font-weight: 400;
}

.wl-bar__total {
    font-size: 1rem;
    font-weight: 700;
    color: #0f0f0f;
    white-space: nowrap;
}

.wl-bar__btn {
    flex-shrink: 0;
    padding: 12px 24px;
    background: #F15A29;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
}

.wl-bar__btn:hover {
    background: #d44e22;
}

.wl-bar__btn:active {
    transform: scale(0.97);
}

.wl-bar__btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* ---- Order modal ---- */
/* z-index 20000 must beat catalog_cover_screen (10000) and sticky headers.
   Was 1000 — modal rendered BEHIND mobile filter drawer. */
#wl-order-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.75);
    overflow-y: auto;
    display: none;
    padding: 20px;
}

#wl-order-modal.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.wl-modal__inner {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 24px;
    width: 100%;
    max-width: 460px;
    margin: 40px auto;
    position: relative;
}

.wl-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F2F2F2;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #0f0f0f;
    transition: background 0.2s;
}

.wl-modal__close:hover {
    background: #e0e0e0;
}

.wl-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px 0;
    color: #0f0f0f;
}

.wl-modal__subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    color: #666;
    padding: 0 16px;
    margin-bottom: 16px;
}

/* product summary list inside modal */
.wl-modal__products {
    background: #F7F7F7;
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.wl-modal__product-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: 10px;
    padding: 8px;
}

.wl-modal__product-row img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 8px;
    background: #F7F7F7;
    flex-shrink: 0;
}

.wl-modal__product-info {
    flex: 1;
    min-width: 0;
}

.wl-modal__product-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f0f0f;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wl-modal__product-meta {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.wl-modal__product-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: #F15A29;
    flex-shrink: 0;
}

/* form */
.wl-modal__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wl-modal__form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f0f0f;
}

.wl-modal__form input[type="text"],
.wl-modal__form select {
    padding: 11px 14px;
    border: 1.5px solid #E6E6E6;
    border-radius: 10px;
    background: #F7F7F7;
    font-size: 0.875rem;
    font-weight: 400;
    color: #0f0f0f;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.wl-modal__form input[type="text"]:focus,
.wl-modal__form select:focus {
    border-color: #F15A29;
}

.wl-modal__form select {
    -webkit-appearance: none;
    appearance: none;
    background: #F7F7F7 url('../img/arrow-bottom.svg') no-repeat calc(100% - 12px) 50%;
    background-size: 12px;
    padding-right: 36px;
}

/* delivery radios */
.wl-modal__delivery-label {
    margin-bottom: 4px;
}

.wl-modal__delivery-opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wl-modal__delivery-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1.5px solid #E6E6E6;
    border-radius: 10px;
    background: #F7F7F7;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.wl-modal__delivery-opt:has(input:checked) {
    border-color: #F15A29;
    background: #FFF4F0;
}

.wl-modal__delivery-opt input[type="radio"] {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #CCCCCC;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wl-modal__delivery-opt input[type="radio"]:checked {
    background: #F15A29;
    border-color: #F15A29;
}

.wl-modal__delivery-opt input[type="radio"]:checked::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    display: block;
}

.wl-modal__delivery-opt-text {
    flex: 1;
    padding: 0 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f0f0f;
}

.wl-modal__delivery-opt-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

/* policy */
.wl-modal__policy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 400;
    color: #888;
}

.wl-modal__policy input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #CCCCCC;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: background 0.15s, border-color 0.15s;
}

.wl-modal__policy input[type="checkbox"]:checked {
    background: #F15A29;
    border-color: #F15A29;
}

.wl-modal__policy input[type="checkbox"]:checked::after {
    content: '\2713';
    color: white;
    font-size: 12px;
    line-height: 1;
}

.wl-modal__policy a {
    color: #F15A29;
    text-decoration: none;
}

/* submit */
.wl-modal__submit {
    width: 100%;
    padding: 14px;
    background: #F15A29;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.wl-modal__submit:hover {
    background: #d44e22;
}

.wl-modal__submit:active {
    transform: scale(0.98);
}

.wl-modal__submit:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* success / error states */
.wl-modal__success {
    text-align: center;
    padding: 16px 0;
}

.wl-modal__success-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.wl-modal__success h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f0f0f;
    margin: 0 0 8px 0;
}

.wl-modal__success p {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
}

.wl-modal__success .wl-modal__submit {
    margin-top: 20px;
}

/* loader inside button */
.wl-btn-loader {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.wl-btn-loader span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: white;
    animation: wlPulse 1s infinite ease-in-out;
}

.wl-btn-loader span:nth-child(2) { animation-delay: 0.15s; }
.wl-btn-loader span:nth-child(3) { animation-delay: 0.3s; }
.wl-btn-loader span:nth-child(4) { animation-delay: 0.45s; }

@keyframes wlPulse {
    0%, 100% { transform: scale(0.7); opacity: 0.5; }
    50%       { transform: scale(1.1); opacity: 1; }
}

/* ---- Empty state ---- */
#wishlist-empty {
    padding: 60px 20px;
    text-align: center;
}

#wishlist-empty .wl-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

#wishlist-empty p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ---- Loading state ---- */
#wishlist-loading {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .wl-card__img-wrap {
        width: 72px;
        height: 72px;
    }

    .wl-card__img-wrap img {
        width: 72px;
        height: 72px;
    }

    .wl-card__name {
        font-size: 0.8125rem;
    }

    .wl-card__size {
        max-width: 130px;
        font-size: 0.75rem;
        padding: 6px 28px 6px 10px;
    }

    .wl-bar__btn {
        padding: 11px 18px;
        font-size: 0.875rem;
    }

    .wl-modal__inner {
        padding: 22px 16px;
        border-radius: 20px;
        margin: 16px auto;
    }

    #wl-order-modal {
        padding: 0;
        align-items: flex-end;
    }

    .wl-modal__inner {
        margin: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: 92vh;
        overflow-y: auto;
    }
}

@media (min-width: 768px) {
    #wishlist-list {
        padding-bottom: 100px;
    }

    .wl-card__img-wrap {
        width: 100px;
        height: 100px;
    }

    .wl-card__img-wrap img {
        width: 100px;
        height: 100px;
    }

    .wl-card__size {
        max-width: 180px;
    }
}
