/* Similar-products drawer styles — extracted from similar-products-chip.php
   (render_global_similar_products_drawer + render_similar_products_chip custom-ui block).
   $drawer_id is the constant 'drawer-similar-products-global', so these selectors are static.
   Enqueued via render_similar_products_css() / wiz_enqueue_product_card_styles();
   served inline for AJAX fragments via similar_products_styles_markup(). */

/* ---- drawer content styles ---- */
.products-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.similar-products-container .similar-product-item {
    display: block;
    padding: 12px;
    border: 1px solid #00000038;
}

.similar-products-container .similar-product-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    flex-flow: wrap;
    -webkit-box-pack: justify;
    justify-content: space-between;
}

.similar-products-container .similar-product-image-container {
    width: 35%;
    flex-shrink: 0;
    position: relative;
}

.similar-products-container .similar-product-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.similar-products-container .similar-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
}

.similar-products-container .product-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

.similar-products-container .product-sku {
    color: #666;
    font-size: 14px;
}

.similar-products-container .product-price {
    font-weight: bold;
    font-size: 18px;
}

.similar-products-container .similar-product-add-to-cart-btn {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

/* Skeleton loading */
.similar-products-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.similar-products-skeleton .skeleton-item {
    display: flex;
    flex-direction: row;
    border: 1px solid #00000038;
    box-sizing: border-box;
}

.similar-products-skeleton .skeleton-image {
    flex: 0 0 110px;
    height: 110px;
    border-radius: 4px;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.similar-products-skeleton .skeleton-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: similar-skeleton-shimmer 1.5s infinite;
}

.similar-products-skeleton .skeleton-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    justify-content: center;
}

.similar-products-skeleton .skeleton-line {
    border-radius: 4px;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.similar-products-skeleton .skeleton-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: similar-skeleton-shimmer 1.5s infinite;
}

.similar-products-skeleton .skeleton-sku {
    height: 11px;
    width: 35%;
}

.similar-products-skeleton .skeleton-badge {
    height: 22px;
    width: 45%;
    border-radius: 11px;
    margin-top: 2px;
}

@keyframes similar-skeleton-shimmer {
    0% {
        left: -150%;
    }

    100% {
        left: 150%;
    }
}

#drawer-similar-products-global .drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.header {
    flex-shrink: 0;
    border-bottom: 1px solid #eaeaea;
}

.similar-products-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 14px;
    min-height: 0;
}

/* ---- drawer shell/overlay styles ---- */
#drawer-similar-products-global-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#drawer-similar-products-global-overlay.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

#drawer-similar-products-global {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -100%;
    width: 400px;
    max-width: 90vw;
    background-color: #fff;
    z-index: 9999;
    transition: left 0.3s ease, right 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
}

#drawer-similar-products-global.open {
    right: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

#drawer-similar-products-global.open-left {
    left: 0;
    right: auto;
}

#drawer-similar-products-global .drawer-content {
    flex: 1;
    overflow-y: hidden;
    overflow-x: visible;
}

#drawer-similar-products-global .header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid #eaeaea;
}

#drawer-similar-products-global .drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

#drawer-similar-products-global .drawer-close:hover {
    opacity: 0.7;
}

@media (max-width: 767px) {
    #drawer-similar-products-global {
        width: 100% !important;
        max-width: 100vw;
    }
}

/* ---- custom-ui chip styles ---- */
.similar-products-chip.custom-ui-chip .chip-text {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.3s ease-in-out, max-width 0.3s ease-in-out;
    display: inline-block;
    vertical-align: middle;
}

.similar-products-chip.custom-ui-chip:hover .chip-text {
    opacity: 1;
    max-width: 200px;
}

.similar-products-chip.custom-ui-chip {
    transition: all 0.3s ease-in-out;
}