/* Poke Watch lab — Pokemon Center restock tracker.
   Mobile-first (≤720px = 1 col, >720px = auto-fit grid).
   Uses global tokens from css/styles.css; module-local overrides only. */

.poke-watch {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

/* ── Banner zone (Phase 3 JS populates) ───────────────────── */

.poke-watch-banner-zone {
    min-height: 0;
}

.poke-watch-banner-zone:empty {
    display: none;
}

.poke-watch-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #e2faea, #ffffff);
    border: 1px solid #5ad17a;
    border-radius: 12px;
    padding: 12px 40px 12px 16px;   /* extra right padding for absolute X */
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(90, 209, 122, 0.18);
    animation: poke-watch-slide-in 220ms ease-out;
}

@keyframes poke-watch-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.poke-watch-banner-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
}

.poke-watch-banner-body {
    flex: 1;
    min-width: 0;
}

.poke-watch-banner-title {
    font-weight: 700;
    color: #2a7a3a;
    margin: 0 0 2px;
    font-size: 0.95rem;
}

.poke-watch-banner-name {
    color: var(--text-primary, #2a2d30);
    margin: 0;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poke-watch-banner-dismiss {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: #2a7a3a;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poke-watch-banner-dismiss:hover,
.poke-watch-banner-dismiss:focus {
    background: rgba(90, 209, 122, 0.18);
}

/* ── Top control bar (email link / browser-notify / test sound) ─ */

.poke-watch-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.poke-watch-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 38px;
    padding: 0 14px;
    box-sizing: border-box;
    width: auto;                            /* defeat global form 300px */
    background: #ffffff;
    color: var(--text-primary, #2a2d30);
    border: 1px solid var(--border-soft, #dcdfe6);
    border-radius: 999px;
    /* Reset browser defaults on <button> elements so the action chip
       lines up to the same height as anchor / label / span chips. */
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    transition: background 0.12s ease, color 0.12s ease,
                border-color 0.12s ease, box-shadow 0.12s ease;
}

.poke-watch-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
}

.poke-watch-chip-link {
    color: var(--color-primary, #3a59d1);
    border-color: var(--color-primary, #3a59d1);
}

.poke-watch-chip-link:hover,
.poke-watch-chip-link:focus {
    background: var(--color-primary, #3a59d1);
    color: #ffffff;
}

.poke-watch-chip-hint {
    color: var(--text-secondary, #555);
    font-weight: 500;
    cursor: default;
    font-style: italic;
}

.poke-watch-chip-toggle {
    user-select: none;
}

.poke-watch-chip-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary, #3a59d1);
}

.poke-watch-chip-toggle:has(input:checked) {
    background: var(--color-primary-soft, #eef2ff);
    border-color: var(--color-primary, #3a59d1);
    color: var(--color-primary, #3a59d1);
}

.poke-watch-chip-action {
    background: var(--color-primary, #3a59d1);
    color: #ffffff;
    border-color: var(--color-primary, #3a59d1);
    box-shadow: 0 1px 2px rgba(58, 89, 209, 0.18);
}

.poke-watch-chip-action:hover,
.poke-watch-chip-action:focus {
    background: #2e47a8;
    border-color: #2e47a8;
    box-shadow: 0 2px 6px rgba(58, 89, 209, 0.28);
}

.poke-watch-chip-action:active {
    transform: translateY(1px);
}

/* ── Summary bar ──────────────────────────────────────────── */

.poke-watch-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--color-primary-soft, #f0f4ff);
    border-radius: 10px;
}

.poke-watch-summary-stat {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.poke-watch-summary-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary, #3a59d1);
    line-height: 1;
}

.poke-watch-summary-num.poke-watch-instock {
    color: #2a7a3a;
}

.poke-watch-summary-label {
    color: var(--text-secondary, #555);
    font-size: 0.9rem;
}

/* Always-visible watcher status pill. Color tier (.is-fresh / .is-slow /
   .is-delayed / .is-offline) follows the snapshot age. Sits on the right
   of the summary bar; never stretches to fill the row. */
.poke-watch-summary-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.poke-watch-summary-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.poke-watch-summary-status-age {
    font-weight: 500;
    opacity: 0.85;
}

.poke-watch-summary-status.is-fresh {
    color: #2a7a3a;
    background: #e2faea;
    border-color: #9be0b0;
}

.poke-watch-summary-status.is-slow {
    color: #8a6500;
    background: #fff7d6;
    border-color: #ead27a;
}

.poke-watch-summary-status.is-delayed {
    color: #9a4400;
    background: #fff0dc;
    border-color: #ffc88a;
}

.poke-watch-summary-status.is-offline {
    color: #a02323;
    background: #fde5e5;
    border-color: #f0a8a8;
}

/* ── Empty state ──────────────────────────────────────────── */

.poke-watch-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary, #555);
}

.poke-watch-empty h2 {
    margin: 0 0 0.5rem;
    color: var(--text-primary, #2a2d30);
}

.poke-watch-empty p {
    margin: 0;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Product grid ─────────────────────────────────────────── */

.poke-watch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.poke-watch-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.poke-watch-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.poke-watch-card.is-sold-out {
    opacity: 0.72;
}

.poke-watch-card.is-sold-out:hover {
    opacity: 1;
}

.poke-watch-card-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.poke-watch-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.poke-watch-card-image-placeholder {
    font-size: 3rem;
    color: #ccc;
    user-select: none;
}

.poke-watch-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.poke-watch-pill-in {
    background: #5ad17a;
    color: #ffffff;
    box-shadow: 0 0 0 2px #ffffff, 0 2px 6px rgba(90, 209, 122, 0.4);
}

.poke-watch-pill-out {
    background: #c1c1c1;
    color: #ffffff;
    box-shadow: 0 0 0 2px #ffffff;
}

.poke-watch-card-name {
    padding: 8px 10px 10px;
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--text-primary, #2a2d30);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Mobile (≤720px) ──────────────────────────────────────── */

@media (max-width: 720px) {
    .poke-watch {
        padding: 0.75rem 0.75rem 2rem;
    }

    .poke-watch-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .poke-watch-controls {
        gap: 0.45rem;
        margin-bottom: 1rem;
    }

    .poke-watch-chip {
        height: 34px;
        padding: 0 11px;
        font-size: 0.82rem;
        gap: 0.4rem;
    }

    .poke-watch-summary {
        gap: 0.5rem;
        padding: 0.4rem 0.6rem;
        margin-bottom: 0.85rem;
        font-size: 0.85rem;
    }

    .poke-watch-summary-num {
        font-size: 1.15rem;
    }

    .poke-watch-summary-label {
        font-size: 0.78rem;
    }

    .poke-watch-summary-status {
        font-size: 0.72rem;
        padding: 3px 8px;
        gap: 0.35rem;
    }

    .poke-watch-summary-status-dot {
        width: 6px;
        height: 6px;
    }

    .poke-watch-banner {
        padding: 10px 12px;
        gap: 10px;
    }

    .poke-watch-banner-img {
        width: 48px;
        height: 48px;
    }

    .poke-watch-banner-name {
        font-size: 0.88rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}
