/* Wiz Recent Orders — card field typography/color defaults; Elementor style controls override. */

/* Widget root ---------------------------------------------------- */
.wiz-recent-orders {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    /* Card field color defaults — Elementor color controls override via {{WRAPPER}} */
    --wiz-ro-label-color: #888888;
    --wiz-ro-value-color: #555555;
    --wiz-ro-amount-color: #333333;
    --wiz-ro-badge-color: #000000;
    --wiz-ro-badge-dot-color: #036A91;
}

/* Header --------------------------------------------------------- */
.wiz-recent-orders-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.wiz-recent-orders-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--wiz-ro-heading-color, #111111);
}

.wiz-recent-orders-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0;
    white-space: nowrap;
}

.wiz-recent-orders-view-all i,
.wiz-recent-orders-view-all svg {
    display: inline-block;
    vertical-align: middle;
    line-height: 0;
}

/* Grid ----------------------------------------------------------- */
.wiz-recent-orders-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 16px;
}

/* Card ----------------------------------------------------------- */
.recent-orders-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    border: 1px solid var(--wiz-ro-card-border-color, #e0e0e0);
    border-radius: 0;
    background: var(--wiz-ro-card-bg, #ffffff);
    box-sizing: border-box;
    transition: box-shadow 0.2s ease;
    text-decoration: none;
}

a.recent-orders-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

/* Columns — only the non-empty one is rendered, so no blank gap ever appears */
.recent-orders-card__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.recent-orders-card__col--right {
    align-items: flex-end;
    text-align: right;
}

/* Status badge */
.recent-orders-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 4px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--wiz-ro-badge-color);
    border: 1px solid rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    width: fit-content;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.recent-orders-card__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background-color: var(--wiz-ro-badge-dot-color);
}

/* Labeled rows (date, channel) ---------------------------------- */
.recent-orders-card__row {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.recent-orders-card__label {
    margin-right: 5px;
    font-size: 13px;
    font-weight: 400;
    color: var(--wiz-ro-label-color);
}

.recent-orders-card__value {
    font-size: 13px;
    font-weight: 400;
    color: var(--wiz-ro-value-color);
}

.recent-orders-card__row--label-after .recent-orders-card__label {
    margin-right: 0;
    margin-left: 5px;
}

.recent-orders-card__field {
    width: 100%;
    box-sizing: border-box;
}

.recent-orders-card__col--right .recent-orders-card__field {
    display: flex;
    justify-content: flex-end;
}

.recent-orders-card__col--right .recent-orders-card__row {
    justify-content: flex-end;
}

.recent-orders-card__amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--wiz-ro-amount-color);
    line-height: 1.2;
}

.recent-orders-card__id {
    font-size: 13px;
    font-weight: 400;
    color: var(--wiz-ro-label-color);
    margin-bottom: 0;
    line-height: 1.3;
}

/* Empty state --------------------------------------------------- */
.wiz-recent-orders-empty {
    grid-column: 1 / -1;
    padding: 50px 15px;
    text-align: center;
    color: #888;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
}

/* Skeleton */
@keyframes wiz-ro-shimmer {
    0% {
        background-position: 200% 0;
    }

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

.wiz-ro-skel {
    display: block;
    height: 14px;
    width: 60%;
    max-width: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: wiz-ro-shimmer 1.4s ease-in-out infinite;
}

.wiz-ro-skel[data-field="status"] {
    width: 48%;
}

.wiz-ro-skel[data-field="amount"] {
    width: 36%;
}

.wiz-ro-skel[data-field="order_id"] {
    width: 52%;
}

.wiz-ro-skel[data-field="date"],
.wiz-ro-skel[data-field="channel"] {
    width: 68%;
}

.recent-orders-card.wiz-ro-loading {
    pointer-events: none;
    cursor: default;
    text-decoration: none;
}

/* Responsive ---------------------------------------------------- */
@media (max-width: 480px) {
    .wiz-recent-orders-header {
        align-items: flex-start;
    }

    .wiz-recent-orders-title {
        font-size: 16px;
    }

    .wiz-recent-orders-grid {
        grid-template-columns: 1fr;
    }
}

