/* ============================================================
   Custom Order Forms — Frontend Styles v1.3
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

.cof-form-wrapper {
    max-width: 900px;
    margin: 32px auto;
    padding: 0 16px 80px; /* bottom padding for mobile bar */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2d2d2d;
}

@media (min-width: 1100px) {
    .cof-form-wrapper {
        max-width: 1345px;
    }
}

.cof-form-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.cof-form-desc  { color: #555; margin-bottom: 24px; }

/* ---- Steps Indicator ---- */
.cof-steps-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    padding: 14px 16px;
    border: 1px solid #e8eaf2;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.04);
}

.cof-step-dot {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
}

.cof-step-num {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #eef1f6;
    border: 1px solid #dde3ec;
    color: #667085;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    transition: background .3s, color .3s, border-color .3s, box-shadow .3s;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.cof-step-dot.active .cof-step-num {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
    box-shadow: 0 10px 20px rgba(26,26,46,.18);
}

.cof-step-dot.completed .cof-step-num {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

.cof-step-label {
    font-size: .82rem;
    color: #667085;
    white-space: nowrap;
    font-weight: 600;
}
.cof-step-dot.active .cof-step-label { color: #1a1a2e; }
.cof-step-dot.completed .cof-step-label { color: #1f7a42; }

.cof-step-line {
    flex: 1 1 40px;
    height: 2px;
    min-width: 24px;
    background: linear-gradient(90deg, #e5e7eb 0%, #eef2f7 100%);
    transition: background .3s;
}
.cof-step-line.done { background: linear-gradient(90deg, #27ae60 0%, #6fd08f 100%); }

@media (max-width: 640px) {
    .cof-steps-indicator {
        gap: 8px;
        padding: 12px 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .cof-steps-indicator::-webkit-scrollbar { display: none; }
    .cof-step-label { font-size: .76rem; }
    .cof-step-num {
        width: 36px;
        height: 36px;
    }
}

/* ---- Error Banner ---- */
.cof-error-banner {
    background: #fdf0ef;
    border: 1px solid #e74c3c;
    color: #c0392b;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: .9rem;
}

/* ---- #1 Step Transitions ---- */
.cof-step { display: none; }

.cof-step.active {
    display: block;
    animation: cofFadeSlideIn .35s cubic-bezier(.4,0,.2,1) both;
}

.cof-step.exit {
    animation: cofFadeSlideOut .25s cubic-bezier(.4,0,.2,1) both;
}

@keyframes cofFadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes cofFadeSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-10px); }
}

/* Step 1 layout */
.cof-step-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 425px;
    gap: 24px;
    align-items: start;
}

.cof-summary-sidebar {
    width: 100%;
    max-width: 425px;
    justify-self: end;
    align-self: start;
    position: sticky;
    top: 24px;
}

@media (max-width: 700px) {
    .cof-step-layout { grid-template-columns: 1fr; }
    .cof-summary-sidebar { display: none; } /* replaced by mobile bar */
}

/* ---- Field Groups ---- */
.cof-field-group {
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    transition: background .18s, border-color .18s, box-shadow .18s, transform .18s;
}

.cof-field-group:hover { background: #fafbff; }
.cof-field-group:focus-within {
    background: #ffffff;
    border-color: #cfd9f5;
    box-shadow: 0 0 0 4px rgba(74,108,247,.09), 0 10px 24px rgba(74,108,247,.06);
    transform: translateY(-1px);
}

.cof-field-group.cof-has-error {
    background: #fff7f6;
    border-color: #f2b6b0;
    box-shadow: 0 0 0 4px rgba(217,45,32,.06);
}

.cof-field-group.cof-is-valid {
    background: #f8fdf8;
    border-color: #c9e8d0;
    box-shadow: 0 0 0 4px rgba(39,174,96,.05);
}

/* Conditional hidden sections */
.cof-field-group.cof-hidden {
    display: none !important;
}

.cof-field-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: .98rem;
    line-height: 1.35;
    color: #111827;
}

.cof-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.cof-field-group.cof-field-label-hidden .cof-help-text {
    margin-top: 0;
}

.cof-field-meta {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f2f4f8;
    color: #667085;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.cof-required {
    color: #d92d20;
    margin-left: 0;
    font-weight: 800;
}
.cof-help-text {
    font-size: .88rem;
    color: #667085;
    margin: -2px 0 10px;
    line-height: 1.45;
    max-width: 60ch;
}

.cof-section-desc {
    margin: 8px 0 0;
    color: #667085;
    font-size: .92rem;
    line-height: 1.55;
    max-width: 68ch;
}

.cof-section-desc-step {
    margin: -4px 0 16px;
}

.cof-section-heading-first {
    margin-top: 12px;
}

.cof-field-group .cof-text-input::placeholder,
.cof-field-group .cof-textarea::placeholder {
    color: #98a2b3;
}

.cof-field-error {
    color: #d92d20;
    font-size: .82rem;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 600;
}

/* ---- Premium choice sections / cards ---- */
.cof-field-group[data-type="single_choice"],
.cof-field-group[data-type="multiple_choice"] {
    padding: 20px;
    border: 1px solid #e8edf7;
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(120, 144, 255, .08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .04), inset 0 1px 0 rgba(255,255,255,.85);
}

.cof-field-group[data-type="single_choice"]:hover,
.cof-field-group[data-type="multiple_choice"]:hover {
    background:
        radial-gradient(circle at top left, rgba(120, 144, 255, .10), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
}

.cof-field-group[data-type="single_choice"] .cof-field-label,
.cof-field-group[data-type="multiple_choice"] .cof-field-label {
    margin-bottom: 10px;
    font-size: clamp(1.1rem, 1rem + .35vw, 1.35rem);
    letter-spacing: -.02em;
}

.cof-field-group[data-type="single_choice"] .cof-help-text,
.cof-field-group[data-type="multiple_choice"] .cof-help-text {
    margin-top: 0;
    margin-bottom: 18px;
    color: #667085;
    font-size: 1rem;
    line-height: 1.55;
    max-width: 58ch;
}

/* ---- #3 Card Check Badge ---- */
.cof-card-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(180deg, #1f3fda 0%, #1637b7 100%);
    color: #fff;
    font-size: .78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(.55);
    transition: opacity .18s, transform .2s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 10px 20px rgba(22, 55, 183, .28);
}

.cof-card-check::after { content: '✓'; }

.cof-radio-card.selected .cof-card-check,
.cof-checkbox-card.selected .cof-card-check {
    opacity: 1;
    transform: scale(1);
}

/* ---- Radio / Checkbox Cards ---- */
.cof-radio-cards,
.cof-checkbox-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 860px) {
    .cof-radio-cards,
    .cof-checkbox-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .cof-radio-cards,
    .cof-checkbox-cards { grid-template-columns: 1fr; }
}

.cof-radio-card,
.cof-checkbox-card {
    position: relative;
    border: 1.5px solid #d6deeb;
    border-radius: 22px;
    padding: 0;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    font-size: .94rem;
    min-height: 104px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: 0 14px 28px rgba(15,23,42,.05), inset 0 1px 0 rgba(255,255,255,.9);
}

.cof-radio-card:hover,
.cof-checkbox-card:hover {
    border-color: #b3bfd6;
    box-shadow: 0 20px 34px rgba(15,23,42,.09), 0 0 0 1px rgba(179,191,214,.35);
    transform: translateY(-3px);
}

.cof-radio-card:has(input:focus-visible),
.cof-checkbox-card:has(input:focus-visible) {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 4px rgba(74,108,247,.12), 0 20px 34px rgba(17,24,39,.10);
}

.cof-radio-card input,
.cof-checkbox-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cof-radio-card.selected,
.cof-checkbox-card.selected {
    border-color: #3458e6;
    background: linear-gradient(180deg, #f8faff 0%, #eef3ff 100%);
    box-shadow: 0 0 0 3px rgba(74,108,247,.11), 0 22px 40px rgba(52,88,230,.16);
}

.cof-radio-card.selected .cof-option-label,
.cof-checkbox-card.selected .cof-option-label {
    color: #1637b7;
}

.cof-radio-card.selected .cof-option-price,
.cof-checkbox-card.selected .cof-option-price {
    background: #e5edff;
    color: #2446c9;
}

.cof-radio-card img,
.cof-checkbox-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    background: linear-gradient(180deg, #f5f7fb 0%, #edf2f8 100%);
}

.cof-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 18px 20px;
    flex: 1;
}

.cof-radio-card:not(:has(img)) .cof-card-body,
.cof-checkbox-card:not(:has(img)) .cof-card-body {
    padding: 22px 18px;
}

.cof-option-label {
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.02em;
    color: #111827;
    font-size: clamp(1rem, .96rem + .15vw, 1.08rem);
}

.cof-option-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #eef8f1;
    font-size: .8rem;
    color: #1f7a42;
    font-weight: 700;
}

.cof-choice-grid--media {
    gap: 18px;
}

.cof-choice-grid--pair {
    grid-template-columns: repeat(2, minmax(0, 380px));
    justify-content: center;
}

.cof-choice-secondary-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.cof-choice-secondary-options--single > .cof-radio-card,
.cof-choice-secondary-options--single > .cof-checkbox-card {
    width: 100%;
}

.cof-choice-secondary-options--compact {
    justify-content: center;
}

.cof-choice-secondary-options--compact > .cof-radio-card,
.cof-choice-secondary-options--compact > .cof-checkbox-card {
    width: min(100%, 420px);
    flex: 0 1 420px;
}

.cof-radio-card--secondary,
.cof-checkbox-card--secondary {
    min-height: 0;
    flex: 1 1 280px;
    border-style: solid;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    box-shadow: 0 10px 22px rgba(15,23,42,.04);
}

.cof-radio-card--secondary:hover,
.cof-checkbox-card--secondary:hover {
    transform: translateY(-1px);
}

.cof-radio-card--secondary .cof-card-body,
.cof-checkbox-card--secondary .cof-card-body {
    align-items: center;
    padding: 20px 22px;
}

.cof-radio-card--secondary .cof-option-label,
.cof-checkbox-card--secondary .cof-option-label {
    font-size: clamp(1rem, .96rem + .12vw, 1.05rem);
}

@media (max-width: 560px) {
    .cof-field-group[data-type="single_choice"],
    .cof-field-group[data-type="multiple_choice"] {
        padding: 16px;
        border-radius: 20px;
    }

    .cof-choice-secondary-options {
        margin-top: 14px;
    }

    .cof-radio-card--secondary,
    .cof-checkbox-card--secondary {
        flex-basis: 100%;
    }

    .cof-choice-secondary-options--compact > .cof-radio-card,
    .cof-choice-secondary-options--compact > .cof-checkbox-card {
        width: 100%;
        flex-basis: 100%;
    }
}

/* ---- Inputs ---- */
.cof-text-input,
.cof-select,
.cof-textarea,
.cof-qty-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d8d8e0;
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    color: #2d2d2d;
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
}

.cof-text-input:focus,
.cof-select:focus,
.cof-textarea:focus,
.cof-qty-input:focus {
    border-color: #3458e6;
    box-shadow: 0 0 0 4px rgba(74,108,247,.12);
}

.cof-field-group.cof-has-error .cof-text-input,
.cof-field-group.cof-has-error .cof-select,
.cof-field-group.cof-has-error .cof-textarea,
.cof-field-group.cof-has-error .cof-qty-stepper,
.cof-field-group.cof-has-error .cof-upload-zone {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217,45,32,.08);
}

