/* ============================================================
   SIA Cart Countdown  -  v1.0.53
   Per-item cart TTL UI: header bar + per-row badges.
   ============================================================ */

/* ---- Removed-items notice (shown once when items were cleaned up) ---- */
.sia-cc-notice {
    margin: 0 0 16px 0;
}

/* ---- Header bar (soonest-to-expire summary) ---- */
.sia-cc {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 0 20px 0;
    background: #fff7ed;                 /* orange-50 */
    border: 1px solid #fed7aa;           /* orange-200 */
    border-left: 4px solid #F97316;      /* orange-500 */
    border-radius: 8px;
    color: #7c2d12;                      /* orange-900 */
    font-size: 14px;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.sia-cc__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #F97316;
}

.sia-cc__text {
    flex: 1 1 auto;
}

.sia-cc .sia-cc__time,
.sia-cc-row .sia-cc__time {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    margin: 0 2px;
    min-width: 3ch;
    text-align: center;
}

.sia-cc .sia-cc__time {
    color: #9a3412;                      /* orange-800 */
}

/* Header warning state (<= 1h) */
.sia-cc.is-warning {
    background: #fff1f2;
    border-color: #fecdd3;
    border-left-color: #f43f5e;
    color: #881337;
}
.sia-cc.is-warning .sia-cc__icon,
.sia-cc.is-warning .sia-cc__time {
    color: #f43f5e;
}

/* Header critical state (<= 15min) */
.sia-cc.is-critical {
    background: #fee2e2;
    border-color: #fca5a5;
    border-left-color: #dc2626;
    color: #7f1d1d;
    animation: sia-cc-pulse 1.5s ease-in-out infinite;
}
.sia-cc.is-critical .sia-cc__icon,
.sia-cc.is-critical .sia-cc__time {
    color: #dc2626;
}

.sia-cc.is-expired {
    background: #f3f4f6;
    border-color: #e5e7eb;
    border-left-color: #6b7280;
    color: #374151;
    animation: none;
}
.sia-cc.is-expired .sia-cc__icon {
    color: #6b7280;
}

@keyframes sia-cc-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.25); }
    50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* ---- Per-row line-item badge ---- */
.sia-cc-row {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 500;
}

.sia-cc-row .sia-cc__time {
    color: inherit;
    font-size: 12px;
    min-width: auto;
}

.sia-cc-row.is-warning {
    color: #f43f5e;
    background: #fff1f2;
    border-color: #fecdd3;
}

.sia-cc-row.is-critical {
    color: #dc2626;
    background: #fee2e2;
    border-color: #fca5a5;
}

.sia-cc-row.is-expired {
    opacity: 0.55;
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

/* Checkout review table has less horizontal room; put the badge on its own line */
.sia-cc-row--checkout {
    display: block;
    margin-top: 4px;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .sia-cc.is-critical {
        animation: none;
    }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .sia-cc {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
        font-size: 13px;
    }
    .sia-cc-row {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* ============================================================
   v1.0.58  -  WooCommerce Blocks cart/checkout integration
   Overrides for badges injected by cart-countdown-blocks.js
   ============================================================ */

/* Header bar injected above .wp-block-woocommerce-cart: give it some
   breathing room inside block containers that set their own padding. */
.sia-cc[data-sia-cc-injected="block"] {
    margin: 16px 0;
}

/* Per-row badge injected next to .wc-block-components-product-name.
   Appears inline with the product title in block carts, so style it
   as a compact inline chip rather than the block-level pill that the
   classic cart uses. */
.sia-cc-row--block {
    display: inline-block;
    margin: 4px 0 0 0;
    padding: 2px 8px;
    background: #fff7ed;
    color: #7c2d12;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
    white-space: nowrap;
    vertical-align: middle;
}

.sia-cc-row--block.sia-cc--warn {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.sia-cc-row--block.sia-cc--danger {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: #fca5a5;
    animation: sia-cc-pulse 1.2s ease-in-out infinite;
}

.sia-cc-row--block.sia-cc--expired {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: #fca5a5;
    opacity: 0.85;
}

/* Respect reduced-motion on the danger-state pulse. */
@media (prefers-reduced-motion: reduce) {
    .sia-cc-row--block.sia-cc--danger {
        animation: none;
    }
}
