/* ===== Cart2Cook self-playing demo player =====
   Ported from the design canvas (Cart2Cook Demo.dc.html / DemoPlayer.dc.html).
   Reads brand colors from tokens.css where possible; a few one-off values
   from the design (category chip colors, phone chrome) are kept literal
   since they aren't part of the shared token set. */

.c2c-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.c2c-demo-phone {
    position: relative;
    width: 390px;
    height: 760px;
    background: #fff;
    border-radius: 38px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .16), 0 0 0 9px #14150f, 0 0 0 10px #2c2e26;
    overflow: hidden;
    transform-origin: top center;
    flex-shrink: 0;
}

.c2c-demo-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 22px 5px;
    font: 600 13px system-ui, -apple-system, sans-serif;
    color: #12130f;
    background: #fff;
}
.c2c-demo-statusbar span:last-child { letter-spacing: 2px; }

.c2c-demo-screen {
    height: 726px;
    background: #fbfaf8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.c2c-demo-view { display: none; flex-direction: column; height: 100%; overflow: hidden; }
.c2c-demo-view.is-active { display: flex; }

/* ---- AI assistant view ---- */
.c2c-demo-ai-header {
    padding: 10px 20px 12px;
    background: #fff;
    border-bottom: 1px solid #eeece7;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.c2c-demo-ai-header .brand { font: 700 17px system-ui, sans-serif; color: #12130f; letter-spacing: -.01em; }
.c2c-demo-ai-header .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #e8f2ec; color: var(--color-primary, #1a6e4a);
    font: 700 12px system-ui, sans-serif;
    display: flex; align-items: center; justify-content: center;
}
.c2c-demo-ai-body { flex: 1; overflow: hidden; padding: 22px 20px 0; }
.c2c-demo-ai-scroll { transition: transform .45s cubic-bezier(.4, .9, .3, 1); }
.c2c-demo-ai-scroll h1 { margin: 0 0 8px; font: 700 27px/1.2 system-ui, sans-serif; color: #12130f; letter-spacing: -.025em; }
.c2c-demo-ai-scroll > p { margin: 0 0 18px; font: 400 14px/1.55 system-ui, sans-serif; color: #6b7280; max-width: 300px; }

.c2c-demo-modes { display: inline-flex; gap: 3px; padding: 3px; background: #f1efe9; border-radius: 999px; margin-bottom: 12px; }
.c2c-demo-mode { border-radius: 999px; padding: 8px 16px; font: 600 12.5px system-ui, sans-serif; transition: background .2s ease, color .2s ease; }
.c2c-demo-mode.is-on { background: #fff; color: #12130f; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.c2c-demo-mode:not(.is-on) { background: transparent; color: #8b8578; }

.c2c-demo-field-card { background: #fff; border: 1px solid #e5e3dd; border-radius: 16px; padding: 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
.c2c-demo-field {
    min-height: 78px; border: 1.5px solid #d9d6ce; border-radius: 11px; padding: 13px 14px;
    font: 400 15px/1.45 system-ui, sans-serif; color: #b3aea2; background: #fdfdfc;
    transition: border-color .2s ease;
}
.c2c-demo-field.is-focused { border-color: var(--color-primary, #1a6e4a); }
.c2c-demo-field.has-text { color: #12130f; }
.c2c-demo-caret { display: inline-block; width: 2px; height: 17px; background: var(--color-primary, #1a6e4a); vertical-align: -3px; margin-left: 1px; }
.c2c-demo-cta {
    margin-top: 11px; background: var(--color-primary, #1a6e4a); color: #fff; border-radius: 11px;
    padding: 14px; text-align: center; font: 700 15px system-ui, sans-serif;
    box-shadow: 0 4px 12px rgba(26, 110, 74, .26); transition: opacity .3s ease;
}

.c2c-demo-thinking { margin-top: 16px; display: flex; align-items: center; gap: 9px; font: 500 13px system-ui, sans-serif; color: #9a9689; }
.c2c-demo-thinking .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary, #1a6e4a); }
.c2c-demo-thinking span.label { margin-left: 2px; }

.c2c-demo-recipe {
    margin-top: 16px; background: #fff; border: 1px solid #e5e3dd; border-radius: 16px; overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .07); transition: transform .3s ease, opacity .3s ease;
}
.c2c-demo-recipe-photo {
    height: 96px; position: relative;
    background: repeating-linear-gradient(135deg, #f2f1ee, #f2f1ee 6px, #e9e7e2 6px, #e9e7e2 12px);
}
.c2c-demo-chip {
    position: absolute; bottom: 9px; left: 11px; display: flex; align-items: center; gap: 5px;
    padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .94);
    font: 600 10.5px system-ui, sans-serif; color: #3f4149;
}
.c2c-demo-chip .dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22); }
.c2c-demo-recipe-body { padding: 13px 14px 14px; }
.c2c-demo-recipe-body h3 { margin: 0 0 3px; font: 600 15.5px/1.3 system-ui, sans-serif; color: #12130f; }
.c2c-demo-recipe-meta { font: 400 12.5px system-ui, sans-serif; color: #9a9689; }
.c2c-demo-recipe-actions { margin-top: 12px; display: flex; gap: 8px; }
.c2c-demo-recipe-actions .save {
    flex: 1; background: var(--color-primary, #1a6e4a); color: #fff; border-radius: 11px;
    padding: 12px; text-align: center; font: 700 14px system-ui, sans-serif;
}

/* ---- Grid (My recipes) view ---- */
.c2c-demo-grid-header { padding: 10px 20px 12px; background: #fff; border-bottom: 1px solid #eeece7; }
.c2c-demo-grid-header .title { font: 700 20px system-ui, sans-serif; color: #12130f; letter-spacing: -.02em; }
.c2c-demo-grid-header .sub { font: 400 12.5px system-ui, sans-serif; color: #9a9689; margin-top: 1px; }
.c2c-demo-grid-body { flex: 1; overflow: hidden; padding: 16px 16px 0; }
.c2c-demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.c2c-demo-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid #e9e7e1; border-radius: 16px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); transition: outline-color .2s ease;
}
.c2c-demo-card.is-picked { outline: 2px solid var(--color-primary, #1a6e4a); }
.c2c-demo-card-photo { position: relative; width: 100%; aspect-ratio: 4/3; background: repeating-linear-gradient(135deg, #f2f1ee, #f2f1ee 6px, #e9e7e2 6px, #e9e7e2 12px); }
.c2c-demo-card-tick {
    position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center;
    font: 700 13px system-ui, sans-serif; color: #fff; background: rgba(255, 255, 255, .85);
}
.c2c-demo-card.is-picked .c2c-demo-card-tick { background: var(--color-primary, #1a6e4a); }
.c2c-demo-card-cat { position: absolute; bottom: 8px; left: 8px; }
.c2c-demo-card-body { padding: 11px 12px 13px; }
.c2c-demo-card-body h3 { margin: 0 0 4px; font: 600 14px/1.3 system-ui, sans-serif; color: #12130f; }
.c2c-demo-card-meta { font: 400 11.5px system-ui, sans-serif; color: #9a9689; }
.c2c-demo-grid-footer { padding: 12px 16px 22px; background: linear-gradient(transparent, #fbfaf8 30%); }
.c2c-demo-list-cta {
    background: var(--color-primary, #1a6e4a); color: #fff; border-radius: 14px; padding: 15px 18px;
    display: flex; align-items: center; justify-content: space-between; box-shadow: 0 6px 18px rgba(26, 110, 74, .3);
}
.c2c-demo-list-cta .t1 { font: 700 15.5px system-ui, sans-serif; }
.c2c-demo-list-cta .t2 { font: 400 12px system-ui, sans-serif; opacity: .8; margin-top: 1px; }

/* ---- Shopping list view ---- */
.c2c-demo-list-header { padding: 12px 20px 14px; background: #fff; border-bottom: 1px solid #eeece7; }
.c2c-demo-list-header .row { display: flex; align-items: center; justify-content: space-between; }
/* Title + "Source" pill (product redesign) — replaces the old title/subtitle
   stack; the "From N recipes · M items" line now lives in the progress
   meta row below instead of sitting under the title. */
.c2c-demo-list-header .title-group { display: flex; align-items: center; gap: 8px; }
.c2c-demo-list-header .title { font: 700 20px system-ui, sans-serif; color: #12130f; letter-spacing: -.02em; }
.c2c-demo-list-header .source {
    display: flex; align-items: center; gap: 5px;
    border: 1px solid #e5e3dd; border-radius: 10px; padding: 6px 10px;
    font: 600 12px system-ui, sans-serif; color: #4b5563;
}
.c2c-demo-list-header .source-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: #6b7280; color: #fff; font: 700 10px system-ui, sans-serif;
}
.c2c-demo-list-header .share { border: 1px solid #e5e3dd; border-radius: 10px; padding: 7px 12px; font: 600 12.5px system-ui, sans-serif; color: #4b5563; }
.c2c-demo-progress-meta-row { margin-top: 13px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.c2c-demo-progress-meta-row .meta { font: 600 12px system-ui, sans-serif; color: #9a9689; }
.c2c-demo-progress-track { margin-top: 6px; height: 7px; background: #eeece7; border-radius: 999px; overflow: hidden; }
.c2c-demo-progress-fill { height: 100%; background: var(--color-primary, #1a6e4a); border-radius: 999px; transition: width .4s ease; }
.c2c-demo-progress-count { font: 600 12px system-ui, sans-serif; color: var(--color-primary, #1a6e4a); white-space: nowrap; }

.c2c-demo-list-body { flex: 1; overflow: hidden; }
.c2c-demo-list-scroll { transition: transform .6s cubic-bezier(.4, .9, .3, 1); }
.c2c-demo-aisle { padding: 14px 20px 6px; display: flex; align-items: center; gap: 9px; }
.c2c-demo-aisle .swatch { width: 11px; height: 11px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22); }
.c2c-demo-aisle .name { font: 700 11.5px system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase; color: #3f4149; }
.c2c-demo-aisle .count { font: 500 11.5px system-ui, sans-serif; color: #b3aea2; }
.c2c-demo-item { display: flex; align-items: center; gap: 14px; padding: 13px 20px; background: #fff; border-top: 1px solid #f2f0eb; min-height: 54px; }
.c2c-demo-item .box {
    width: 26px; height: 26px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center;
    font: 700 14px system-ui, sans-serif; color: #fff; border: 2px solid #d9d6ce; background: transparent;
    transition: background .2s ease, border-color .2s ease;
}
.c2c-demo-item.is-done .box { background: var(--color-primary, #1a6e4a); border-color: var(--color-primary, #1a6e4a); }
.c2c-demo-item .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 500 15px system-ui, sans-serif; color: #12130f; }
.c2c-demo-item .qty { font: 600 13.5px system-ui, sans-serif; color: #9a9689; }
.c2c-demo-item.is-done .name, .c2c-demo-item.is-done .qty { color: #b3aea2; text-decoration: line-through; }
.c2c-demo-list-footer { padding: 10px 16px 22px; background: linear-gradient(transparent, #fbfaf8 30%); }
.c2c-demo-shop-cta { background: #12130f; color: #fff; border-radius: 13px; padding: 14px; text-align: center; font: 600 14.5px system-ui, sans-serif; }

/* ---- Tab bar ---- */
.c2c-demo-tabbar { background: #fff; border-top: 1px solid #eeece7; padding: 9px 12px 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.c2c-demo-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; color: #9a9689; transition: color .2s ease; }
.c2c-demo-tab.is-active { color: var(--color-primary, #1a6e4a); }
.c2c-demo-tab .icon { font: 400 19px system-ui, sans-serif; }
.c2c-demo-tab .label { font: 600 11px system-ui, sans-serif; }

.c2c-demo-home-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; display: flex; justify-content: center; align-items: center; pointer-events: none; }
.c2c-demo-home-bar div { width: 134px; height: 5px; background: #000; border-radius: 3px; }

/* ---- Ghost cursor ---- */
.c2c-demo-cursor { position: absolute; top: 0; left: 0; width: 0; height: 0; transition: transform .42s cubic-bezier(.3, 1.3, .4, 1); pointer-events: none; z-index: 9; }
.c2c-demo-ripple {
    position: absolute; left: -19px; top: -19px; width: 38px; height: 38px; border-radius: 50%;
    background: rgba(26, 110, 74, .22); border: 1.5px solid rgba(26, 110, 74, .5);
    transition: transform .32s ease-out, opacity .32s ease-out;
}
.c2c-demo-fingertip {
    position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%;
    background: rgba(18, 19, 15, .5); box-shadow: 0 2px 8px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: transform .13s ease;
}

/* ---- Toast ---- */
.c2c-demo-toast {
    position: absolute; left: 18px; right: 18px; top: 86px; background: #12130f; color: #fff; border-radius: 13px;
    padding: 14px 16px; display: flex; align-items: center; gap: 11px; box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
    transition: transform .3s ease, opacity .3s ease; opacity: 0; pointer-events: none;
}
.c2c-demo-toast .check {
    width: 24px; height: 24px; border-radius: 50%; background: var(--color-primary, #1a6e4a);
    display: flex; align-items: center; justify-content: center; font: 700 13px system-ui, sans-serif; flex-shrink: 0;
}
.c2c-demo-toast .t1 { font: 700 14px system-ui, sans-serif; }
.c2c-demo-toast .t2 { font: 400 12px system-ui, sans-serif; opacity: .65; margin-top: 1px; }

/* ---- Steps rail ---- */
.c2c-demo-rail { display: flex; flex-direction: column; gap: 8px; }
.c2c-demo-step {
    cursor: pointer; display: flex; gap: 13px; align-items: flex-start; padding: 12px 14px; border-radius: 13px;
    background: transparent; border: 1px solid transparent; transition: background .25s ease, border-color .25s ease;
    text-align: left; width: 100%; font-family: inherit;
}
.c2c-demo-step.is-active { background: #fff; border-color: #e5e3dd; }
.c2c-demo-step-num {
    width: 24px; height: 24px; min-width: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font: 700 11.5px system-ui, sans-serif; background: #eef1ec; color: #9a9689; transition: background .2s ease, color .2s ease;
}
.c2c-demo-step.is-active .c2c-demo-step-num { background: var(--color-primary, #1a6e4a); color: #fff; }
.c2c-demo-step-title { font: 600 14.5px system-ui, sans-serif; color: #6b7280; transition: color .2s ease; }
.c2c-demo-step.is-active .c2c-demo-step-title { color: #12130f; }
.c2c-demo-step-sub { font: 400 12.5px/1.5 system-ui, sans-serif; color: #8b8578; margin-top: 2px; }
.c2c-demo-step-bar { height: 2px; background: #eeece7; border-radius: 2px; margin-top: 9px; overflow: hidden; opacity: 0; }
.c2c-demo-step.is-active .c2c-demo-step-bar { opacity: 1; }
.c2c-demo-step-bar-fill { height: 100%; background: var(--color-primary, #1a6e4a); width: 0%; }

/* ---- Compact (landing page) sizing ----
   transform:scale() shrinks the phone visually but not its layout box (still
   760px tall), which would otherwise leave a dead gap below it. Pull the
   next sibling up by the space the scale-down removed (760px * (1-.62)). */
.c2c-demo.is-compact .c2c-demo-phone { transform: scale(.62); margin-bottom: -288.8px; }
.c2c-demo.is-compact .c2c-demo-rail { width: 340px; margin-top: -268px; }
/* Full-size (e.g. /demo page): real breathing room above and below the
   phone itself, not just before the rail — margin-bottom here plus the
   rail's own margin-top add up to the total phone-to-rail gap. */
.c2c-demo:not(.is-compact) .c2c-demo-phone { margin: 24px 0; }
.c2c-demo:not(.is-compact) .c2c-demo-rail { width: 390px; margin-top: 16px; }
.c2c-demo.is-compact { pointer-events: none; } /* muted/decorative on the landing page */

@media (max-width: 420px) {
    .c2c-demo:not(.is-compact) .c2c-demo-phone { transform: scale(.86); }
    .c2c-demo:not(.is-compact) .c2c-demo-rail { width: 335px; margin-top: -90px; }
}