.cof-field-group.cof-is-valid .cof-text-input,
.cof-field-group.cof-is-valid .cof-select,
.cof-field-group.cof-is-valid .cof-textarea,
.cof-field-group.cof-is-valid .cof-qty-stepper,
.cof-field-group.cof-is-valid .cof-upload-zone {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39,174,96,.08);
}

.cof-textarea { resize: vertical; }

/* Compact sizing for short, simple fields */
.cof-field-group[data-type="text_field"] .cof-text-input,
.cof-field-group[data-type="date_picker"] .cof-date-input,
.cof-field-group[data-type="color_picker"] input[type="color"] {
    width: min(100%, 420px);
}

.cof-field-group[data-type="quantity"] {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.cof-field-group[data-type="quantity"]:hover,
.cof-field-group[data-type="quantity"]:focus-within,
.cof-field-group.cof-is-valid[data-type="quantity"],
.cof-field-group.cof-has-error[data-type="quantity"] {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.cof-field-group[data-type="quantity"] .cof-field-error {
    margin-top: 10px;
}

.cof-qty-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid #e4e8f1;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: 0 12px 28px rgba(17,24,39,.05);
    transition: border-color .18s, box-shadow .18s, background .18s, transform .18s;
}

.cof-field-group[data-type="quantity"]:focus-within .cof-qty-card {
    border-color: #cfd9f5;
    box-shadow: 0 0 0 4px rgba(74,108,247,.08), 0 14px 30px rgba(74,108,247,.08);
}

.cof-field-group.cof-is-valid[data-type="quantity"] .cof-qty-card {
    border-color: #c9e8d0;
    background: linear-gradient(180deg, #ffffff 0%, #fbfffc 100%);
    box-shadow: 0 0 0 4px rgba(39,174,96,.05), 0 14px 30px rgba(39,174,96,.07);
}

.cof-field-group.cof-has-error[data-type="quantity"] .cof-qty-card {
    border-color: #f2b6b0;
    background: linear-gradient(180deg, #ffffff 0%, #fff8f7 100%);
    box-shadow: 0 0 0 4px rgba(217,45,32,.05), 0 14px 30px rgba(217,45,32,.06);
}

.cof-qty-card-main {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cof-qty-stepper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    border: 1.5px solid #d8dbe7;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 22px rgba(17,24,39,.06);
    transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
}

.cof-qty-stepper:focus-within {
    border-color: #3458e6;
    box-shadow: 0 0 0 4px rgba(74,108,247,.12), 0 12px 24px rgba(74,108,247,.12);
}

.cof-field-group.cof-is-valid[data-type="quantity"] .cof-qty-stepper {
    border-color: #27ae60;
}

.cof-field-group.cof-has-error[data-type="quantity"] .cof-qty-stepper {
    border-color: #d92d20;
}

.cof-qty-btn {
    background: linear-gradient(180deg, #f8f9fc 0%, #eef2f9 100%);
    border: none;
    width: 54px;
    height: 56px;
    font-size: 2rem;
    cursor: pointer;
    color: #1a1a2e;
    transition: background .15s, color .15s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    font-weight: 500;
}

.cof-qty-btn:hover { background: #1a1a2e; color: #fff; }
.cof-qty-btn:active { transform: scale(.98); }
.cof-qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.cof-qty-btn:disabled:hover { background: linear-gradient(180deg, #f8f9fc 0%, #eef2f9 100%); color: #1a1a2e; }

.cof-qty-stepper .cof-qty-input {
    width: 110px;
    min-width: 0;
    border: none;
    border-left: 1.5px solid #e0e0e8;
    border-right: 1.5px solid #e0e0e8;
    border-radius: 0;
    text-align: center;
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1;
    padding: 16px 8px;
    box-shadow: none;
    outline: none;
    background: transparent;
    color: #111827;
}

@media (max-width: 560px) {
    .cof-qty-card {
        width: 100%;
        padding: 14px;
        border-radius: 18px;
    }

    .cof-qty-stepper {
        width: 100%;
        display: flex;
    }

    .cof-qty-stepper .cof-qty-input {
        flex: 1 1 0%;
        width: 0;
        min-width: 0;
    }

    .cof-qty-btn {
        width: 50px;
        height: 52px;
    }
}

/* hide native spinners */
.cof-qty-stepper .cof-qty-input::-webkit-inner-spin-button,
.cof-qty-stepper .cof-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cof-qty-stepper .cof-qty-input[type=number] { -moz-appearance: textfield; }

/* ---- File Upload ---- */
.cof-upload-wrapper { display: flex; flex-direction: column; gap: 10px; }

.cof-upload-zone {
    border: 2px dashed #c8c8d4;
    border-radius: 14px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}

.cof-upload-zone:hover,
.cof-upload-zone:focus { border-color: #3458e6; background: #f8faff; box-shadow: 0 0 0 4px rgba(74,108,247,.08); outline: none; transform: translateY(-1px); }
.cof-upload-zone.drag-over { border-color: #4a6cf7; background: #eef1ff; box-shadow: 0 0 0 4px rgba(74,108,247,.12); }

.cof-upload-wrapper.cof-uploading .cof-upload-zone {
    border-color: #3458e6;
    background: #f6f8ff;
}

.cof-upload-icon  { font-size: 2.2rem; margin-bottom: 8px; }
.cof-upload-prompt{ font-size: .95rem; color: #444; margin: 0 0 4px; }
.cof-upload-info  { font-size: .8rem; color: #999; margin: 0; }

.cof-upload-progress {
    border-radius: 999px;
    overflow: hidden;
    background: #e8e8ee;
    height: 10px;
    position: relative;
}

.cof-upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1a1a2e, #4a6cf7);
    border-radius: 6px;
    transition: width .15s ease;
}

.cof-upload-progress-label {
    display: block;
    font-size: .78rem;
    color: #475467;
    margin-top: 8px;
    text-align: right;
    font-weight: 700;
}

.cof-upload-status {
    min-height: 18px;
    font-size: .82rem;
    font-weight: 600;
    color: #667085;
}

.cof-upload-wrapper.cof-uploading .cof-upload-status {
    color: #2446c9;
}

.cof-upload-wrapper.cof-upload-success-state .cof-upload-status {
    color: #1f7a42;
}

.cof-upload-wrapper.cof-upload-error-state .cof-upload-status {
    color: #d92d20;
}

.cof-upload-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f0faf4;
    border: 1.5px solid #27ae60;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 10px 24px rgba(39,174,96,.08);
}

.cof-preview-thumb-wrap {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #e8e8ee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.cof-preview-img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.cof-preview-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cof-preview-filename { font-size: .9rem; font-weight: 600; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cof-preview-filesize { font-size: .78rem; color: #777; }

.cof-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.cof-upload-view,
.cof-upload-replace,
.cof-upload-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    background: #fff;
    border: 1px solid #d0d5dd;
    color: #344054;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 999px;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s, opacity .18s, transform .18s;
    white-space: nowrap;
    text-decoration: none;
}

.cof-upload-view:hover,
.cof-upload-view:focus,
.cof-upload-replace:hover,
.cof-upload-replace:focus {
    border-color: #b9c5d6;
    background: #f8fafc;
    color: #1d2939;
    box-shadow: 0 1px 2px rgba(16,24,40,.08);
    outline: none;
}

.cof-upload-view::before { content: '↗  '; font-size: .78rem; }
.cof-upload-replace::before { content: '⟲  '; font-size: .78rem; }
.cof-upload-remove { background: none; color: #999; }
.cof-upload-remove::before { content: '✕  '; font-size: .72rem; }
.cof-upload-remove:hover,
.cof-upload-remove:focus { background: #fdf0ef; border-color: #f3c7c0; color: #e74c3c; outline: none; }

.cof-upload-preview--image {
    position: relative;
    display: block;
    min-height: 260px;
    padding: 0;
    overflow: hidden;
    background: #0f172a;
    border-color: #1f9d55;
    box-shadow: 0 18px 40px rgba(15,23,42,.16);
}

.cof-upload-preview--image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2,6,23,.04) 0%, rgba(2,6,23,.12) 38%, rgba(2,6,23,.78) 100%);
    z-index: 1;
    opacity: 1;
    transition: opacity .22s ease;
}

.cof-upload-preview--image .cof-preview-thumb-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #0f172a;
    font-size: 2.8rem;
}

.cof-upload-preview--image .cof-preview-img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: contain;
    object-position: center;
    background: #0f172a;
}

.cof-upload-preview--image .cof-preview-file-icon {
    display: none !important;
}

.cof-upload-preview--image .cof-preview-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    gap: 8px;
    padding: 18px;
    color: #fff;
}

.cof-upload-preview--image .cof-preview-filename {
    color: #fff;
    font-size: .98rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(2,6,23,.28);
}

.cof-upload-preview--image .cof-preview-filesize {
    color: rgba(255,255,255,.84);
    font-size: .82rem;
}

.cof-upload-preview--image .cof-upload-actions {
    margin-top: 4px;
}

.cof-upload-preview--image .cof-upload-view,
.cof-upload-preview--image .cof-upload-replace,
.cof-upload-preview--image .cof-upload-remove {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(255,255,255,.58);
    color: #1f2937;
    box-shadow: 0 6px 16px rgba(2,6,23,.18);
}

.cof-upload-preview--image .cof-upload-remove {
    background: rgba(255,255,255,.85);
    color: #374151;
}

.cof-upload-preview--image .cof-upload-view:hover,
.cof-upload-preview--image .cof-upload-view:focus,
.cof-upload-preview--image .cof-upload-replace:hover,
.cof-upload-preview--image .cof-upload-replace:focus,
.cof-upload-preview--image .cof-upload-remove:hover,
.cof-upload-preview--image .cof-upload-remove:focus {
    background: #fff;
    border-color: rgba(255,255,255,.85);
    color: #111827;
    transform: translateY(-1px);
}

@media (hover: hover) and (pointer: fine) {
    .cof-upload-preview--image::after {
        opacity: .28;
    }

    .cof-upload-preview--image .cof-preview-info {
        opacity: 0;
        transform: translateY(12px);
        pointer-events: none;
        transition: opacity .22s ease, transform .22s ease;
    }

    .cof-upload-preview--image:hover::after,
    .cof-upload-preview--image:focus-within::after {
        opacity: 1;
    }

    .cof-upload-preview--image:hover .cof-preview-info,
    .cof-upload-preview--image:focus-within .cof-preview-info {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}

@media (max-width: 640px) {
    .cof-upload-preview--image {
        min-height: 220px;
    }

    .cof-upload-preview--image .cof-preview-info {
        padding: 14px;
        gap: 6px;
    }

    .cof-upload-preview--image .cof-preview-filename {
        font-size: .9rem;
    }

    .cof-upload-preview--image .cof-upload-actions {
        gap: 6px;
    }

    .cof-upload-preview--image .cof-upload-view,
    .cof-upload-preview--image .cof-upload-replace,
    .cof-upload-preview--image .cof-upload-remove {
        min-height: 30px;
        padding: 6px 10px;
        font-size: .76rem;
    }
}
.cof-upload-error { color: #e74c3c; font-size: .82rem; min-height: 18px; }

/* ---- Summary Sidebar ---- */
.cof-summary-box {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    border: 1px solid #e7ebf3;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 22px 52px rgba(17,24,39,.10);
}

/* Form thumbnail */
.cof-summary-thumbnail {
    width: 100%;
    line-height: 0;
    position: relative;
}

.cof-summary-thumbnail::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.92) 100%);
}

.cof-summary-thumbnail img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.cof-summary-header,
.cof-summary-toolbar,
.cof-summary-section-head,
.cof-summary-empty,
.cof-summary-lines,
.cof-summary-total-card {
    padding-left: 20px;
    padding-right: 20px;
}

.cof-summary-header {
    padding-top: 18px;
    padding-bottom: 14px;
}


.cof-summary-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #101828;
}

.cof-summary-desc {
    margin: 0;
    color: #667085;
    font-size: .88rem;
    line-height: 1.55;
}

.cof-summary-toolbar {
    padding-bottom: 12px;
}

.cof-summary-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 10px;
}

.cof-summary-section-kicker {
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #667085;
}

.cof-summary-selection-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: .76rem;
    font-weight: 700;
}

.cof-summary-empty {
    padding-top: 2px;
    padding-bottom: 10px;
    color: #667085;
    font-size: .9rem;
    line-height: 1.55;
}

.cof-summary-lines {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.cof-summary-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e7ebf3;
    border-radius: 14px;
    background: #fff;
    animation: cofFadeSlideIn .2s ease both;
    transition: background .16s, border-color .16s, box-shadow .16s, transform .16s;
}

.cof-summary-line:hover {
    background: #fbfcff;
    border-color: #dce4f2;
    box-shadow: 0 8px 24px rgba(17,24,39,.05);
    transform: translateY(-1px);
}

.cof-summary-line-main {
    min-width: 0;
    display: grid;
    gap: 4px;
    flex: 1;
}

.cof-summary-line-label {
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #667085;
}

.cof-summary-line-value {
    color: #101828;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}


.cof-summary-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

.cof-summary-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cof-summary-card-title {
    min-width: 0;
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #475467;
}

.cof-summary-card-items {
    display: grid;
    gap: 10px;
}

.cof-summary-card-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #f8fafc;
}

.cof-summary-card-item-single {
    grid-template-columns: minmax(0, 1fr) auto;
}

.cof-summary-card-item-text {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.cof-summary-card-item-label {
    min-width: 0;
    color: #667085;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cof-summary-card-item-value {
    color: #101828;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}


.cof-summary-card-item-upload {
    align-items: flex-start;
}

.cof-summary-upload-value {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.cof-summary-upload-thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: 1px solid #dbe3ef;
    background: #eef4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.cof-summary-upload-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cof-summary-upload-thumb-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.cof-summary-upload-meta {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.cof-summary-upload-name {
    color: #101828;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cof-summary-upload-note {
    color: #667085;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cof-summary-upload-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    color: #2446c9;
    font-size: .8rem;
    font-weight: 800;
    text-decoration: none;
}

.cof-summary-upload-link::before {
    content: '↗';
    font-size: .76rem;
}

.cof-summary-upload-link:hover,
.cof-summary-upload-link:focus {
    color: #1637b7;
    text-decoration: underline;
    outline: none;
}

.cof-summary-upload-value--image {
    display: block;
    width: min(100%, 220px);
}

.cof-summary-upload-value--image .cof-summary-upload-thumb {
    position: relative;
    width: 100%;
    height: 172px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .32);
    background: #0f172a;
    display: block;
    box-shadow: 0 16px 32px rgba(15, 23, 42, .14);
}

.cof-summary-upload-value--image .cof-summary-upload-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2,6,23,.04) 0%, rgba(2,6,23,.12) 38%, rgba(2,6,23,.8) 100%);
    z-index: 1;
    opacity: 1;
    transition: opacity .22s ease;
}

