/**
 * Webup Header - Wishlist Drawer Styles
 *
 * @package Webup_Header
 */

/* ==========================================================================
   Drawer Container
   ========================================================================== */

#webup-wishlist {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: #fff;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

#webup-wishlist.is-open {
    transform: translateX(0);
}

.admin-bar #webup-wishlist {
    top: 32px;
    height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar #webup-wishlist {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

/* ==========================================================================
   Inner
   ========================================================================== */

#webup-wishlist .webup-wishlist__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ==========================================================================
   Header
   ========================================================================== */

#webup-wishlist .webup-wishlist__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

#webup-wishlist .webup-wishlist__title {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
    border: none;
}

#webup-wishlist .webup-wishlist__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

#webup-wishlist .webup-wishlist__close:hover {
    background: #f5f5f5;
    color: #111;
}

#webup-wishlist .webup-wishlist__close svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Body (scrollable)
   ========================================================================== */

#webup-wishlist .webup-wishlist__body {
    flex: 1;
    overflow-y: auto;
}

#webup-wishlist .webup-wishlist__list {
    padding: 8px 0;
}

/* ==========================================================================
   Empty / Error states
   ========================================================================== */

#webup-wishlist .webup-wishlist-empty,
#webup-wishlist .webup-wishlist-error {
    padding: 60px 24px;
    text-align: center;
    color: #999;
    font-size: 0.875rem;
    margin: 0;
}

#webup-wishlist .webup-wishlist-error {
    color: #c00;
}

/* ==========================================================================
   Loading spinner
   ========================================================================== */

#webup-wishlist .webup-wishlist-spinner {
    width: 32px;
    height: 32px;
    margin: 60px auto;
    border: 3px solid #f0f0f0;
    border-top-color: #111;
    border-radius: 50%;
    animation: webup-wishlist-spin 0.7s linear infinite;
}

@keyframes webup-wishlist-spin {
    to { transform: rotate(360deg); }
}

#webup-wishlist.is-loading .webup-wishlist__body {
    pointer-events: none;
    opacity: 0.6;
}

/* ==========================================================================
   Product Item
   ========================================================================== */

#webup-wishlist .webup-wishlist-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

#webup-wishlist .webup-wishlist-item:last-child {
    border-bottom: none;
}

/* Image */
#webup-wishlist .webup-wishlist-item__image {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
}

#webup-wishlist .webup-wishlist-item__image a {
    display: block;
    border: none;
}

#webup-wishlist .webup-wishlist-item__image img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    background: #f5f5f5;
}

/* Details */
#webup-wishlist .webup-wishlist-item__details {
    flex: 1;
    min-width: 0;
    padding-right: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Name */
#webup-wishlist .webup-wishlist-item__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: #111;
    text-decoration: none;
}

#webup-wishlist .webup-wishlist-item__name:hover {
    color: #111;
    text-decoration: none;
}

/* Price */
#webup-wishlist .webup-wishlist-item__price {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

/* Add to cart / variant button */
#webup-wishlist .webup-wishlist-item__add {
    display: inline-block;
    margin-top: 4px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    align-self: flex-start;
}

#webup-wishlist .webup-wishlist-item__add:hover {
    background: #333;
    border-color: #333;
    color: #fff;
    text-decoration: none;
}

/* Out of stock */
#webup-wishlist .webup-wishlist-item__out-of-stock {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 4px;
}

/* Remove button */
#webup-wishlist .webup-wishlist-item__remove {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #ccc;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

#webup-wishlist .webup-wishlist-item__remove:hover {
    background: #fee;
    color: #e44;
}

/* ==========================================================================
   Header icon button
   ========================================================================== */

.webup-header__wishlist {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: inherit;
    line-height: 1;
}

.webup-header__wishlist-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e44;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    box-sizing: border-box;
}

/* ==========================================================================
   Backdrop
   ========================================================================== */

.webup-wishlist__backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
}

.webup-wishlist__backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Body lock
   ========================================================================== */

body.webup-wishlist-open {
    overflow: hidden;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    #webup-wishlist {
        max-width: 100%;
    }

    #webup-wishlist .webup-wishlist__header {
        padding: 16px 20px;
    }

    #webup-wishlist .webup-wishlist-item {
        padding: 14px 20px;
    }
}
