.tztc-colour-wrap {
    --tztc-border: #dfe3e8;
    margin: 0 0 24px;
    padding: 18px;
    border: 1px solid var(--tztc-border);
    border-radius: 14px;
    background: #fff;
    box-sizing: border-box;
}
.tztc-colour-wrap * { box-sizing: border-box; }
.tztc-colour-heading h3 { margin: 0 0 4px; font-size: 22px; }
.tztc-colour-heading p { margin: 0 0 15px; color: #626b75; }
.tztc-colour-preview {
    position: sticky;
    top: 12px;
    z-index: 2;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--tztc-border);
    border-radius: 12px;
    background: #f6f7f8;
}
.tztc-colour-preview-image {
    display: block;
    width: 100%;
    max-height: 560px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    transition: opacity .16s ease;
}
.tztc-colour-preview-image.is-changing { opacity: .45; }
.tztc-colour-preview-label {
    padding: 10px 13px;
    border-top: 1px solid var(--tztc-border);
    background: #fff;
    text-align: center;
}
.tztc-colour-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.tztc-colour-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.tztc-colour-option {
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 52px;
    gap: 10px;
    align-items: center;
    min-height: 64px;
    padding: 8px 9px;
    border: 2px solid var(--tztc-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tztc-colour-option:hover { border-color: #89929e; transform: translateY(-1px); }
.tztc-colour-option.is-selected { border-color: #111827; box-shadow: 0 0 0 2px rgba(17, 24, 39, .08); }
.tztc-colour-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.tztc-colour-option:focus-within { outline: 2px solid #2271b1; outline-offset: 2px; }
.tztc-swatch {
    display: block;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 50%;
    background: var(--tztc-swatch-colour);
}
.tztc-option-name { min-width: 0; font-weight: 600; line-height: 1.25; }
.tztc-option-thumb { display: block; width: 52px; height: 52px; object-fit: cover; border-radius: 7px; }
@media (min-width: 900px) {
    .tztc-colour-wrap { display: grid; grid-template-columns: minmax(300px, .95fr) minmax(320px, 1.05fr); gap: 18px 22px; }
    .tztc-colour-heading { grid-column: 1 / -1; }
    .tztc-colour-preview { margin-bottom: 0; align-self: start; }
    .tztc-colour-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .tztc-colour-wrap { padding: 13px; }
    .tztc-colour-preview { top: 5px; }
    .tztc-colour-preview-image { max-height: 46vh; }
    .tztc-colour-grid { grid-template-columns: 1fr; }
}

/* v1.3.2: keep personalization above quantity + add-to-cart controls */
form.cart:has(.tztc-colour-wrap),
form.cart:has(.tztc-text-wrap) {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
}
form.cart .tztc-colour-wrap,
form.cart .tztc-text-wrap {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
form.cart .quantity {
    flex: 0 0 auto !important;
}
form.cart .single_add_to_cart_button {
    width: auto !important;
    min-width: 165px !important;
    min-height: 48px !important;
    height: auto !important;
    writing-mode: horizontal-tb !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}
.tztc-text-wrap {
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid #dfe3e8;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
}
.tztc-text-label { display:block; font-weight:600; margin-bottom:7px; }
.tztc-text-wrap input[type="text"] { width:100%; max-width:100%; box-sizing:border-box; }
.tztc-text-wrap small { display:block; margin-top:6px; opacity:.72; }
