/* Variant Drawer styles — extracted from render_variant_drawer_styles() in
   css/variant-drawer-css.php. Fully static. Enqueued via render_variant_drawer_css()
   / wiz_enqueue_product_card_styles(). render_variant_drawer_styles() still returns this
   inline for AJAX-rendered drawer fragments (reads this same file). */

/* Main Variant Drawer Styles */
.variant-drawer-container {
    position: relative;
}

.variant-drawer-product-item .product-title a,
.variant-drawer-product-item .product-title-color {
    max-width: 100% !important;
    /* Limit title width to 50px */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding-bottom: 5px;
}

.variant-drawer-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.variant-drawer-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    gap: 6px;
    color: var(--primary);
}

.variant-drawer-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.variant-drawer-button:hover {
    color: var(--primary);
}

.variant-drawer-value-display {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
    background-color: rgb(255, 255, 255);
}

.variant-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Prevent body scroll when drawer is open */
body.variant-drawer-open {
    overflow: hidden !important;
    /* position: fixed; */
    /* width: 100%;
            height: 100%; */
}

@media (max-width: 767px) {
    body.variant-drawer-open {
        /* position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0; */
        overflow: hidden;
    }
}

.variant-drawer-content {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100%;
    width: 720px;
    max-width: 90vw;
    background-color: #fff;
    z-index: 9999;
    transition: right 0.3s ease, transform 0.3s ease;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.variant-drawer-content.drawer-position-left {
    left: -100%;
    right: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.variant-drawer-content.drawer-position-left.open {
    left: 0;
}

.variant-drawer-content.open {
    right: 0;
}

.variant-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    flex-shrink: 0;
    background-color: #fff;
    /* Removed position: sticky - not needed since header is already at top, and causes Safari issues */
    position: relative;
    z-index: 12;
    flex-direction: column;
}

.variant-drawer-header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
}

.variant-filter-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.variant-drawer-search-sorting-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    gap: 10px;
}

.variant-search-input-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    padding: 8px 12px;
    gap: 8px;
    height: 42px;
}

.variant-search-input-container .search-icon {
    flex-shrink: 0;
    color: #666;
    width: 20px;
    height: 20px;
}

.variant-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
    padding: 0;
    border-style: none !important;
    height: 100%;
}

.variant-search-input::placeholder {
    color: #999;
}

.variant-search-input-container .clear-icon {
    flex-shrink: 0;
    color: #666;
    width: 18px;
    height: 18px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.variant-search-input-container .clear-icon:hover {
    color: #333;
}

.variant-drawer-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.variant-drawer-close {
    background: none;
    border: none;
    color: #000000;
    user-select: none;
    display: inline-block;
    flex-shrink: 0;
    font-size: 3rem;
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-weight: 300;
}

.variant-drawer-close svg {
    fill: currentColor;
}

.variant-drawer-body {
    padding: 0px 20px 0 20px;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    min-height: 0;
    /* Important for flex scrolling */
}

.variant-drawer-items-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
    width: 100%;
    min-height: 0;
    /* Important for flex scrolling */
    position: relative;
}

.variant-drawer-items {
    width: 100%;
    overflow-x: hidden;
}

.variant-drawer-count-header {
    position: sticky;
    top: 0;
    z-index: 11;
    background: white;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 10px;
}

.variant-drawer-count-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
}

.variant-drawer-count-header-actions {
    display: flex;
    align-items: center;
}

.variant-drawer-clear-btn-inline {
    display: block;
    padding: 0;
    background: transparent;
    color: black;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.variant-drawer-pagination-container {
    flex-shrink: 0;
    padding: 15px 20px;
    background-color: #fff;
    position: relative;
    z-index: 10;
}

.variant-drawer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background-color: #fff;
    flex-shrink: 0;
    /* Safari fix: Use relative positioning instead of sticky for better compatibility */
    position: relative;
    z-index: 1;
    /* Ensure footer stays at bottom via flex layout */
    margin-top: auto;
}

.variant-drawer-done-btn {
    padding: 8px 20px;
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.variant-drawer-done-btn:hover {
    background: var(--primary);
    color: var(--primary-text);
}

.variant-drawer-total {
    font-size: 16px;
    font-weight: 600;
}

.variant-drawer-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    overflow: auto;
    max-height: 500px;
}

/* Horizontal layout for variant drawer product items */
.variant-drawer-product-item {
    position: relative;
    /* padding-bottom: 15px; */
}

