/* Saved Carts – card UI: header (title + count + total), thumbnails row, footer buttons */

.wiz-account-saved-carts.wiz-saved-carts-wrap {
    width: 100%;
    padding-bottom: 32px;
}

.wiz-saved-carts-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.wiz-saved-carts-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wiz-saved-carts-section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wiz-saved-carts-section-heading {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #000000;
}

.wiz-saved-carts-section-count {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
}

.wiz-saved-carts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 2.4rem;
    justify-content: center;
    gap: 16px;
    margin: 0;
    padding: 24px;
    min-height: 200px;
    text-align: center;
}

.wiz-saved-carts-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-width: 72px;
    min-height: 72px;
    color: #9ca3af;
}

.wiz-saved-carts-empty-icon svg {
    width: 78px;
    height: 61px;
}

/* Match cart summary empty state text style (vl-cart-message p) */
.wiz-saved-carts-empty-message {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #000;
}

.wiz-saved-carts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Card: white, rounded, shadow */
.wiz-saved-cart-card {
    background: #fff;
    border: 1px solid #0000001F;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}


/* Header: title + count left, total + actions right */
.wiz-saved-cart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0 0 16px;
}

.wiz-saved-cart-card-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Saved / Draft — same treatment as cart summary saved carts list (.wiz-csl-card-badge) */
.wiz-saved-cart-card-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.wiz-saved-cart-card-badge--draft {
    background: var(--wiz-status-draft-bg, #F7F8FA);
    color: var(--wiz-status-draft-fg, #00000099);
}

.wiz-saved-cart-card-badge--saved {
    background: var(--wiz-status-saved-bg, #E8F3EF);
    color: var(--wiz-status-saved-fg, #16885F);
}

.wiz-saved-cart-card-badge--icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    min-width: 28px;
    min-height: 24px;
}

.wiz-saved-cart-card-badge--icons svg {
    display: block;
    flex-shrink: 0;
}

.wiz-saved-cart-card-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.wiz-saved-cart-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #000000DE;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiz-saved-cart-card-count {
    font-size: 14px;
    font-weight: 400;
    color: #000;
}

/* .wiz-saved-cart-card-total is intentionally NOT rendered in the account context.
   The shared renderer (wiz_render_saved_cart_card) omits the total when show_card_total
   is unset, and the JS-side mirror in SavedCartsWidget.php has been updated to match. If
   a future variant needs the total here, expose it as an Elementor switcher rather than
   leaving the markup hidden via CSS. */

/* Product thumbnails row – column count set per card via --wiz-saved-cart-thumb-columns */
.wiz-saved-cart-card-thumbnails {
    display: grid;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: repeat(var(--wiz-saved-cart-thumb-columns, 3), minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px;
}

/* Empty cart: center the single placeholder SVG, no grid */
.wiz-saved-cart-card-thumbnails--empty {
    display: flex;
    justify-content: center;
}

.wiz-saved-cart-card-thumbnails--empty .wiz-saved-cart-thumb-placeholder {
    width: auto;
    height: auto;
    min-width: 72px;
    min-height: 72px;
    background: transparent;
}

.wiz-saved-cart-thumb {
    position: relative;
    width: 100%;
    min-width: 0;
    height: var(--wiz-saved-cart-thumb-height, 100px);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiz-saved-cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: 100%;
}

.wiz-saved-cart-thumb--more::after {
    content: '';
    position: absolute;
    inset: 0;
    /* background: rgba(0, 0, 0, 0.5); */
}

.wiz-saved-cart-thumb-more {
    position: absolute;
    inset: 0;
    display: flex;
    /* align-items: center; */
    height: fit-content;
    top: 5px;
    right: 5px;
    justify-content: flex-end;

    font-size: 12px;
    font-weight: 400;
    color: #1A1A1A;
    z-index: 1;
}

.wiz-saved-cart-thumb-overlay-text {
    background-color: #F7F8FA;
    border-radius: 3px;
    padding: 4px 8px;
}

.wiz-saved-cart-thumb-placeholder {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f9fafb;
    color: #9ca3af;
}

/* Footer: View cart (outline) + Checkout (--primary bg) */
.wiz-saved-cart-card-footer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    margin-top: auto;
    background: #fff;
}

.wiz-saved-cart-card-footer--column {
    flex-direction: column;
    align-items: stretch;
}

.wiz-saved-cart-card-footer--column .wiz-saved-cart-btn {
    flex: none;
    width: 100%;
}

.wiz-saved-cart-card-footer--row {
    flex-direction: row;
    flex-wrap: wrap;
}

.wiz-saved-cart-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.wiz-saved-cart-btn-icon svg,
.wiz-saved-cart-btn-icon-svg {
    display: block;
    width: 16px;
    height: 16px;
}

.wiz-saved-cart-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    border: 1px solid transparent;
}

.wiz-saved-cart-btn--view {
    background: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.wiz-saved-cart-btn--view:hover {
    background: #F5F7FA;
    text-decoration: none;
    color: var(--primary);
}

.wiz-saved-cart-btn--checkout {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: var(--primary-text);
}

.wiz-saved-cart-btn--checkout:hover {
    opacity: 0.8;
    text-decoration: none;
    color: var(--primary-text);
}

.wiz-saved-cart-btn--checkout.wiz-saved-cart-btn--disabled {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.8;
}

.wiz-saved-cart-btn--checkout.wiz-saved-cart-btn--disabled:hover {
    opacity: 0.8;
}

/* Loader on View / Checkout – left of text, text stays visible */
.wiz-saved-cart-btn--view.wiz-saved-cart-btn--loading,
.wiz-saved-cart-btn--checkout.wiz-saved-cart-btn--loading {
    pointer-events: none;
    opacity: 0.9;
}

.wiz-saved-cart-btn--view,
.wiz-saved-cart-btn--checkout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wiz-saved-cart-btn--loading .wiz-saved-cart-btn-spinner {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: wiz-saved-cart-btn-spin 0.6s linear infinite;
}

@keyframes wiz-saved-cart-btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 3-dot actions menu (account: Rename / Delete only) */
.wiz-account-saved-cart-actions {
    position: relative;
}

.wiz-account-saved-cart-actions-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
}

.wiz-account-saved-cart-actions-trigger:focus {
    outline: none;
}


.wiz-account-saved-cart-actions-trigger svg {
    width: 20px;
    height: 20px;
}

.wiz-account-saved-cart-actions-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    z-index: 100;
    padding: 0;
}

.wiz-account-saved-cart-actions-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.15s ease;
}

.wiz-account-saved-cart-actions-item:last-child {
    border-bottom: none;
}

.wiz-account-saved-cart-actions-item:focus {
    outline: none;
}

.wiz-account-saved-cart-actions-item:hover {
    background: #f3f4f6;
}

.wiz-account-saved-cart-actions-item--delete:hover {
    background: #fef2f2;
}

.wiz-account-saved-cart-actions-item--delete,
.wiz-account-saved-cart-actions-item--delete span:last-child {
    color: #b91c1c;
}

.wiz-account-saved-cart-actions-icon {
    flex-shrink: 0;
    display: inline-flex;
}

.wiz-account-saved-cart-actions-icon svg {
    width: 16px;
    height: 16px;
}

.wiz-account-saved-cart-actions-icon--red,
.wiz-account-saved-cart-actions-icon--red svg {
    stroke: #b91c1c;
    color: #b91c1c;
}

@media (max-width: 768px) {
    .wiz-saved-carts-grid {
        grid-template-columns: 1fr;
    }
}