/* Storage-condo site plan: shared by availability.html and admin.html */

.plan { display: flex; gap: 14px; align-items: stretch; }

.plan-street {
    flex: 0 0 28px; display: flex; align-items: center; justify-content: center;
    border-right: 1px dashed rgba(212,216,220,0.18);
}
.plan-street span {
    writing-mode: vertical-rl; transform: rotate(180deg);
    font-size: 10px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; color: var(--muted);
}

.plan-canvas-wrap { flex: 1; min-width: 0; container-type: inline-size; }
/* 1 foot on the plan. Building A is 16 × 32 ft = 512 ft wide, plus 15 gaps. */
.plan-canvas { --gap: 3px; --ft: calc((100cqw - 15 * var(--gap)) / 512); }

.plan-label {
    font-size: 9px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
    color: var(--muted); margin-bottom: 8px;
    display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.plan-label::before, .plan-label::after {
    content: ''; flex: 1; height: 1px; background: rgba(201,164,74,0.18); min-width: 8px;
}

.plan-grid { display: grid; grid-template-columns: repeat(var(--cols), auto); gap: var(--gap); justify-content: start; }

/* Open space between Building A and the lower buildings */
.plan-aisle { height: calc(30 * var(--ft)); min-height: 18px; }

.plan-bottom { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }/* Everything is drawn to true scale (same feet-per-pixel for every building), and the
   lower buildings spread out like the site plan: B flush left, C flush right, D & E evenly between. */

/* ── Unit cell ─────────────────────────────── */
.pu {
    --type: var(--gold);
    position: relative; overflow: hidden;
    width: calc(var(--cw) * var(--ft)); height: calc(var(--ch) * var(--ft));
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 4px;
    font-family: 'Montserrat', sans-serif; color: var(--neutral); text-align: center;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(201,164,74,0.22); border-radius: 3px;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s, opacity .2s, transform .15s;
}
.pu::before { /* type colour bar */
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--type); opacity: .85;
}
.pu-a { --type: #E3C14F; }
.pu-b { --type: #D9705F; }
.pu-c { --type: #6DBB7A; }
.pu-d { --type: #5DB0D8; }
.pu-e { --type: #A98BD0; }

.pu:hover { border-color: var(--gold); background: rgba(201,164,74,0.09); box-shadow: 0 0 16px rgba(201,164,74,0.22); }
.pu:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.pu-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pu-num { font-family: 'Cormorant Garamond', serif; font-size: 21px; font-weight: 700; line-height: 1; color: var(--white); }
.pu-chip {
    font-size: 9px; font-weight: 800; letter-spacing: 1px; line-height: 1;
    padding: 3px 6px; border-radius: 3px;
    color: #1E2530; background: var(--type);
}
.pu-meta { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.2; }
.pu-dims { font-size: 11px; font-weight: 600; letter-spacing: .3px; color: var(--neutral); }
.pu-sqft { font-size: 9.5px; font-weight: 500; letter-spacing: .3px; color: var(--muted); white-space: nowrap; }

/* Landscape cells (lower buildings): number + type chip on one line, size underneath */
.pu-land { gap: 4px; padding: 6px 6px 4px; }
.pu-land .pu-head { flex-direction: row; gap: 7px; }

.pu-flag:empty { display: none; }
.pu-flag {
    position: absolute; right: 3px; bottom: 3px;
    font-size: 7.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; line-height: 1;
    padding: 3px 5px; border-radius: 2px;
}
.pu-port .pu-flag { left: 3px; right: 3px; letter-spacing: .8px; }
.pu-land .pu-flag { position: static; padding: 3px 5px; }
.pu-land.is-sold .pu-chip, .pu-land.is-pending .pu-chip { display: none; }

.pu.is-sold { opacity: .42; border-style: dashed; border-color: rgba(212,216,220,0.35); background: rgba(255,255,255,0.015); }
.pu.is-sold::before { background: rgba(212,216,220,0.3); }
.pu.is-sold .pu-chip { background: rgba(212,216,220,0.45); }
.pu.is-sold .pu-flag { background: rgba(212,216,220,0.85); color: #1E2530; }
.pu.is-sold:hover { opacity: .7; }

.pu.is-pending { border-color: #E8963A; background: rgba(232,150,58,0.08); }
.pu.is-pending .pu-flag { background: #E8963A; color: #1E2530; }

.pu.is-selected {
    opacity: 1; border: 2px solid var(--gold-bright); background: rgba(201,164,74,0.16);
    box-shadow: 0 0 0 3px rgba(201,164,74,0.25), 0 0 26px rgba(201,164,74,0.45);
}

/* Smaller plans: tighten type so true-scale cells stay legible (sized off the plan's own width) */
@container (max-width: 1220px) {
    .pu-num { font-size: 18px; }
    .pu-dims { font-size: 10px; }
    .pu-sqft { font-size: 8.5px; }
    .pu { gap: 4px; }
    .pu-land { gap: 2px; padding: 5px 4px 2px; }
}
@container (max-width: 1120px) {
    .pu-num { font-size: 16px; }
    .pu-land .pu-meta { gap: 0; }
    .pu-chip { padding: 2px 5px; }
}

/* Building labels: full name normally, short name once the plan gets small */
.pl-short { display: none; }

/* ── Tablet-size plan: number + type chip; sold/pending becomes a thin bar ── */
@container (max-width: 1020px) {
    .pu-meta { display: none; }
    .pu-land .pu-head { gap: 6px; }
    .pu-flag, .pu-port .pu-flag, .pu-land .pu-flag {
        position: absolute; left: 0; right: 0; bottom: 0; top: auto;
        height: 4px; padding: 0; border-radius: 0; font-size: 0; letter-spacing: 0;
    }
    .pu-land.is-sold .pu-chip, .pu-land.is-pending .pu-chip { display: inline-block; }
}
@container (max-width: 760px) {
    .plan-label { font-size: 8px; letter-spacing: 2px; gap: 6px; }
    .pl-full { display: none; }
    .pl-short { display: inline; }
}

/* ── Phone-size plan: same layout, number only, box filled with its type colour ── */
@container (max-width: 600px) {
    .plan-canvas { --gap: 2px; }
    .plan-label { font-size: 7px; letter-spacing: 1px; gap: 4px; margin-bottom: 4px; }
    .plan-label::before, .plan-label::after { min-width: 3px; }
    .plan-bottom { gap: 4px; }

    .pu, .pu-land { padding: 0; gap: 0; border-radius: 2px; border-color: transparent; background: var(--type); opacity: .85; }
    .pu::before, .pu-chip, .pu-flag { display: none; }
    .pu-num { font-family: 'Montserrat', sans-serif; font-size: 8px; font-weight: 700; color: #1E2530; letter-spacing: -.2px; }
    .pu:hover { background: var(--type); opacity: 1; box-shadow: none; }
    .pu.is-sold { background: transparent; opacity: .6; border: 1px dashed rgba(212,216,220,0.55); }
    .pu.is-sold .pu-num { color: var(--muted); }
    .pu.is-pending { background: rgba(232,150,58,0.22); opacity: 1; border: 1.5px solid #E8963A; }
    .pu.is-pending .pu-num { color: #F2B36B; }
    .pu.is-selected { background: var(--gold-bright); opacity: 1; border: 1px solid #fff; box-shadow: 0 0 0 2px rgba(201,164,74,0.55), 0 0 14px rgba(201,164,74,0.6); }
    .pu.is-selected .pu-num { color: #1E2530; }
}

/* Street strip narrows on phones (it sits outside the plan's own container) */
@media (max-width: 640px) {
    .plan { gap: 6px; }
    .plan-street { flex-basis: 13px; }
    .plan-street span { font-size: 7px; letter-spacing: 2px; }
}

@media (prefers-reduced-motion: reduce) { .pu { transition: none; } }