/* New full-width divider */
.variant-drawer-product-item:not(:last-child) {
    margin: 12px 0px;
    border-width: 0px 0px thin;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.12);
}

.product-tag-badgevariant_drawer {
    font-size: 8px;
}

.variant-drawer-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.variant-drawer-clear-btn {
    display: block;
    padding: 0;
    background: transparent;
    color: black;
    font-size: 14px;
}

.variant-drawer-product-item .product-item {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    margin-bottom: 0;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    position: relative;
    transition: box-shadow 0.3s ease;
    flex-wrap: nowrap;
    /* Ensure items don't wrap */
}

.variant-drawer-product-item .product-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.variant-drawer-product-item .vd-item-image-container {
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    position: relative;
}

.vd-product-tag-overlay {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 2;
}

.variant-drawer-product-item .product-content {
    flex: 1;
    padding: 0;
    min-width: 0;
    /* Ensure text truncation works properly */
    padding-right: 15px;
    /* Add padding to separate from cart component */
    padding-top: 0px;
    /* Align with add to cart button */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align content to top */
}

/* New product cart component as 4th component - for drawer only */
.variant-drawer-product-item .product-cart-component {
    flex: 0 0 auto;
    width: 150px;
    display: flex;
    align-items: flex-start;
    /* Align to top to match product title */
    justify-content: flex-end;
    padding-top: 0px;
    /* Align with product title */
}

/* Cart controls styles for listing context */
.cart-controls {
    margin-top: 10px;
}

/* Drawer-specific cart button styling */
.variant-drawer-product-item .similar-product-cart-button {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    /* Changed from center to flex-start for top alignment */
    width: 100%;
    align-self: flex-start;
    margin-top: 0;
}

