/* Photo-first product page (decision 218): the product with the customer's photos, an upload button, and the
   photos uploaded. Light by default; dark when the theme's switch puts dd-dark on <html>, like the editors. */
.cpd-photo {
    --cpd-ph-bg: light-dark(#ffffff, #111827);
    --cpd-ph-ink: light-dark(#111827, #f3f4f6);
    --cpd-ph-muted: light-dark(#4b5563, #9ca3af);
    --cpd-ph-line: light-dark(#e5e7eb, #374151);
    --cpd-ph-accent: light-dark(#be185d, #f472b6);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-block-end: 24px;
    color: var(--cpd-ph-ink);
}
:where(html.dd-dark) .cpd-photo { --cpd-ph-bg: #111827; --cpd-ph-ink: #f3f4f6; --cpd-ph-muted: #9ca3af; --cpd-ph-line: #374151; --cpd-ph-accent: #f472b6; }
.cpd-photo-stage {
    border: 1px solid var(--cpd-ph-line);
    border-radius: 16px;
    overflow: hidden;
    background: #f3f4f6;
    color-scheme: light;
}
.cpd-photo-stage canvas { display: block; width: 100%; height: auto; }
.cpd-photo-panel { display: flex; flex-direction: column; gap: 12px; }
.cpd-photo-title { margin: 0; font-size: 1.5rem; line-height: 1.25; }
.cpd-photo-sub, .cpd-photo-tip { margin: 0; color: var(--cpd-ph-muted); }
.cpd-photo-tip { font-size: 0.9rem; }
/* Decision 299: three short photo tips, and the line that a person checks every photo. */
.cpd-photo-tips { margin: 0; padding-inline-start: 1.2em; color: var(--cpd-ph-muted); font-size: 0.9rem; display: grid; gap: 2px; }
.cpd-photo-trust { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--cpd-ph-line); font-size: 0.9rem; font-weight: 600; }
.cpd-photo-upload {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--cpd-ph-accent);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
}
.cpd-photo-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.cpd-photo-upload:has(input:focus-visible) { outline: 3px solid var(--cpd-ph-ink); outline-offset: 2px; }
.cpd-photo-upload:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.cpd-photo-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cpd-photo-list:empty { display: none; }
.cpd-photo-item { position: relative; }
.cpd-photo-item img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--cpd-ph-line);
}
.cpd-photo-remove {
    position: absolute;
    inset-block-start: -6px;
    inset-inline-end: -6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    background: var(--cpd-ph-ink);
    color: var(--cpd-ph-bg);
    font-size: 16px;
    line-height: 26px;
    cursor: pointer;
}
.cpd-photo-notice {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: light-dark(#fdf2f8, #3b0a24);
    color: var(--cpd-ph-ink);
}
.cpd-photo-notice[hidden] { display: none; }
@media (max-width: 782px) {
    .cpd-photo { grid-template-columns: 1fr; gap: 16px; }
    .cpd-photo-stage { max-width: 420px; margin-inline: auto; width: 100%; }
}
/* Decision 219: the mug turning in 3D; its flat print shows only when 3D cannot load. */
.cpd-photo-3d { width: 100%; aspect-ratio: 10 / 9; }
.cpd-photo-3d canvas { display: block; width: 100% !important; height: 100% !important; touch-action: pan-y; }
.cpd-photo-3d[hidden], .cpd-photo-stage canvas[hidden] { display: none; }
.cpd-photo-choice { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.cpd-photo-choice legend { width: 100%; margin-block-end: 4px; font-weight: 600; }
.cpd-photo-choice label {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px;
    border: 2px solid var(--cpd-ph-line); border-radius: 10px; cursor: pointer;
}
.cpd-photo-choice label:has(input:checked) { border-color: var(--cpd-ph-accent); }
.cpd-photo-choice label:has(input:focus-visible) { outline: 3px solid var(--cpd-ph-ink); outline-offset: 2px; }
/* Decision 220: the branded sock's fields. */
.cpd-brand-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cpd-brand-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.cpd-brand-field input[type="text"], .cpd-brand-field select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--cpd-ph-line); border-radius: 8px; background: var(--cpd-ph-bg); color: var(--cpd-ph-ink); }
.cpd-brand-field input[type="color"] { width: 100%; height: 44px; padding: 2px; border: 1px solid var(--cpd-ph-line); border-radius: 8px; background: var(--cpd-ph-bg); }
.cpd-photo-upload[hidden], .cpd-photo-list[hidden] { display: none; }
/* The faces sock's look (owner, 2026-11-27): the style buttons, and colour swatches for plain and collage. */
.cpd-photo-choice label[hidden], .cpd-face-bgs[hidden] { display: none; }
.cpd-face-bgs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; border: 0; }
.cpd-face-bgs legend { width: 100%; margin-block-end: 4px; font-weight: 600; }
.cpd-face-bg {
    position: relative; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    background: var(--cpd-swatch); border: 2px solid var(--cpd-ph-line); box-sizing: border-box;
}
.cpd-face-bg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cpd-face-bg:has(input:checked) { outline: 3px solid var(--cpd-ph-accent); outline-offset: 2px; }
.cpd-face-bg:has(input:focus-visible) { outline: 3px solid var(--cpd-ph-ink); outline-offset: 2px; }
