/* ==========================================================================
   Store Branding (/store-branding) — assets/js/app/branding.js
   Every rule is scoped to the page wrapper .lp2-br, or to the pop-ups this
   page opens (.lp2-br-zoom, .lp2-br-viewer). The headline card takes its
   colours from the palette chosen on the page (--lp2-h1/2/3 set inline).
   ========================================================================== */

/* ---- Headline card ------------------------------------------------------- */

.lp2-br .lp2-br-hero {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
    padding: 18px 18px 20px; transition: background .3s ease;
}
.lp2-br .lp2-br-hero-main { position: relative; z-index: 1; min-width: 0; }
.lp2-br .lp2-br-hero .sx-hero-chip { gap: 6px; }
.lp2-br .lp2-br-title {
    margin: 14px 0 8px; max-width: 18ch;
    font-family: var(--font-display); font-size: clamp(1.6rem, 7.4vw, 2.35rem); font-weight: 800;
    line-height: 1.04; letter-spacing: -.035em; color: #fff; text-wrap: balance;
}
.lp2-br .lp2-br-title em { font-style: normal; color: var(--br-hi, #fde68a); }
.lp2-br .lp2-br-lead {
    max-width: 52ch; font-size: .86rem; font-weight: 650; line-height: 1.5; color: rgba(255, 255, 255, .92);
}
.lp2-br .lp2-br-link {
    display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; padding: 8px 12px 8px 8px;
    max-width: 440px; border-radius: 14px; background: rgba(0, 0, 0, .18); border: 1px solid rgba(255, 255, 255, .18);
}
.lp2-br .lp2-br-link-ic {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center;
    background: #fff; color: var(--lp2-h1); font-size: 1.1rem;
}
.lp2-br .lp2-br-link-t { display: flex; flex-direction: column; min-width: 0; }
.lp2-br .lp2-br-link-t b { font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.lp2-br .lp2-br-link-t span {
    font-family: var(--font-mono); font-size: .76rem; font-weight: 600; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lp2-br .lp2-br-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.lp2-br .lp2-br-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
    border-radius: 12px; border: 1px solid rgba(255, 255, 255, .32); background: rgba(255, 255, 255, .12);
    color: #fff; font: inherit; font-size: .82rem; font-weight: 800; text-decoration: none; cursor: pointer;
    transition: background .15s ease, transform .12s ease;
}
.lp2-br .lp2-br-btn:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.lp2-br .lp2-br-btn:active { transform: scale(.97); }
.lp2-br .lp2-br-btn.is-solid { background: #fff; border-color: #fff; color: var(--lp2-h1); }
.lp2-br .lp2-br-btn.is-solid:hover { background: #f8fafc; color: var(--lp2-h2); }
.lp2-br .lp2-br-btn:disabled { opacity: .7; cursor: progress; }

/* A fan of three real previews */
.lp2-br .lp2-br-fan { position: relative; height: 210px; margin-top: 10px; pointer-events: none; }
.lp2-br .lp2-br-mini {
    position: absolute; top: 50%; left: 50%; line-height: 0;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .38));
}
.lp2-br .lp2-br-mini svg { display: block; width: 100%; height: 100%; }
.lp2-br .lp2-br-mini.is-story { width: 104px; height: 185px; transform: translate(-150%, -52%) rotate(-9deg); }
.lp2-br .lp2-br-mini.is-flyer { width: 132px; height: 187px; transform: translate(-50%, -50%) rotate(1deg); z-index: 1; }
.lp2-br .lp2-br-mini.is-sticker { width: 110px; height: 110px; transform: translate(42%, -2%) rotate(12deg); z-index: 2; }
.lp2-br .lp2-br-mini.is-story svg, .lp2-br .lp2-br-mini.is-flyer svg { border-radius: 8px; overflow: hidden; }
@media (min-width: 900px) {
    .lp2-br .lp2-br-hero { grid-template-columns: minmax(0, 1fr) 330px; align-items: center; padding: 22px 24px; }
    .lp2-br .lp2-br-fan { height: 250px; margin: 0; }
    .lp2-br .lp2-br-mini.is-story { width: 124px; height: 220px; }
    .lp2-br .lp2-br-mini.is-flyer { width: 160px; height: 227px; }
    .lp2-br .lp2-br-mini.is-sticker { width: 128px; height: 128px; }
}

/* ---- Layout: gallery + customise panel ------------------------------------ */

.lp2-br .lp2-br-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.lp2-br .lp2-br-main, .lp2-br .lp2-br-side { min-width: 0; }
@media (min-width: 1100px) {
    .lp2-br .lp2-br-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
    .lp2-br .lp2-br-side {
        order: 2; position: sticky; top: 86px;
        max-height: calc(100vh - 100px); overflow: auto; scrollbar-width: thin; border-radius: 20px;
    }
}

/* ---- Customise panel ------------------------------------------------------- */

.lp2-br .lp2-br-panel {
    background: #fff; border: 1px solid var(--lp2-line); border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.lp2-br .lp2-br-panel > summary {
    display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none;
}
.lp2-br .lp2-br-panel > summary::-webkit-details-marker { display: none; }
.lp2-br .lp2-br-panel-ic {
    width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
    color: #fff; font-size: 1rem;
    background: linear-gradient(135deg, var(--lp2-h3), var(--lp2-h2));
    box-shadow: 0 8px 16px -10px var(--lp2-h1);
}
.lp2-br .lp2-br-panel-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lp2-br .lp2-br-panel-t b { font-size: .98rem; font-weight: 800; color: #000; }
.lp2-br .lp2-br-panel-t em { font-style: normal; font-size: .74rem; font-weight: 650; color: #475569; }
.lp2-br .lp2-br-panel-sw {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: conic-gradient(var(--a) 0 50%, var(--b) 50% 100%);
    box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px #cbd5e1;
}
.lp2-br .lp2-br-caret { color: #475569; transition: transform .18s ease; }
.lp2-br .lp2-br-panel[open] .lp2-br-caret { transform: rotate(180deg); }
.lp2-br .lp2-br-panel-body { padding: 0 16px 16px; border-top: 1px solid #eef1f5; }
.lp2-br .lp2-br-lbl {
    display: flex; align-items: baseline; gap: 6px; margin: 16px 0 8px;
    font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #334155;
}
.lp2-br .lp2-br-lbl em { font-style: normal; font-weight: 650; letter-spacing: 0; text-transform: none; color: #475569; }
.lp2-br .lp2-br-pals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lp2-br .lp2-br-pal {
    display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0;
    padding: 9px 4px 8px; border-radius: 14px; border: 1px solid var(--lp2-line); background: #fff;
    font: inherit; font-size: .68rem; font-weight: 750; color: #334155; cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.lp2-br .lp2-br-pal > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp2-br .lp2-br-pal:hover { border-color: #94a3b8; }
.lp2-br .lp2-br-pal:active { transform: scale(.96); }
.lp2-br .lp2-br-pal.is-on { border-color: #000; box-shadow: 0 0 0 1px #000; color: #000; }
.lp2-br .lp2-br-sw {
    width: 32px; height: 32px; border-radius: 50%;
    background: conic-gradient(from 225deg, var(--a) 0 50%, var(--b) 50% 100%);
    box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px #cbd5e1;
}
.lp2-br .lp2-br-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lp2-br .lp2-br-color {
    display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; cursor: pointer;
    border: 1px solid var(--lp2-line); border-radius: 999px; background: #fff;
    font-size: .74rem; font-weight: 750; color: #1e293b;
}
body.lp2-app .lp2-br .lp2-br-color input[type="color"] {
    width: 28px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; box-shadow: none;
}
.lp2-br .lp2-br-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.lp2-br .lp2-br-color input[type="color"]::-webkit-color-swatch { border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #cbd5e1; }
.lp2-br .lp2-br-color input[type="color"]::-moz-color-swatch { border: 2px solid #fff; border-radius: 50%; }
.lp2-br .lp2-br-custom-note { font-size: .72rem; font-weight: 600; color: #475569; }
.lp2-br .lp2-br-panel .input-group { margin-bottom: 10px; }
.lp2-br .lp2-br-pt {
    display: flex; align-items: center; gap: 0; margin-bottom: 8px;
    border: 1px solid #dbe2ea; border-radius: 12px; background: #fff; overflow: hidden;
}
.lp2-br .lp2-br-pt:focus-within { border-color: var(--lp2-h3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lp2-h3) 18%, transparent); }
.lp2-br .lp2-br-pt > i {
    width: 40px; flex-shrink: 0; display: grid; place-items: center; align-self: stretch;
    color: var(--lp2-h1); background: color-mix(in srgb, var(--lp2-h3) 9%, #fff); font-size: 1rem;
}
body.lp2-app .lp2-br .lp2-br-pt input {
    flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; border-radius: 0;
    padding: 10px 12px; font-weight: 700; color: #000; background: transparent;
}
.lp2-br .lp2-br-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid #eef1f5;
}
.lp2-br .lp2-br-row.is-col { flex-direction: column; align-items: stretch; gap: 8px; border-bottom: 0; }
.lp2-br .lp2-br-row-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lp2-br .lp2-br-row-t b { font-size: .86rem; font-weight: 800; color: #000; }
.lp2-br .lp2-br-row-t span { font-size: .74rem; font-weight: 600; line-height: 1.45; color: #475569; }
.lp2-br .lp2-br-row-t a { color: var(--lp2-h1); font-weight: 800; }
.lp2-br .lp2-br-seg {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
    border-radius: 12px; background: #f1f4f8; border: 1px solid #e7ebf1;
}
.lp2-br .lp2-br-seg-b {
    min-height: 36px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
    font: inherit; font-size: .8rem; font-weight: 750; color: #334155;
}
.lp2-br .lp2-br-seg-b.is-on { background: #fff; color: #000; box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.lp2-br .lp2-br-reset { margin-top: 12px; width: 100%; justify-content: center; }

/* ---- Type tabs --------------------------------------------------------------- */

.lp2-br .lp2-br-tabs {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; padding: 2px 0;
}
.lp2-br .lp2-br-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 719px) { .lp2-br .lp2-br-tabs { margin-left: -16px; margin-right: -16px; padding: 2px 16px; } }
.lp2-br .lp2-br-tab {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
    border-radius: 999px; border: 1px solid var(--lp2-line); background: #fff; cursor: pointer;
    font: inherit; font-size: .82rem; font-weight: 750; color: #1e293b;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.lp2-br .lp2-br-tab i { color: var(--lp2-h3); }
.lp2-br .lp2-br-tab em {
    font-style: normal; font-size: .68rem; font-weight: 800; min-width: 20px; padding: 1px 6px; border-radius: 999px;
    background: #f1f4f8; color: #334155; text-align: center;
}
.lp2-br .lp2-br-tab:hover { border-color: #94a3b8; color: #000; }
.lp2-br .lp2-br-tab.is-on { background: #000; border-color: #000; color: #fff; }
.lp2-br .lp2-br-tab.is-on i { color: #fff; }
.lp2-br .lp2-br-tab.is-on em { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---- Sections and cards ------------------------------------------------------ */

.lp2-br .lp2-br-sec { margin: 0 0 22px; }
.lp2-br .lp2-br-sec[hidden] { display: none; }
.lp2-br .lp2-br-sec-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.lp2-br .lp2-br-sec-ic {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    color: #fff; font-size: 1.05rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--c) 86%, #fff), color-mix(in srgb, var(--c) 78%, #000));
    box-shadow: 0 8px 16px -10px var(--c);
}
.lp2-br .lp2-br-sec-t { font-size: 1.05rem; font-weight: 800; color: #000; letter-spacing: -.01em; }
.lp2-br .lp2-br-sec-s { font-size: .76rem; font-weight: 600; color: #475569; line-height: 1.4; }

.lp2-br .lp2-br-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 600px) { .lp2-br .lp2-br-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .lp2-br .lp2-br-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.lp2-br .lp2-br-card {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    background: #fff; border: 1px solid var(--lp2-line); border-radius: 22px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px -20px rgba(15, 23, 42, .25);
    transition: box-shadow .2s ease, transform .2s ease;
}
@media (hover: hover) { .lp2-br .lp2-br-card:hover { box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 18px 34px -20px rgba(15, 23, 42, .35); } }
.lp2-br .lp2-br-stage {
    position: relative; display: grid; place-items: center; height: 280px; padding: 20px; width: 100%;
    border: 0; border-bottom: 1px solid #eef1f5; cursor: zoom-in; font: inherit;
    background:
        radial-gradient(120% 90% at 50% 0%, #fff 0%, transparent 60%),
        linear-gradient(0deg, rgba(15, 23, 42, .035) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px) 0 0 / 22px 22px,
        #eef2f6;
}
.lp2-br .lp2-br-card.is-banner .lp2-br-stage { background-color: #e9eef4; }
.lp2-br .lp2-br-stage svg {
    display: block; width: 100%; height: 100%;
    filter: drop-shadow(0 12px 16px rgba(15, 23, 42, .2)) drop-shadow(0 2px 3px rgba(15, 23, 42, .12));
    transition: transform .25s ease;
}
@media (hover: hover) { .lp2-br .lp2-br-stage:hover svg { transform: scale(1.025); } }
.lp2-br .lp2-br-stage:focus-visible { outline: 3px solid var(--lp2-h3); outline-offset: -3px; }
.lp2-br .lp2-br-zoomhint {
    position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 10px;
    display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: #1e293b;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .16); font-size: .85rem;
}
.lp2-br .lp2-br-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 14px 16px 16px; }
.lp2-br .lp2-br-name { font-size: 1rem; font-weight: 800; color: #000; letter-spacing: -.01em; }
.lp2-br .lp2-br-desc { font-size: .78rem; font-weight: 600; line-height: 1.45; color: #475569; }
.lp2-br .lp2-br-spec {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%;
    padding: 4px 10px; border-radius: 999px; background: #f1f4f8;
    font-size: .7rem; font-weight: 750; color: #334155;
}
.lp2-br .lp2-br-spec span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp2-br .lp2-br-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lp2-br .lp2-br-chip {
    display: inline-flex; align-items: baseline; gap: 5px; min-height: 34px; padding: 6px 12px;
    border-radius: 10px; border: 1px solid var(--lp2-line); background: #fff; cursor: pointer;
    font: inherit; font-size: .78rem; font-weight: 800; color: #1e293b;
}
.lp2-br .lp2-br-chip em { font-style: normal; font-size: .68rem; font-weight: 650; color: #475569; }
.lp2-br .lp2-br-chip.is-on { border-color: var(--lp2-h1); background: color-mix(in srgb, var(--lp2-h3) 10%, #fff); color: #000; box-shadow: 0 0 0 1px var(--lp2-h1); }
.lp2-br .lp2-br-acts { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
body.lp2-app .lp2-br .lp2-br-acts .btn {
    min-height: 46px; border-radius: 14px; font-weight: 800; justify-content: center; white-space: nowrap;
}
body.lp2-app .lp2-br .lp2-br-acts .lp2-br-dl { flex: 1 1 auto; min-width: 0; }
body.lp2-app .lp2-br .lp2-br-acts .lp2-br-alt { flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }
body.lp2-app .lp2-br .lp2-br-acts .lp2-br-share { flex: 0 0 46px; width: 46px; padding: 0; }
.lp2-br .lp2-br-acts .btn[hidden] { display: none; }
@media (max-width: 380px) { body.lp2-app .lp2-br .lp2-br-acts .lp2-br-alt { padding-left: 10px; padding-right: 10px; } }

.lp2-br .lp2-br-tips ul { margin: 6px 0 0; padding-left: 18px; }
.lp2-br .lp2-br-tips li { margin: 4px 0; }

/* ---- Pop-ups (outside the page wrapper) -------------------------------------- */

.lp2-br-zoom {
    display: grid; place-items: center; padding: 14px; border-radius: 16px;
    background: linear-gradient(0deg, rgba(15, 23, 42, .035) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px) 0 0 / 22px 22px, #eef2f6;
}
.lp2-br-zoom svg {
    display: block; width: 100%; height: auto; max-height: 64vh;
    filter: drop-shadow(0 14px 20px rgba(15, 23, 42, .22));
}
.lp2-br-zoom.is-tall svg { height: 64vh; width: 100%; }
.lp2-br-zoom-acts { display: flex; gap: 8px; margin-top: 14px; }
.lp2-br-zoom-acts .btn { flex: 1; justify-content: center; min-height: 46px; border-radius: 14px; font-weight: 800; }
.lp2-br-viewer { display: flex; flex-direction: column; gap: 12px; }
.lp2-br-viewer img {
    display: block; max-width: 100%; max-height: 56vh; margin: 0 auto; border-radius: 12px;
    box-shadow: 0 12px 28px -12px rgba(15, 23, 42, .35); background: #eef2f6;
}
.lp2-br-viewer p { margin: 0; font-size: .86rem; font-weight: 600; line-height: 1.5; color: #334155; }
.lp2-br-viewer-file {
    display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: #f1f4f8;
    font-size: .9rem; color: #000; overflow-wrap: anywhere;
}
.lp2-br-viewer-file i { font-size: 1.6rem; color: #dc2626; }
.lp2-br-viewer-acts { display: flex; gap: 8px; }
.lp2-br-viewer-acts .btn { flex: 1; justify-content: center; min-height: 46px; border-radius: 14px; font-weight: 800; }

/* Customising is not on the plan (Admin → Packages → Store Branding): the
   panel still opens so people see what they would get, dimmed, with a lock. */
.lp2-br-panel.is-locked .lp2-br-panel-body { opacity: .55; }
.lp2-br-panel.is-locked .lp2-br-panel-t b i { font-size: .8em; margin-left: 4px; color: #b45309; }