.variant-drawer-product-item .add-to-cart-btn,
.variant-drawer-product-item .similar-product-add-to-cart-btn {
    height: 36px;
    width: 100%;
    min-width: 150px;
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.variant-drawer-product-item .add-to-cart-btn:hover,
.variant-drawer-product-item .similar-product-add-to-cart-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.variant-drawer-product-item .cart-quantity-controls {
    height: 36px;
    width: 150px;
}

.variant-drawer-product-item .quantity-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.variant-drawer-product-item .quantity-btn:hover {
    background-color: #e0e0e0;
}

.variant-drawer-product-item .quantity-count {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 0;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make sure product information is not wrapping unnecessarily */
.variant-drawer-product-item .product-title {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
    color: #333;
    padding-bottom: 0px;
    /* Reduced padding to align with add to cart button */
    margin-bottom: 8px;
    /* Use margin instead for better alignment */
}

.variant-drawer-product-item .product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.variant-drawer-product-item .product-title a:hover {
    color: rgb(0, 0, 0);
}

.variant-drawer-product-item .product-categories {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.2;
    color: #666;
    padding-bottom: 2px;
}

/* Group SKU and price together with specific styling */
.variant-drawer-product-item .product-sku {
    margin-bottom: 5px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
}

.variant-drawer-product-item .product-price {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    /* margin-bottom: 8px; */
}

/* Combined inventory and MOQ container */
.variant-inventory-moq-container {
    margin: 0px 0 0 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-self: flex-start;
    /* Align to top like other elements */
    width: 120px;
    /* Fixed width for consistent alignment */
    min-width: 120px;
    /* Ensure minimum width */
}

.variant-inventory-status-container {
    display: flex;
    align-items: flex-start;
}

.variant-inventory-status-text {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    font-family: inherit;
}

/* MOQ (Min Order Quantity) styling */
.variant-moq-container {
    display: flex;
    align-items: flex-start;
}

.variant-moq-text {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    font-family: inherit;
    font-weight: 500;
}

.variant-inventory-status-text svg {
    margin-left: 4px;
    width: 14px;
    height: 14px;
    fill: currentColor;
    vertical-align: middle;
}

.variant-drawer-product-item {
    display: flex;
    flex-wrap: nowrap;

    padding-right: 10px;

}

.similar-product-inner {
    position: relative;
}

/* Product name section below similar-product-inner */

.variant-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .variant-inventory-status-text {
        font-size: 11px;
    }

    .variant-inventory-status-text svg {
        width: 12px;
        height: 12px;
    }
}

/* Make sure content doesn't overlap with add to cart button */
.variant-drawer-product-item .product-content>div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Custom styles for side-by-side layout */
.variant-drawer-product-item .similar-product-details {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.variant-drawer-product-item .product-info {
    flex: 1;
    min-width: 0;
    /* Ensure text truncation works properly */
    padding-right: 15px;
    width: 100%;
    /* Use full available width instead of fit-content */
    overflow: hidden;
    /* Handle overflow properly */
}

.variant-drawer-product-item .similar-product-cart-button,
.variant-drawer-product-item .atc-container_similar-drawer {
    flex: 0 0 auto;
    width: 175px;
    /* Increased width to fit text on one line */
    margin-left: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.variant-drawer-product-item .product-title,
.variant-drawer-product-item .product-sku,
.variant-drawer-product-item .product-price,
.variant-drawer-product-item .product-categories {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.variant-drawer-product-item .add-to-cart-btn,
.variant-drawer-product-item .similar-product-add-to-cart-btn,
.variant-drawer-product-item .atc-btn_similar-drawer {
    white-space: nowrap;

    text-overflow: ellipsis;
    width: 100%;

    transform: none;
    text-transform: none;

    margin-bottom: 5px;
}

/* Skeleton loaders */
.variant-item-skeleton {
    display: flex;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 110px;
}

.skeleton-image {
    width: 80px;
    height: 80px;
    min-width: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.skeleton-title {
    height: 20px;
    width: 70%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-price {
    height: 16px;
    width: 40%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-button {
    height: 30px;
    width: 100px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    align-self: flex-end;
}

.variant-loading-spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: variant-spin 1s ease-in-out infinite;
}

.variant-infinite-loader {
    text-align: center;
    padding: 15px;
    margin: 10px 0;
    clear: both;
}

.variant-infinite-loader p {
    margin: 0;
    padding: 10px;
    font-style: italic;
    color: #666;
}



/* Pagination Styles */
.variant-drawer-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 0;
}

/* Hide pagination container when empty */
.variant-drawer-pagination-container:empty {
    display: none;
    border-top: none;
    padding: 0;
}

.variant-page-item {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    height: 40px;
    border: none;
    outline: none;
    background: transparent;
    color: #000000;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.variant-page-item:hover:not(.active):not(.disabled) {
    background-color: rgba(0, 0, 0, 0.05);
    color: white;
}

.variant-page-item.active {
    background-color: #000000;
    color: white;
    font-weight: 600;
}

.variant-page-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Navigation buttons (First, Previous, Next, Last) */
.variant-page-item.nav-button {
    min-width: auto;
    padding: 0 16px;
    font-size: 18px;
    font-weight: 600;
}

.variant-page-item.nav-button:hover:not(.disabled) {
    background-color: rgba(0, 0, 0, 0.1);
    color: #000000;
}

.variant-page-ellipsis {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    margin: 0 6px;
    font-size: 16px;
}

/* Loading state */
.variant-items-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.variant-drawer-items-container {
    position: relative;
    min-height: 200px;
}

/* Make pagination items inactive while loading */
.variant-page-item.temp-disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Critical skeleton styles */
.variants-loading {
    display: block;
    width: 100%;
    min-height: 500px;
}

.variant-item-skeleton {
    display: flex;
    flex-direction: row;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    background-color: #f9f9f9;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-image {
    flex: 0 0 80px;
    height: 80px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-right: 15px;
}

.skeleton-content {
    display: flex;
    flex: 1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.skeleton-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-title {
    height: 20px;
    background-color: #f0f0f0;
    width: 70%;
    border-radius: 3px;
}

.skeleton-price {
    height: 16px;
    background-color: #f0f0f0;
    width: 30%;
    border-radius: 3px;
}

.skeleton-sku {
    height: 14px;
    background-color: #f0f0f0;
    width: 40%;
    border-radius: 3px;
}

.skeleton-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.skeleton-button {
    height: 36px;
    width: 100px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.skeleton-loading-text {
    text-align: center;
    padding: 15px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #666;
    font-size: 16px;
}

.variant-drawer-items {
    min-height: 200px;
}

/* Error message styling */
.variant-error,
.no-variants-message {
    text-align: center;
    padding: 30px 20px;
    background-color: #fff9f9;
    border: 1px solid #ffeeee;
    border-radius: 6px;
    margin: 15px 0;
}

.variant-error p,
.no-variants-message p {
    color: #d32f2f;
    font-size: 16px;
    margin-bottom: 15px;
}

.variant-retry-button {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.variant-retry-button:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

/* Loading message styling */
.loading-message {
    text-align: center;
    padding: 10px;
    color: #666;
    font-style: italic;
}

.variants-rendering {
    opacity: 0.8;
}

/* Similar Drawer Styles */
.button {
    padding: 10px 20px;
    background-color: #000;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    background-color: #000;
}

.similar-products-container {
    max-height: 100%;
    overflow-y: auto;
    padding: 0px 20px 20px 20px;
}

.similar-product-add-to-cart-btn {
    padding: 8px 15px;
    background-color: #000;
    color: white;
    border: none;
    cursor: pointer;
}

.similar-product-add-to-cart-btn:hover {
    background-color: #000;
}

.vd-item-image {
    object-fit: cover;
    height: 100% !important;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.title {
    margin: 0;
    padding: 0;
    font-size: 1em;
    font-weight: 600;
}

.similar-product-item {
    border-bottom: 1px solid #f0f0f0;
}

.similar-product-inner {
    display: flex;
    align-items: flex-start;
}

.similar-product-details {
    flex: 1;
}

.product-title {
    margin: 0 0 5px 0;
    font-size: 1em;
}

.similar-product-categories {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.similar-product-sku {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 8px;
}

.product-price {
    font-weight: 500;

}

.drawer-close {
    background: transparent;
    padding: 0;
}

/* Animation keyframes */
@keyframes variant-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes skeleton-pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Responsive styles */
@media (max-width: 767px) {
    .variant-drawer-content {
        width: 100%;
        max-width: 100vw;
        right: -100vw;
        left: auto;
        top: auto;
        bottom: 0;
    }

    .variant-drawer-content.drawer-position-left {
        left: -100vw;
        right: auto;
        top: auto;
        bottom: 0;
    }

    .variant-drawer-content.open {
        right: 0;
        left: auto;
        bottom: 0;
        top: auto;
    }

    .variant-drawer-content.drawer-position-left.open {
        left: 0;
        right: auto;
        bottom: 0;
        top: auto;
    }

    .variant-drawer-overlay {
        z-index: 9997;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .variant-drawer-header {
        padding: 12px 15px;
        min-height: 50px;
    }

    .variant-drawer-close {
        min-width: 44px;
        min-height: 44px;
        width: 3rem;
        height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #000000;
        user-select: none;
        flex-shrink: 0;
        font-size: 3rem;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .variant-drawer-close svg {
        fill: currentColor;
    }

    .variant-drawer-body {
        /* padding: 15px; */
        min-height: 0;
        overflow: hidden;
    }

    .variant-drawer-items-container {
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }

    .variant-drawer-pagination-container {
        padding: 12px 15px;
    }

    .variant-drawer-footer {
        padding: 12px 15px;
        min-height: 60px;
    }

    .variant-drawer-done-btn {
        padding: 10px 20px;
        font-size: 16px;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .variant-drawer-total {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .variant-drawer-content {
        width: 100%;
        max-width: 100vw;
    }

    .variant-drawer-product-item .product-item {
        padding: 10px;
    }

    .variant-drawer-product-item .product-content {
        min-width: 0;
        padding-right: 10px;
    }

    .variant-drawer-product-item .product-cart-component {
        width: 100px;
    }

    .variant-drawer-product-item .add-to-cart-btn,
    .variant-drawer-product-item .similar-product-add-to-cart-btn {
        width: 110px;
        min-width: 110px;
        font-size: 12px;
        height: 34px;
        padding: 4px 8px;
    }

    .variant-drawer-product-item .cart-quantity-controls {
        width: 110px;
        height: 34px;
    }

    .variant-drawer-product-item .quantity-btn {
        width: 30px;
        height: 34px;
    }

    .variant-drawer-header h2 {
        font-size: 16px;
    }

    .variant-drawer-done-btn {
        padding: 6px 12px;
        font-size: 13px;
        background: var(--primary);
        color: var(--primary-text);
        border-radius: 0;
    }

    .variant-drawer-total {
        font-size: 13px;
    }

    .variant-drawer-product-item .similar-product-cart-button {
        width: 130px;
    }

    .variant-drawer-product-item .add-to-cart-btn,
    .variant-drawer-product-item .similar-product-add-to-cart-btn,
    .variant-drawer-product-item .atc-btn_similar-drawer {
        min-width: 130px;
        font-size: 12px;
        margin-bottom: 5px;
    }
}

@media (max-width: 380px) {
    .variant-drawer-product-item .product-item {
        flex-wrap: wrap;
    }


    .variant-drawer-product-item .product-content {
        flex: 1;
        margin-bottom: 10px;
    }

    .variant-drawer-product-item .product-cart-component {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }

    .variant-drawer-product-item .add-to-cart-btn,
    .variant-drawer-product-item .similar-product-add-to-cart-btn {
        width: 100%;
        min-width: auto;
        height: 32px;
        font-size: 12px;
        padding: 4px 6px;
    }

    .variant-drawer-product-item .similar-product-details {
        flex-wrap: nowrap;
    }

    .variant-drawer-product-item .similar-product-cart-button {
        width: 115px;
    }

    .variant-drawer-product-item .add-to-cart-btn,
    .variant-drawer-product-item .similar-product-add-to-cart-btn,
    .variant-drawer-product-item .atc-btn_similar-drawer {

        padding: 6px 8px;
        font-size: 11px;
        margin-bottom: 5px;
    }
}

/* Wishlist Icon Styles for Variant Drawer */
.vd-wishlist-icon-circle {
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 0 !important;
}

.vd-item-actions .tooltip-target.vd-wishlist-icon-circle {
    position: relative;
    float: none;
    margin: 0;
}

.vd-wishlist-heart-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.vd-wishlist-icon-circle .vd-wishlist-heart-svg svg {
    width: 18px;
    height: 18px;
}

.vd-wishlist-icon-circle .vd-wishlist-heart-svg svg path {
    fill: transparent;
    stroke: #000;
    stroke-width: 1.5;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.vd-wishlist-icon-circle.active .vd-wishlist-heart-svg svg path {
    fill: #e74c3c;
    stroke: none;
}

.vd-wishlist-icon-circle.active:hover .vd-wishlist-heart-svg svg path {
    fill: #c0392b;
}

/* ========================================
                   NEW INDEPENDENT VARIANT DRAWER STYLES
                   vd-* prefix to avoid conflicts with PLP
                ======================================== */

/* Variant Drawer Item Container */
.vd-item {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    transition: background-color 0.2s ease;
}

.vd-item:last-child {
    border-bottom: none;
}

.vd-item:hover {
    background-color: #f9f9f9;
}

.vd-item-inactive {
    opacity: 0.6;
    pointer-events: none;
}

/* Variant Item Inner - Main flex container */
.vd-item-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
    flex-wrap: nowrap;
    position: relative;
}

/* Image Container */
.vd-item-image-container {
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.vd-item-image-container a {
    display: block;
    width: 100%;
    height: 100%;
}

.vd-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content Container - COLUMN layout with header row on top */
.vd-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
    overflow: hidden;
    flex-wrap: nowrap;
}

/* Header row spans full width naturally in column layout */
.vd-header-row {
    width: 100%;
    flex: 0 0 auto;
}

/* Item Info - Column layout for name, SKU, price */
.vd-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

/* Mobile inventory status - hidden on desktop */
.variant-inventory-status-mobile {
    display: none;
}

/* Categories */
.vd-item-categories {
    font-size: 12px;
    color: #999999;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Brand */
.vd-item-brand {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 5px;
    text-transform: capitalize;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vd-item-brand img.brand-logo {
    max-height: 24px;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Title */
.vd-item-title {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.vd-item-title a {
    color: #333333;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vd-item-title a:hover {
    color: #075465;
}

/* SKU */
.vd-item-sku {
    font-size: 13px;
    color: #666666;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Price */
.vd-item-price {
    font-size: 16px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}

/* Actions Container - Groups wishlist and cart button */
.vd-item-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    align-self: flex-start;
    margin-left: auto;
    flex-wrap: nowrap;
    min-width: fit-content;
}

/* Wishlist Icon in Actions Container */
.vd-item-actions .vd-wishlist-icon-circle {
    flex: 0 0 auto;
    align-self: flex-start;
}

/* Add to Cart Button in Actions Container */
.vd-item-actions .vd-item-cart-button {
    flex: 0 0 auto;
    align-self: flex-start;
    min-width: 150px;
}

/* Ensure the add to cart button inside takes full width of its container */
.vd-item-actions .vd-item-cart-button .atc-container_variant_drawer {
    width: 100%;
}

.vd-item-actions .vd-item-cart-button .atc-btn_variant_drawer {
    width: 100%;
    min-width: 150px;
}

/* Quantity controls width in variant drawer */
.vd-item-actions .vd-item-cart-button .atc-qty_variant_drawer {
    min-width: 150px;
    width: 100%;
}

/* Position wishlist tooltip/modal outside the normal flow */
.wishlist-tooltip-container,
.wishlist-modal-overlay {
    position: fixed;
    z-index: 10000;
}

.vd-add-to-cart-btn {
    padding: 8px 16px;
    background-color: #075465;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.vd-add-to-cart-btn:hover {
    background-color: #054350;
}

.vd-add-to-cart-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Variant Product Name Section (at the start, no background) */
.variant-product-name-section {
    padding: 8px 0px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    font-size: 16px;
}

.variant-product-name {
    font-size: 13px;
    font-weight: 500;
    color: #333333;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Variant Inventory and MOQ Container */
.variant-inventory-moq-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-self: flex-start;
    min-width: 120px;
    flex: 0 0 auto;
    flex-shrink: 0;
}

.variant-moq-container {
    display: inline-block;
}

.variant-moq-text {
    font-size: 12px;
    color: #666666;
    font-weight: 500;
}

/* Variant Attributes (at the start, no center alignment) */
.variant-attributes {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    font-size: 0.85em;
    overflow: hidden;
}

.variant-attributes-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow: hidden;
    flex-grow: 1;
    justify-content: flex-start;
}

.variant-attribute-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f7f8fa;
    padding: 4px 8px;
    margin-right: 8px;
    max-width: 45%;
    flex-shrink: 1;
    border-radius: 3px;
}

.variant-attribute-name {
    font-weight: 600;
    color: #666;
}

.variant-attribute-value {
    color: #333;
}

/* Responsive adjustments for variant drawer items - matches React breakpoint of 600px */
@media (max-width: 600px) {
    .vd-item-inner {
        gap: 8px;
        padding: 8px;
        flex-direction: row;
        align-items: flex-start;
    }

    .vd-item-image-container {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }

    .vd-item-content {
        flex-direction: row;
        gap: 8px;
        align-items: flex-start;
    }

    .vd-item-info {
        flex: 1;
        min-width: 0;
    }

    /* Hide title on mobile - only show SKU and price */
    .vd-item-title {
        display: none !important;
    }

    .vd-item-categories {
        display: none !important;
    }

    .vd-item-sku {
        font-size: 12px;
    }

    .vd-item-price {
        font-size: 14px;
    }

    /* Hide desktop inventory/MOQ container on mobile */
    .variant-inventory-moq-container {
        display: none !important;
    }

    /* Show mobile inventory status inline with SKU/price */
    .variant-inventory-status-mobile {
        display: block;
        margin: 4px 0;
    }

    .variant-inventory-status-mobile .variant-inventory-status-container {
        display: inline-flex;
        align-items: center;
    }

    .variant-inventory-status-mobile .variant-inventory-status-text {
        font-size: 12px !important;
    }

    .vd-item-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .vd-item-actions .vd-item-cart-button {
        min-width: 130px;
    }

    .vd-item-actions .vd-item-cart-button .atc-btn_variant_drawer {
        min-width: 130px;
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .vd-item-inner {
        flex-direction: row;
        gap: 10px;
        padding: 10px;
    }

    .vd-item-image-container {
        width: 64px;
        height: 64px;
        flex-shrink: 0;
    }

    .vd-item-content {
        flex-direction: row;
        gap: 8px;
        min-width: 0;
    }

    .vd-item-info {
        flex: 1;
        min-width: 0;
    }

    /* Hide title and categories on very small screens too */
    .vd-item-title {
        display: none !important;
    }

    .vd-item-categories {
        display: none !important;
    }

    .vd-item-sku {
        font-size: 12px;
    }

    .vd-item-price {
        font-size: 14px;
        font-weight: 700;
    }

    /* Keep desktop inventory/MOQ container hidden on very small screens */
    .variant-inventory-moq-container {
        display: none !important;
    }

    /* Keep mobile inventory status visible */
    .variant-inventory-status-mobile {
        display: block;
        margin: 4px 0;
    }

    .variant-inventory-status-mobile .variant-inventory-status-text {
        font-size: 11px !important;
    }

    .vd-item-actions {
        flex-direction: row;
        gap: 6px;
        margin-left: auto;
        margin-top: 0;
    }

    .vd-item-actions .vd-item-cart-button {
        min-width: 110px;
    }

    .vd-item-actions .vd-item-cart-button .atc-btn_variant_drawer {
        min-width: 110px;
        font-size: 12px;
        padding: 6px 10px;
    }
}