.single-product .swp-product-summary form.cart:has(.cc-head-dialog) {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 0;
}
.cc-head-launch {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #dce4e0;
    color: #303735;
    font-family: var(--wp--preset--font-family--jost, sans-serif);
    letter-spacing: 0;
}
.cc-head-launch p { margin: 0; }
.cc-head-launch strong, .cc-head-launch span { display: block; }
.cc-head-launch strong { font-size: 15px; font-weight: 550; line-height: 1.35; }
.cc-head-launch span { margin-top: 3px; color: #68716e; font-size: 13px; line-height: 1.45; }
.cc-head-open { align-self: flex-start; justify-self: start; }
.cc-head-open,
.cc-head-footer .single_add_to_cart_button.button {
    display: inline-flex !important;
    width: auto !important;
    min-width: 158px;
    height: 44px !important;
    min-height: 44px !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 22px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #2f7d71 !important;
    color: #fff !important;
    box-shadow: none !important;
    cursor: pointer;
    font: 550 15px/1 var(--wp--preset--font-family--jost, sans-serif) !important;
    letter-spacing: 0 !important;
}
.cc-head-open:hover, .cc-head-footer .single_add_to_cart_button.button:hover { background: #25665c !important; }
.swp-product-summary form.cart:has(.cc-head-dialog) > .quantity,
.swp-product-summary form.cart:has(.cc-head-dialog) > p:has(.single_add_to_cart_button) { display: none !important; }

.cc-head-dialog {
    --head-ink: #303735;
    --head-muted: #68716e;
    --head-line: #dce4e0;
    --head-accent: #2f7d71;
    width: min(1240px, calc(100% - 40px));
    height: min(930px, calc(100dvh - 32px));
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--head-line);
    border-radius: 8px;
    background: #fff;
    color: var(--head-ink);
    font: 400 15px/1.4 var(--wp--preset--font-family--jost, sans-serif);
    letter-spacing: 0;
}
.cc-head-dialog::backdrop { background: rgb(30 41 37 / 42%); }
.cc-head-dialog:not([open]), .cc-head-dialog [hidden] { display: none !important; }
.cc-head-dialog *, .cc-head-dialog *::before, .cc-head-dialog *::after { box-sizing: border-box; }
.cc-head-dialog :is(button, input, textarea) { font-family: inherit; letter-spacing: 0; }
.cc-head-dialog :is(button, input, textarea, label):focus-visible { outline: 2px solid var(--head-accent); outline-offset: 2px; }
.cc-head-builder { display: flex; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0; flex-direction: column; overflow: hidden; }
.cc-head-builder p { margin: 0; }
.cc-head-header { display: flex; min-height: 70px; align-items: center; justify-content: space-between; flex: 0 0 auto; padding: 14px 22px; border-bottom: 1px solid var(--head-line); background: #fff; }
.cc-head-header h2 { margin: 0; font-size: 21px; font-weight: 550; line-height: 1.25; }
.cc-head-header p { margin-top: 3px; color: var(--head-muted); font-size: 12px; }
.cc-head-icon-button { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--head-ink); box-shadow: none; cursor: pointer; }
.cc-head-icon-button:hover { background: #eff4f1; }
.cc-head-icon-button span { font: 400 28px/1 Arial, sans-serif; }
.cc-head-modal-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 500px); min-height: 0; flex: 1; }
.cc-head-preview-panel { display: flex; min-width: 0; min-height: 0; align-items: flex-start; justify-content: center; padding: 28px; overflow-y: auto; border-right: 1px solid var(--head-line); background: #f3f6f4; }
.cc-head-preview { display: grid; width: min(100%, 620px, calc(100dvh - 270px)); margin: auto 0; gap: 10px; }
.cc-head-stage { position: relative; display: grid; width: 100%; aspect-ratio: 1; place-items: center; overflow: hidden; border: 1px solid var(--head-line); border-radius: 6px; background: #fff; box-shadow: 0 6px 24px rgb(30 41 37 / 7%); }
.cc-head-crop-frame { position: absolute; z-index: 3; left: 50%; top: 48%; display: grid; width: 74%; height: 82%; transform: translate(-50%, -50%); place-items: center; border: 2px dashed var(--head-accent); border-radius: 4px; background: transparent; pointer-events: none; }
.cc-head-crop-outline { position: absolute; z-index: 3; inset: 2px; border: 1px solid #fff; border-radius: 2px; pointer-events: none; }
.cc-head-crop-label { position: absolute; z-index: 4; right: 0; bottom: 10px; left: 0; color: #4e5d58; font-size: 11px; font-weight: 500; text-align: center; pointer-events: none; }
.cc-head-photo-layer { position: absolute; z-index: 2; left: var(--photo-x, 50%); top: var(--photo-y, 50%); width: var(--photo-base-width, 62%); transform: translate(-50%, -50%) scale(var(--photo-scale, 1)); transform-origin: center; border: 1px solid var(--head-accent); background: transparent; cursor: move; touch-action: none; user-select: none; }
.cc-head-photo-layer.is-dragging { cursor: grabbing; }
.cc-head-photo-layer:focus-visible { outline: 2px solid var(--head-accent); outline-offset: 3px; }
.cc-head-photo-preview { display: block; width: 100% !important; max-width: none !important; height: 100% !important; object-fit: contain; pointer-events: none; user-select: none; }
.cc-head-photo-resize { position: absolute; z-index: 6; display: block; width: 15px; height: 15px; min-width: 15px; min-height: 15px; margin: 0; padding: 0; border: 2px solid var(--head-accent); border-radius: 2px; background: #fff; box-shadow: 0 1px 4px rgb(30 41 37 / 18%); touch-action: none; }
.cc-head-photo-resize.is-top-left { top: -8px; left: -8px; cursor: nwse-resize; }
.cc-head-photo-resize.is-top-right { top: -8px; right: -8px; cursor: nesw-resize; }
.cc-head-photo-resize.is-bottom-left { bottom: -8px; left: -8px; cursor: nesw-resize; }
.cc-head-photo-resize.is-bottom-right { right: -8px; bottom: -8px; cursor: nwse-resize; }
.cc-head-photo-resize:hover, .cc-head-photo-resize.is-resizing { background: #e9f4f0; }
.cc-head-reset-photo { position: absolute; z-index: 7; top: 12px; right: 12px; min-height: 34px; margin: 0; padding: 0 11px; border: 1px solid var(--head-line); border-radius: 5px; background: #fff; color: var(--head-ink); box-shadow: 0 2px 8px rgb(30 41 37 / 10%); cursor: pointer; font-size: 12px; font-weight: 500; }
.cc-head-reset-photo:hover { border-color: var(--head-accent); color: var(--head-accent); }
.cc-head-preview-note { color: var(--head-muted); font-size: 11px; line-height: 1.4; text-align: center; }
.cc-head-preview-file { position: fixed !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }

.cc-head-controls { min-width: 0; padding: 22px; overflow-y: auto; overscroll-behavior: contain; }
.cc-head-intro { margin: 0 0 20px !important; color: var(--head-muted); font-size: 13px; line-height: 1.45; }
.cc-head-field { display: block; min-width: 0; margin: 0 0 20px; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--head-line); }
.cc-head-field > label, .cc-head-builder legend, .cc-head-details h3 { display: block; margin: 0 0 9px; padding: 0; font-size: 15px; font-weight: 550; line-height: 1.35; }
.cc-head-muted { color: var(--head-muted); font-size: 13px; font-weight: 400; }
.cc-head-hint { margin-top: 7px !important; color: var(--head-muted); font-size: 12px; line-height: 1.4; }
.cc-head-upload-field { margin-bottom: 22px; padding: 15px 16px 16px; border: 1px solid #d9e5e0; border-radius: 6px; background: #f7faf8; }
.cc-head-file { position: relative; display: flex; min-width: 0; align-items: center; gap: 10px; }
.cc-head-file input[type=file] { position: fixed !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; opacity: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; }
.cc-head-file-button { display: inline-flex !important; min-width: 132px; height: 44px; align-items: center; justify-content: center; flex: 0 0 auto; margin: 0 !important; padding: 0 18px; border: 1px solid var(--head-accent); border-radius: 6px; background: var(--head-accent); color: #fff; cursor: pointer; font-size: 14px !important; font-weight: 600 !important; transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.cc-head-file-button:hover { border-color: #236c61; background: #236c61; }
.cc-head-file:has(input:focus-visible) .cc-head-file-button { outline: 2px solid #fff; outline-offset: -4px; box-shadow: 0 0 0 2px var(--head-accent); }
.cc-head-filename { min-width: 0; overflow: hidden; color: var(--head-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
#cc-head-photo-status[data-state="success"] { padding: 8px 10px; border-left: 3px solid var(--head-accent); background: #edf7f3; color: #25665c; font-weight: 500; }
#cc-head-photo-status[data-state="error"] { color: #a53a2a; }

.cc-head-style-options, .cc-head-size-options, .cc-head-options { display: grid; gap: 8px; }
.cc-head-style-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc-head-style-options > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.cc-head-size-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cc-head-options.is-tier-20 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cc-head-options.is-tier-mid, .cc-head-options.is-tier-48 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cc-head-choice { position: relative; display: flex; min-width: 0; min-height: 62px; align-items: flex-start; gap: 8px; margin: 0; padding: 11px 10px; overflow: hidden; border: 1px solid var(--head-line); border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 400; line-height: 1.3; }
.cc-head-choice:hover { border-color: var(--head-accent); }
.cc-head-choice:has(:checked) { border-color: var(--head-accent); background: #f0f7f4; box-shadow: inset 0 0 0 1px var(--head-accent); }
.cc-head-choice input[type=radio] { appearance: auto; flex: 0 0 14px; width: 14px; height: 14px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--head-accent); box-shadow: none; }
.cc-head-choice > span { min-width: 0; overflow-wrap: anywhere; }
.cc-head-choice strong { display: block; font-size: 14px; font-weight: 550; }
.cc-head-choice small { display: block; margin-top: 3px; color: var(--head-muted); font-size: 12px; }
.cc-head-choice small:empty { display: none; }
.cc-head-size { min-height: 88px; }
.cc-head-count { min-height: 68px; }
.cc-head-count strong, .cc-head-count small { white-space: nowrap; }
.cc-head-count strong { font-size: 13px; }
.cc-head-choice.is-disabled { opacity: .48; background: #f5f5f5; cursor: not-allowed; }

.cc-head-builder input[type=email], .cc-head-builder input[type=tel], .cc-head-builder textarea { width: 100%; min-width: 0; min-height: 42px; margin: 0; padding: 8px 11px; border: 1px solid var(--head-line); border-radius: 6px; background: #fff; color: var(--head-ink); box-shadow: none; font-size: 15px; line-height: 1.4; }
.cc-head-builder textarea { min-height: 78px; resize: vertical; }
.cc-head-details { margin: 0; padding: 0; border: 0; }
.cc-head-details h3 { margin-bottom: 0; }
.cc-head-details > .cc-head-hint { margin-top: 4px !important; }
.cc-head-contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.cc-head-contact .cc-head-field, .cc-head-details > .cc-head-field { margin: 0; padding: 0; border: 0; }
.cc-head-contact .cc-head-field > label, .cc-head-details > .cc-head-field > label { margin-bottom: 6px; font-size: 13px; }

.cc-head-footer { display: flex; min-height: 76px; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 18px; padding: 12px 22px; border-top: 1px solid var(--head-line); background: #fff; }
.cc-head-total { display: flex; align-items: center; gap: 16px; }
.cc-head-total span { display: block; font-size: 12px; font-weight: 500; }
.cc-head-total-caption { display: block; margin-top: 1px; color: var(--head-muted); font-size: 11px; }
.cc-head-total output { color: var(--head-accent); font-size: 25px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.cc-head-footer-actions { display: flex; align-items: center; gap: 8px; }
.cc-head-secondary { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; margin: 0; padding: 0 13px; border: 1px solid var(--head-line); border-radius: 5px; background: #fff; color: var(--head-ink); box-shadow: none; cursor: pointer; font-size: 13px; font-weight: 500; }
.cc-head-secondary:hover { border-color: var(--head-accent); color: var(--head-accent); }
.cc-head-add-slot { display: contents; }
.swp-product-summary:has(.cc-head-dialog) .wp-block-post-title { font-size: 32px !important; line-height: 1.16; font-weight: 550; }
.swp-product-summary:has(.cc-head-dialog) > .wp-block-woocommerce-product-price .woocommerce-Price-amount { font-size: 25px !important; font-weight: 500 !important; }
body:has(.cc-head-dialog[open]) { overflow: hidden; }

@media (max-height: 760px) and (min-width: 841px) {
    .cc-head-preview-note { display: none; }
}

@media (max-width: 840px) {
    .cc-head-dialog { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
    .cc-head-header { min-height: 64px; padding: 12px 16px; }
    .cc-head-header h2 { font-size: 18px; }
    .cc-head-modal-body { display: flex; flex-direction: column; }
    .cc-head-preview-panel { min-height: 42dvh; flex: 0 0 42dvh; padding: 14px; border-right: 0; border-bottom: 1px solid var(--head-line); }
    .cc-head-preview { width: min(100%, 360px, calc(42dvh - 62px)); }
    .cc-head-stage { min-height: 0; }
    .cc-head-preview-note { display: none; }
    .cc-head-controls { width: 100%; padding: 18px 16px; }
    .cc-head-footer { padding: 10px 14px max(10px, env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
    .cc-head-open { width: 100% !important; }
    .cc-head-preview-panel { min-height: 38dvh; flex-basis: 38dvh; }
    .cc-head-style-options { grid-template-columns: 1fr; }
    .cc-head-style-options > :last-child:nth-child(odd) { grid-column: auto; }
    .cc-head-size-options, .cc-head-options.is-tier-20 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cc-head-options.is-tier-mid, .cc-head-options.is-tier-48 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cc-head-contact { grid-template-columns: 1fr; }
    .cc-head-footer { gap: 8px; }
    .cc-head-total > div { display: none; }
    .cc-head-total output { font-size: 22px; }
    .cc-head-footer-actions { gap: 6px; }
    .cc-head-secondary { padding: 0 10px; }
    .cc-head-footer .single_add_to_cart_button.button { min-width: 116px; padding: 0 14px !important; }
    .swp-product-summary:has(.cc-head-dialog) .wp-block-post-title { font-size: 28px !important; }
}
