/* A product's designs page (/product/{slug}/designs) and its design popup. */

.pd-wrap { --pd-blue: #0e7fa8; --pd-ink: #1f2937; --pd-mute: #5b6472; --pd-line: #e3e6eb; max-width: 1400px; margin: 0 auto; padding: 18px 24px 64px; color: var(--pd-ink); }
.pd-wrap svg, .pd-modal svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pd-message { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.pd-message a { color: #0e7fa8; text-decoration: underline; }

.pd-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--pd-mute); margin-bottom: 14px; }
.pd-crumbs a { color: var(--pd-mute); }
.pd-crumbs a:hover { color: var(--pd-blue); text-decoration: underline; }

.pd-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.pd-head h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 6px; }
.pd-head p { color: var(--pd-mute); margin: 0; }
.pd-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-btn-ghost { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid #cfd4db; background: #fff; font-weight: 600; font-size: 14px; color: var(--pd-ink); transition: border-color .15s, background .15s; white-space: nowrap; }
.pd-btn-ghost:hover { border-color: var(--pd-blue); color: var(--pd-blue); }

.pd-layout { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; }
/* Columns never stretched by their contents (the phone's one-row style chips widened the whole page). */
.pd-layout > * { min-width: 0; }
.pd-filters { position: sticky; top: calc(var(--dp-site-head, 80px) + 12px); display: flex; flex-direction: column; }
.pd-filters h2 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--pd-mute); margin: 20px 0 10px; }
.pd-search { position: relative; }
.pd-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8a919c; }
.pd-search input { width: 100%; height: 44px; border: 1px solid #cfd4db; border-radius: 12px; padding: 0 12px 0 38px; font-size: 14px; outline: none; background: #fff; }
.pd-search input:focus { border-color: var(--pd-blue); box-shadow: 0 0 0 3px rgba(14, 127, 168, .15); }
.pd-colours { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.pd-colour { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 8px; border-radius: 9px; font-size: 13.5px; text-align: left; color: var(--pd-ink); cursor: pointer; }
.pd-colour i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); flex: none; }
.pd-colour:hover { background: #f1f3f6; }
.pd-colour.is-on { background: #e6f3f8; font-weight: 700; }
.pd-colour.is-on i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pd-blue); }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-chip { border: 1px solid #cfd4db; background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--pd-ink); transition: border-color .15s, background .15s; }
.pd-chip:hover { border-color: #9aa3ae; }
.pd-chip.is-on { background: var(--pd-blue); border-color: var(--pd-blue); color: #fff; }
.pd-clear { align-self: flex-start; margin-top: 16px; border: 0; background: none; color: var(--pd-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }

.pd-count { color: var(--pd-mute); font-size: 13.5px; margin: 0 0 12px; min-height: 18px; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.pd-tile { position: relative; display: block; min-width: 0; border-radius: 14px; background: #eef0f3; padding: 22px 18px; transition: box-shadow .2s, transform .2s, background .2s; }
.pd-tile-pic { display: flex; align-items: center; justify-content: center; min-height: 120px; }
/* A long thin product (a wristband) is shorter than the minimum height: cropped to it, never stretched. */
.pd-tile-pic img { width: 100%; height: auto; display: block; box-shadow: 0 4px 14px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12); background: #fff; min-height: 60px; object-fit: cover; }
.pd-tile-go { position: absolute; left: 50%; bottom: 10px; transform: translate(-50%, 6px); opacity: 0; background: var(--pd-blue); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 16px; border-radius: 999px; box-shadow: 0 4px 12px rgba(14, 127, 168, .35); transition: opacity .2s, transform .2s; white-space: nowrap; pointer-events: none; }
.pd-tile-no { display: block; margin-top: 10px; text-align: center; font-size: 12px; font-weight: 600; color: #475569; }
.pd-quick-no { margin: -8px 0 0; font-size: 13px; font-weight: 600; color: #475569; }
.pd-tile:hover { background: #e6eaef; box-shadow: 0 8px 26px rgba(15, 23, 42, .12); }
.pd-tile:hover .pd-tile-pic .bp-wire-box { transform: translateY(-3px) scale(1.02); }
.pd-tile:hover .pd-tile-no { opacity: 0; }
.pd-tile:hover .pd-tile-go { opacity: 1; transform: translate(-50%, 0); }
.pd-tile:focus-visible { outline: 3px solid var(--pd-blue); outline-offset: 2px; }
.pd-loading { display: flex; justify-content: center; padding: 28px; }
.pd-none { text-align: center; padding: 40px 0; color: var(--pd-mute); }
.pd-more { height: 1px; }
.pd-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #d9e8ee; border-top-color: #0e7fa8; animation: pd-spin .8s linear infinite; }
@keyframes pd-spin { to { transform: rotate(360deg); } }
.pd-offscreen { position: fixed; left: -10000px; top: 0; width: 600px; height: 400px; visibility: hidden; pointer-events: none; }

/* The popup */
.pd-modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; padding: 20px; animation: pd-fade .15s ease-out; }
@keyframes pd-fade { from { opacity: 0; } to { opacity: 1; } }
.pd-modal { --pd-blue: #0e7fa8; --pd-mute: #5b6472; position: relative; width: min(1080px, 100%); max-height: calc(100dvh - 40px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 24px 70px rgba(15, 23, 42, .3); display: grid; grid-template-columns: 1.3fr 1fr; color: #1f2937; animation: pd-rise .22s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes pd-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.pd-modal-x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #f1f3f6; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.pd-modal-x:hover { background: #e5e8ec; }
.pd-quick-pic { background: #eef0f3; padding: 44px 36px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; perspective: 1600px; }
.pd-flip-in { width: min(100%, 520px); transform-style: preserve-3d; animation: pd-card-in 1s cubic-bezier(.2, .8, .2, 1); }
@keyframes pd-card-in { 0% { transform: rotateY(-40deg) rotateX(14deg) translateY(18px) scale(.9); opacity: 0; } 45% { opacity: 1; } 100% { transform: none; } }
.pd-flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, .8, .3, 1); user-select: none; }
.pd-blank-back { color: #9aa1ab; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.pd-drag-hint { font-size: 12px; color: #5b6472; margin-top: -8px; }
.pd-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; box-shadow: 0 18px 40px rgba(15, 23, 42, .25), 0 2px 6px rgba(15, 23, 42, .15); }
.pd-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-face-2 { transform: rotateY(180deg); }
.pd-seg { display: inline-flex; background: #fff; border-radius: 10px; padding: 3px; gap: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.pd-seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--pd-mute); cursor: pointer; }
.pd-seg button.is-on { background: var(--pd-blue); color: #fff; }
/* Mock-ups: the design on the product's photos, picked from a strip under the card */
.pd-mock-big { width: 100%; max-width: 520px; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 12px 40px rgba(15, 23, 42, .18); }
.pd-mock-big > div { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pd-mock-strip { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; max-width: 100%; }
.pd-mock-strip button { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; color: #5b6472; }
.pd-mock-strip button > img, .pd-mock-thumb { width: 84px; height: 64px; border-radius: 10px; border: 2px solid transparent; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); object-fit: contain; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pd-mock-thumb > span { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pd-mock-strip button.is-on > img, .pd-mock-strip button.is-on .pd-mock-thumb { border-color: #0e7fa8; }
.pd-mock-strip button.is-on { color: #0a6587; }
.pd-mock-strip span:last-child { max-width: 84px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-quick-side { padding: 34px 30px 26px; display: flex; flex-direction: column; gap: 14px; }
.pd-quick-side h2 { font-size: 24px; font-weight: 900; letter-spacing: -.01em; margin: 0 40px 0 0; line-height: 1.15; }
.pd-price { font-size: 24px; font-weight: 800; margin: -4px 0 4px; }
.pd-price span { font-size: 13px; font-weight: 500; color: var(--pd-mute); margin-left: 6px; }
.pd-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--pd-mute); }
.pd-field select { height: 44px; border: 1px solid #cfd4db; border-radius: 10px; padding: 0 12px; font-size: 14.5px; font-weight: 500; color: #1f2937; background: #fff; }
.pd-field select:focus { border-color: var(--pd-blue); outline: none; box-shadow: 0 0 0 3px rgba(14, 127, 168, .15); }
.pd-btn-primary { display: flex; align-items: center; justify-content: center; height: 52px; border-radius: 999px; background: var(--pd-blue); color: #fff !important; font-weight: 800; font-size: 16px; margin-top: 6px; box-shadow: 0 4px 14px rgba(14, 127, 168, .35); transition: background .15s, transform .12s; }
.pd-btn-primary:hover { background: #0b6c90; }
.pd-btn-primary:active { transform: scale(.98); }
.pd-small { font-size: 13px; color: var(--pd-mute); margin: 0; }
.pd-quick-side h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--pd-mute); margin: 10px 0 0; }
.pd-like { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pd-like a { background: #eef0f3; border-radius: 10px; padding: 8px; display: flex; align-items: center; justify-content: center; transition: box-shadow .15s; }
.pd-like a:hover { box-shadow: 0 0 0 2px var(--pd-blue); }
.pd-like img { width: 100%; height: auto; display: block; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); min-height: 30px; object-fit: cover; }

@media (max-width: 900px) {
    .pd-layout { grid-template-columns: 1fr; gap: 16px; }
    .pd-filters { position: static; }
    .pd-colours { grid-template-columns: repeat(6, 1fr); }
    .pd-colour span { display: none; }
    .pd-colour { justify-content: center; padding: 6px; }
    .pd-modal { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .pd-wrap { padding: 12px 16px 48px; }
    .pd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .pd-tile { padding: 12px 10px; border-radius: 12px; }
    .pd-tile-pic { min-height: 80px; }
    .pd-tile-go { display: none; }
    .pd-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
    .pd-chips::-webkit-scrollbar { display: none; }
    .pd-chip { flex: none; }
    .pd-filters h2 { margin: 14px 0 8px; }
    .pd-head-actions { width: 100%; }
    .pd-btn-ghost { flex: 1; justify-content: center; padding: 0 10px; font-size: 13px; }
    .pd-modal-back { padding: 0; align-items: flex-end; }
    .pd-modal { border-radius: 20px 20px 0 0; max-height: 94dvh; }    .pd-quick-pic { padding: 52px 20px 16px; }
    .pd-quick-side { padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); }
}

/* Create your own design: always the first tile */
.pd-tile-own { width: 100%; border: 0; cursor: pointer; font: inherit; color: inherit; text-align: center; }
.pd-own-pic {
    position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px;
    color: var(--pd-blue); transition: transform .25s;
}
.pd-own-pic > * { position: relative; }
.pd-own-pic > .pd-own-shape { position: absolute; inset: 0; background: #fff; border: 2px dashed #9fb7c4; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); transition: border-color .15s; }
.pd-own-pic svg { width: 30px; height: 30px; stroke-width: 2.2; }
.pd-own-pic strong { font-size: 15px; font-weight: 800; color: var(--pd-ink); }
.pd-own-pic small { font-size: 12.5px; color: var(--pd-mute); }
.pd-tile-own:hover .pd-own-pic { transform: translateY(-3px); }
.pd-tile-own:hover .pd-own-shape { border-color: var(--pd-blue); }

/* Two-sided: Your card, a design for each side */
.pd-layout.has-card { grid-template-columns: 250px 1fr 236px; }
.pd-card {
    position: sticky; top: calc(var(--dp-site-head, 80px) + 12px); display: flex; flex-direction: column; gap: 12px;
    background: #fff; border: 1px solid var(--pd-line); border-radius: 16px; padding: 16px; box-shadow: 0 4px 18px rgba(15, 23, 42, .06);
}
.pd-card h2 { font-size: 16px; font-weight: 800; margin: 0; }
.pd-card-hint { font-size: 13px; color: var(--pd-mute); margin: 0; }
.pd-slots { display: flex; flex-direction: column; gap: 10px; }
.pd-slot { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--pd-mute); }
.pd-slot-pic {
    width: 100%; max-width: 170px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f3f5f7;
    border: 2px dashed #c4cbd3; color: var(--pd-mute); font-size: 12.5px; font-weight: 600; text-align: center; padding: 6px; transition: border-color .15s, box-shadow .15s;
}
.pd-slot-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-slot-pic:has(img) { padding: 0; border-style: solid; border-color: transparent; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .15); }
.pd-slot.is-on .pd-slot-pic { border: 2px solid var(--pd-blue); box-shadow: 0 0 0 3px rgba(14, 127, 168, .2); }
.pd-slot-name { font-size: 13px; font-weight: 800; color: var(--pd-ink); }
.pd-slot.is-on .pd-slot-name { color: #0a6587; }
.pd-slot-what { font-size: 12px; margin-top: -3px; }
.pd-back-options { display: flex; flex-direction: column; gap: 6px; }
.pd-back-options button {
    border: 1px solid #cfd4db; background: #fff; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 600;
    color: var(--pd-ink); text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
}
.pd-back-options button:hover { border-color: var(--pd-blue); }
.pd-back-options button.is-on { border-color: var(--pd-blue); background: #e6f3f8; color: #0a6587; }
.pd-card .pd-btn-primary { height: 46px; font-size: 14px; padding: 0 14px; margin-top: 2px; border: 0; cursor: pointer; width: 100%; white-space: nowrap; letter-spacing: 0; }
.pd-card .pd-btn-primary:disabled { background: #e6f3f8; color: #0a6587 !important; box-shadow: inset 0 0 0 2px #9fcfe2; cursor: default; }
.pd-card-small { font-size: 12px; color: var(--pd-mute); margin: -4px 0 0; text-align: center; }
.pd-card .pd-btn-primary.is-ready { animation: pd-ready .9s ease; }
@keyframes pd-ready { 0% { transform: scale(.94); } 45% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(14, 127, 168, .22); } 100% { transform: none; } }
.pd-btn-link { border: 0; background: none; color: #0a6587; font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 0; align-self: center; }

/* Smaller screens: the card sits along the bottom, the two sides side by side. */
@media (max-width: 1100px) {
    .pd-layout.has-card { grid-template-columns: 250px 1fr; }
    .pd-wrap:has(.pd-card) { padding-bottom: 210px; }
    .pd-card {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 150; border-radius: 18px 18px 0 0; border-bottom: 0;
        display: grid; grid-template-columns: auto 1fr; grid-template-areas: "slots go" "slots opts"; align-content: start; gap: 6px 14px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(15, 23, 42, .15);
    }
    .pd-card h2 { display: none; }
    .pd-card-hint { grid-area: hint; margin: 0; align-self: end; }
    .pd-slots { grid-area: slots; flex-direction: row; gap: 10px; }
    .pd-slot-pic { width: 92px; }
    .pd-slot-what { display: none; }
    .pd-back-options { grid-area: opts; flex-direction: row; flex-wrap: wrap; }
    .pd-back-options button { padding: 6px 10px; font-size: 12.5px; }
    .pd-card .pd-btn-primary { grid-area: go; }
    .pd-card-small { display: none; }
}
@media (max-width: 900px) {
    .pd-layout.has-card { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .pd-card { grid-template-columns: 1fr; grid-template-areas: "go" "slots" "opts"; }
    .pd-slots { justify-content: center; }
    .pd-slot-pic { width: 84px; }
    .pd-wrap:has(.pd-card) { padding-bottom: 300px; }
}
/* The side being chosen stands out: a solid panel round it. */
.pd-slot { padding: 10px 10px 8px; border-radius: 14px; transition: background .15s, box-shadow .15s; }
.pd-slot.is-on { background: #d7ecf4; box-shadow: inset 0 0 0 2px var(--pd-blue); }
.pd-slot.is-on .pd-slot-pic { background: #fff; }
.pd-slot:not(.is-on):hover { background: #f1f3f6; }
.pd-slot-now { order: -1; align-self: center; margin-bottom: 2px; background: var(--pd-blue); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
@media (max-width: 1100px) {
    .pd-slot { padding: 6px; }
    .pd-slot-now { display: none; }
}

/* Search with the Filter button beside it; on phones colour and style fold away behind the button. */
.pd-search-row { display: flex; gap: 8px; align-items: stretch; }
.pd-search-row .pd-search { flex: 1; min-width: 0; }
.pd-filter-toggle { display: none; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid #cfd4db; border-radius: 12px; background: #fff;
    font: inherit; font-size: 14px; font-weight: 700; color: var(--pd-ink); cursor: pointer; white-space: nowrap; }
.pd-filter-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.pd-filter-toggle b { font-weight: 700; }
.pd-filter-toggle span { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--pd-blue); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.pd-filter-toggle.is-on { border-color: var(--pd-blue); color: #0a6587; background: #e6f3f8; }
@media (max-width: 640px) {
    .pd-filter-toggle { display: inline-flex; }
    .pd-filter-more { display: none; }
    .pd-filter-more.is-open { display: block; animation: pd-filters-in .2s ease-out; }
}
@keyframes pd-filters-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* A bound product (a wire notebook): its wire (drawn once, designPicker.wireOverlay) over every picture of a design. */
.bp-wire-box { position: relative; display: block; width: 100%; transition: transform .25s; }
.bp-wired .bp-wire-box::after,
.bp-wired .pd-face::after { content: ""; position: absolute; inset: 0; background: var(--bp-wire) 0 0 / 100% 100% no-repeat; pointer-events: none; }
.bp-wired.bp-wire-mirror .pd-face-2::after { transform: scaleX(-1); }