.cof-summary-upload-value--image .cof-summary-upload-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #0f172a;
}

.cof-summary-upload-value--image .cof-summary-upload-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 14px;
    gap: 6px;
    color: #fff;
}

.cof-summary-upload-value--image .cof-summary-upload-name {
    color: #fff;
    font-size: .92rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cof-summary-upload-value--image .cof-summary-upload-note {
    color: rgba(255,255,255,.82);
    font-size: .78rem;
    font-weight: 700;
}

.cof-summary-upload-value--image .cof-summary-upload-link {
    color: #fff;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 800;
}

.cof-summary-upload-value--image .cof-summary-upload-link:hover,
.cof-summary-upload-value--image .cof-summary-upload-link:focus {
    color: #fff;
    text-decoration: underline;
}

@media (hover: hover) and (pointer: fine) {
    .cof-summary-upload-value--image .cof-summary-upload-thumb::after {
        opacity: .28;
    }

    .cof-summary-upload-value--image .cof-summary-upload-meta {
        opacity: 0;
        transform: translateY(12px);
        pointer-events: none;
        transition: opacity .22s ease, transform .22s ease;
    }

    .cof-summary-upload-value--image .cof-summary-upload-thumb:hover::after,
    .cof-summary-upload-value--image .cof-summary-upload-thumb:focus-within::after {
        opacity: 1;
    }

    .cof-summary-upload-value--image .cof-summary-upload-thumb:hover .cof-summary-upload-meta,
    .cof-summary-upload-value--image .cof-summary-upload-thumb:focus-within .cof-summary-upload-meta {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}

@media (max-width: 640px) {
    .cof-summary-upload-value--image {
        width: min(100%, 200px);
    }

    .cof-summary-upload-value--image .cof-summary-upload-thumb {
        height: 156px;
    }

    .cof-summary-upload-value--image .cof-summary-upload-meta {
        padding: 12px;
        gap: 4px;
    }
}

/* Edit button */
.cof-summary-edit {
    flex-shrink: 0;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    cursor: pointer;
    padding: 0;
    color: #344054;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 999px;
    transition: color .15s, background .15s, border-color .15s, transform .15s, box-shadow .15s;
    line-height: 1;
}

.cof-summary-edit:hover {
    color: #101828;
    background: #eef4ff;
    border-color: #cfe0ff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(17,24,39,.08);
}

.cof-summary-edit-inline {
    margin-left: 6px;
}

/* Highlight pulse when scrolled-to */
@keyframes cofFieldHighlight {
    0%   { background: #e8eeff; box-shadow: 0 0 0 3px #4a6cf7; }
    70%  { background: #e8eeff; box-shadow: 0 0 0 3px #4a6cf7; }
    100% { background: transparent; box-shadow: none; }
}

.cof-field-highlight {
    animation: cofFieldHighlight 1.4s ease forwards;
    border-radius: 10px;
}

.cof-summary-total-card {
    margin: 0 20px 20px;
    padding: 16px 18px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    color: #fff;
    box-shadow: 0 18px 32px rgba(17,24,39,.18);
}

.cof-summary-total-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.cof-summary-total-label {
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: rgba(255,255,255,.74);
}

.cof-live-total {
    display: block;
    font-size: 2rem;
    line-height: 1.05;
    letter-spacing: -.03em;
    transition: color .2s, transform .2s;
}

.cof-live-total.bump {
    color: #dbe7ff;
    transform: translateY(-1px);
}

.cof-price-delta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .02em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .18s ease, transform .18s ease, background .18s ease, color .18s ease;
}

.cof-price-delta.positive {
    background: rgba(111,208,143,.18);
    color: #b7f2c7;
}

.cof-price-delta.negative {
    background: rgba(255,255,255,.12);
    color: #f6f7fb;
}

.cof-price-delta.show {
    opacity: 1;
    transform: translateY(0);
}

.cof-summary-note {
    font-size: .8rem;
    color: rgba(255,255,255,.74);
    margin: 12px 0 0;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .cof-summary-total-card {
        margin-left: 16px;
        margin-right: 16px;
    }
}
/* ---- #2 Mobile sticky bar ---- */
.cof-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: #fff;
    padding: 14px 20px;
    z-index: 100;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}

.cof-mobile-bar-label { font-size: .85rem; opacity: .75; }
.cof-mobile-bar-total { font-size: 1.2rem; font-weight: 700; }

@media (max-width: 700px) {
    .cof-mobile-bar { display: flex; }
}

/* ---- Step Navigation ---- */
.cof-step-nav {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid #eaecf3;
    flex-wrap: wrap;
    align-items: center;
}

.cof-step-2-nav {
    justify-content: space-between;
}

.cof-btn {
    padding: 13px 26px;
    border-radius: 12px;
    border: none;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .18s, transform .12s, background .18s, box-shadow .18s, border-color .18s, color .18s;
    font-family: inherit;
}

.cof-btn:disabled { opacity: .6; cursor: not-allowed; }
.cof-btn:active   { transform: scale(.98); }

.cof-form-wrapper .cof-btn-next,
.cof-form-wrapper .cof-btn-submit {
    background: linear-gradient(180deg, #1a1a2e 0%, #242445 100%);
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    border-color: transparent;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(26,26,46,.18);
}

.cof-form-wrapper .cof-btn-next:hover,
.cof-form-wrapper .cof-btn-submit:hover,
.cof-form-wrapper .cof-btn-next:focus,
.cof-form-wrapper .cof-btn-submit:focus,
.cof-form-wrapper .cof-btn-next:focus-visible,
.cof-form-wrapper .cof-btn-submit:focus-visible {
    background: linear-gradient(180deg, #242445 0%, #2f2f58 100%);
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    border-color: transparent;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(26,26,46,.24);
    transform: translateY(-1px);
}

.cof-btn-back {
    background: #fff;
    color: #475467;
    border: 1.5px solid #d0d5dd;
}

.cof-btn-back:hover { border-color: #98a2b3; color: #344054; }

.cof-form-wrapper .cof-btn-next:active,
.cof-form-wrapper .cof-btn-submit:active {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
}

/* ---- Step 2 ---- */
.cof-fields-column-details {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    border: 1px solid #e7ebf3;
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(17,24,39,.06);
    padding: 24px;
}

.cof-step-heading {
    font-size: 1.3rem;
    margin: 0 0 6px;
    color: #101828;
}
.cof-step-subheading {
    margin: 0 0 22px;
    color: #667085;
    font-size: .94rem;
    line-height: 1.5;
    max-width: 62ch;
}
.cof-fields-column-details .cof-section-heading-first {
    margin-top: 6px;
}
.cof-section-heading{
    font-size: 1rem;
    font-weight: 700;
    color: #344054;
    margin: 26px 0 14px;
    border-top: 1px solid #eaecf3;
    padding-top: 18px;
}

.cof-contact-grid,
.cof-shipping-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 600px) {
    .cof-contact-grid,
    .cof-shipping-grid { grid-template-columns: 1fr; }

    .cof-fields-column-details {
        padding: 18px;
        border-radius: 18px;
    }
}

.cof-col-full { grid-column: 1 / -1; }

.cof-account-opt { margin: 20px 0 0; }
.cof-checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; color: #555; }

/* ---- Step 3 Success ---- */
.cof-success-box { text-align: center; padding: 48px 24px; max-width: 520px; margin: 0 auto; }

.cof-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: cofSuccessPop .5s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes cofSuccessPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.cof-success-box h2    { font-size: 1.6rem; margin-bottom: 12px; color: #1a1a2e; }
.cof-success-message   { color: #555; margin-bottom: 28px; }
.cof-success-details   { background: #f7f7fb; border-radius: 8px; padding: 16px 20px; text-align: left; margin-bottom: 20px; }
.cof-success-row       { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; font-size: .9rem; }
.cof-success-row:last-child { border-bottom: none; }
.cof-account-note      { color: #27ae60; font-size: .9rem; margin-top: 12px; }

/* ================================================================
   v1.5 ADDITIONS
================================================================ */

/* #1 — Sticky floating summary (appears after scrolling past sidebar) */
.cof-sticky-summary {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: #fff;
    padding: 10px 20px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
    transform: translateY(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.cof-sticky-summary.visible { transform: translateY(0); }

.cof-sticky-summary-label { font-size: .85rem; opacity: .7; }
.cof-sticky-summary-total { font-size: 1.1rem; font-weight: 700; }

@media (max-width: 700px) {
    /* Mobile already has bar at bottom — don't show top bar too */
    .cof-sticky-summary { display: none; }
}

/* #3 — Price delta flash next to total */
.cof-price-delta {
    font-size: .8rem;
    font-weight: 700;
    margin-left: 6px;
    opacity: 0;
    transition: opacity .1s;
    vertical-align: middle;
}
.cof-price-delta.positive { color: #27ae60; }
.cof-price-delta.negative { color: #e74c3c; }
.cof-price-delta.show {
    opacity: 1;
    animation: cofDeltaFade 1.6s ease forwards;
}
@keyframes cofDeltaFade {
    0%   { opacity: 1; transform: translateY(0); }
    60%  { opacity: 1; transform: translateY(-4px); }
    100% { opacity: 0; transform: translateY(-8px); }
}

/* #2 — Success screen improvements */
.cof-success-box { animation: cofFadeSlideIn .4s ease both; }

.cof-success-next-steps {
    background: #f7f7fb;
    border-radius: 10px;
    padding: 20px;
    margin-top: 24px;
    text-align: left;
}
.cof-success-next-steps h4 {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
    margin: 0 0 14px;
}
.cof-next-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: .88rem;
}
.cof-next-step:last-child { border-bottom: none; }
.cof-next-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a1a2e;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.cof-next-step-text { color: #555; line-height: 1.4; }
.cof-next-step-text strong { color: #1a1a2e; display: block; margin-bottom: 2px; }

.cof-success-print {
    background: none;
    border: 1.5px solid #ccc;
    color: #555;
    padding: 9px 18px;
    border-radius: 7px;
    font-size: .88rem;
    cursor: pointer;
    margin-top: 16px;
    transition: border-color .15s, color .15s;
}
.cof-success-print:hover { border-color: #1a1a2e; color: #1a1a2e; }

/* #7 — Currency switcher */
.cof-currency-switcher {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cof-currency-btn {
    padding: 6px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    color: #475467;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.cof-currency-btn.active {
    background: #111827;
    border-color: #111827;
    color: #fff;
    box-shadow: 0 10px 20px rgba(17,24,39,.16);
}

/* #8 — Min/max quantity warning */
.cof-qty-warning {
    font-size: .8rem;
    color: #e67e22;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Admin: collapse/expand buttons */
#cof-collapse-all, #cof-expand-all { margin-left: 4px; }

/* Admin: duplicate section button */
.cof-section-duplicate {
    background: none;
    border: none;
    color: #2271b1;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    padding: 0 3px;
}
.cof-section-duplicate:hover { color: #1a5276; }

/* Admin: min/max qty fields */
.cof-qty-minmax-wrap { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #ddd; }
.cof-qty-minmax-row  { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-bottom: 8px; }

/* Analytics page */
.cof-analytics-wrap .cof-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {
    .cof-analytics-wrap .cof-kpi-row { grid-template-columns: repeat(2, 1fr); }
}
.cof-kpi-card {
    background: #fff;
    border: 1px solid #e0e0e8;
    border-radius: 8px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.cof-kpi-icon  { font-size: 1.8rem; }
.cof-kpi-value { font-size: 1.5rem; font-weight: 700; color: #1a1a2e; line-height: 1; }
.cof-kpi-label { font-size: .8rem; color: #888; margin-top: 3px; }
.cof-analytics-box {
    background: #fff;
    border: 1px solid #e0e0e8;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.cof-analytics-box h3 { margin: 0 0 16px; font-size: 14px; color: #50575e; text-transform: uppercase; letter-spacing: .04em; }

/* ================================================================
   v1.6 ADDITIONS
================================================================ */

/* Save Draft button */
.cof-btn-save-draft {
    background: #fff;
    color: #475467;
    border: 1.5px dashed #c7ced8;
    font-size: .85rem;
    padding: 11px 18px;
    box-shadow: 0 4px 12px rgba(17,24,39,.04);
}
.cof-btn-save-draft:hover {
    border-color: #344054;
    color: #1f2937;
    background: #f9fafb;
}

/* Form notice (success/info inline) */
.cof-error-banner.cof-notice-success {
    background: #f0faf4;
    border-color: #27ae60;
    color: #1a7928;
}

/* Settings grid */
.cof-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .cof-settings-grid { grid-template-columns: 1fr; } }

/* ================================================================
   v1.7 ADDITIONS
================================================================ */

/* Color swatches */
.cof-color-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.cof-color-swatch-label { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.cof-color-swatch-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.cof-color-swatch {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid transparent;
    box-shadow: 0 0 0 1px #ccc;
    transition: box-shadow .15s, transform .15s;
    display: block;
}
.cof-color-swatch-label:hover .cof-color-swatch { transform: scale(1.1); box-shadow: 0 0 0 2px #1a1a2e; }
.cof-color-swatch-label input:checked ~ .cof-color-swatch { box-shadow: 0 0 0 3px #1a1a2e; transform: scale(1.15); }
.cof-swatch-name { font-size: .75rem; color: #555; text-align: center; max-width: 60px; }

/* Star rating */
.cof-star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.cof-star-label { cursor: pointer; }
.cof-star-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.cof-star { font-size: 2rem; color: #ddd; transition: color .1s; display: block; }
.cof-star-label:hover .cof-star,
.cof-star-label:hover ~ .cof-star-label .cof-star { color: #f39c12; }
.cof-star-label input:checked ~ .cof-star-label .cof-star { color: #f39c12; }
.cof-star-label input:checked + .cof-star,
.cof-star-label:has(input:checked) .cof-star { color: #f39c12; }
.cof-star-value-display { font-size: .82rem; color: #777; margin-top: 4px; }

/* Date input */
.cof-date-input { max-width: 220px; }

/* Coupon row */
.cof-coupon-row { padding: 16px; }
.cof-coupon-msg.success { color: #27ae60; }
.cof-coupon-msg.error   { color: #e74c3c; }
.cof-coupon-discount-line {
    font-size: .9rem; color: #27ae60; font-weight: 600;
    padding: 5px 20px; border-bottom: 1px solid #e8e8ee;
}
.cof-btn-apply-coupon {
    background: transparent; color: #1a1a2e; border: 1.5px solid #1a1a2e;
    font-size: .85rem; padding: 10px 16px; white-space: nowrap;
}
.cof-btn-apply-coupon:hover { background: #1a1a2e; color: #fff; }


/* ---- Multi-field section containers ---- */
.cof-section-container {
    margin-bottom: 22px;
    padding: 18px 18px 16px;
    border: 1px solid #e8eaf2;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: 0 12px 30px rgba(17,24,39,.04);
    transition: opacity .22s ease, transform .22s ease, max-height .26s ease, margin-bottom .26s ease, padding-top .26s ease, padding-bottom .26s ease, border-color .22s ease, box-shadow .22s ease;
    max-height: 2400px;
    opacity: 1;
    transform: translateY(0);
    overflow: hidden;
}

.cof-section-container-compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 420px));
    gap: 18px 24px;
    justify-content: start;
    align-items: start;
}

.cof-section-container-compact-grid .cof-section-heading {
    grid-column: 1 / -1;
    margin-bottom: 2px;
}

.cof-section-container-compact-grid .cof-section-desc {
    max-width: 72ch;
}

.cof-section-container-compact-grid .cof-field-group {
    margin-bottom: 0;
    padding: 14px 16px;
}

.cof-section-container > .cof-field-group:last-child,
.cof-section-container-compact-grid > .cof-field-group:last-child {
    margin-bottom: 0;
}

@media (max-width: 820px) {
    .cof-section-container {
        padding: 16px 14px 14px;
        border-radius: 16px;
    }
    .cof-section-container-compact-grid {
        grid-template-columns: 1fr;
    }
}

.cof-section-container.cof-hidden {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    box-shadow: none;
    pointer-events: none;
}

.cof-section-heading {
    display: block;
}

.cof-section-title {
    margin: 0;
    font-size: 1.06rem;
    line-height: 1.35;
    color: #101828;
}


@media (max-width: 640px) {
    .cof-step-nav {
        align-items: stretch;
    }
    .cof-step-nav .cof-btn {
        width: 100%;
        justify-content: center;
    }
}


/* ---- v2.0.10 section head spacing refinement ---- */
.cof-section-container .cof-section-heading {
    margin: 0 0 14px;
    padding-top: 0;
    border-top: 0;
}

.cof-section-container-compact-grid .cof-section-heading {
    margin-bottom: 6px;
}

.cof-section-container .cof-section-title {
    font-size: 1rem;
    line-height: 1.3;
}

.cof-section-container .cof-section-desc {
    margin-top: 6px;
    font-size: .88rem;
    line-height: 1.5;
    max-width: 64ch;
}

.cof-section-container .cof-field-group:first-of-type {
    margin-top: 0;
}


/* Pricing hidden mode */
.cof-live-total.cof-live-total-text {
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 700;
}

.cof-pricing-hidden-text {
    font-size: 0.95rem;
    line-height: 1.3;
}

.cof-form-wrapper.cof-pricing-hidden .cof-price-delta {
    display: none !important;
}


.cof-option-review-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    color: #996800;
    background: #fff7df;
    border: 1px solid #f0d98c;
    border-radius: 999px;
    padding: 4px 9px;
}
