.stitching-customizer {
    margin: 20px 0;
}

/* SECTION 1: Fit type cards */
.stitching-fit-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stitching-fit-type-card {
    position: relative;
    border: 2px solid #d1d1d1;
    border-radius: 4px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stitching-fit-type-card:hover {
    border-color: #999;
}

.stitching-fit-type-card.selected {
    border-color: #1979c3;
    box-shadow: 0 0 0 1px #1979c3;
}

.stitching-badge-popular {
    position: absolute;
    top: -10px;
    right: 8px;
    background: #ff6f00;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: .02em;
}

.stitching-fit-type-label {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.stitching-fit-type-surcharge {
    color: #1979c3;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.stitching-fit-type-delivery {
    color: #757575;
    font-size: 12px;
}

/* SECTION 2: Guest notice */
.stitching-guest-notice {
    margin: 12px 0;
    padding: 12px 14px;
    background: #fdf0d5;
    border: 1px solid #e6b800;
    border-radius: 4px;
}

.infocus-stitching-guest-message {
    margin-bottom: 8px;
    font-size: 13px;
}

.infocus-stitching-guest-actions {
    display: flex;
    gap: 8px;
}

/* SECTION 3: Option groups */
.stitching-option-groups {
    margin: 16px 0;
}

.stitching-option-group {
    margin-bottom: 16px;
}

.stitching-option-group-heading {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
}

.stitching-option-items-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
}

.stitching-option-item {
    flex: 0 0 auto;
    width: 90px;
    text-align: center;
    cursor: pointer;
}

.stitching-option-item-image-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    border: 2px solid #d1d1d1;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.stitching-option-item.selected .stitching-option-item-image-wrap {
    border-color: #1979c3;
    box-shadow: 0 0 0 1px #1979c3;
}

.stitching-option-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stitching-option-item-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 50%;
    background: #1979c3;
    color: #fff;
    font-size: 12px;
    display: none;
}

.stitching-option-item.selected .stitching-option-item-check {
    display: block;
}

.stitching-option-item-name {
    margin-top: 6px;
    font-size: 12px;
    color: #333;
}

.stitching-option-item-value-wrap {
    margin-top: 8px;
}

.stitching-option-item-value-input {
    width: 100%;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #c2c2c2;
    border-radius: 3px;
    text-align: center;
}

.stitching-option-item-value-range {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: #767676;
}

/* SECTION 4: Measurement profile selector */
.stitching-measurement-selector {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background: #fafafa;
}

.stitching-measurement-field {
    margin-bottom: 10px;
}

.stitching-no-profiles-notice {
    margin-bottom: 10px;
    color: #757575;
    font-size: 13px;
}

.stitching-add-profile-button {
    margin-bottom: 10px;
}

.stitching-inline-profile-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #d1d1d1;
}

.stitching-inline-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* SECTION 5: Price display */
.stitching-price-display {
    margin: 14px 0;
    padding: 10px 14px;
    background: #eef6fc;
    border-radius: 4px;
    font-size: 14px;
}

.stitching-price-total {
    font-weight: 700;
}

/* SECTION 6: Add to cart */
.stitching-add-to-cart-wrap {
    margin: 16px 0;
}

.stitching-add-to-cart-button {
    position: relative;
    min-width: 160px;
}

.stitching-add-to-cart-button.loading {
    opacity: .6;
    pointer-events: none;
}

.stitching-add-to-cart-button.loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: stitching-spin .6s linear infinite;
}

@keyframes stitching-spin {
    to {
        transform: rotate(360deg);
    }
}

.stitching-add-to-cart-message {
    margin-top: 8px;
    font-size: 13px;
}

.stitching-add-to-cart-message.success {
    color: #2e7d32;
}

.stitching-add-to-cart-message.error {
    color: #c0392b;
}

/* Mobile: stack to single column */
@media only screen and (max-width: 768px) {
    .stitching-fit-types {
        grid-template-columns: 1fr;
    }
}

/* Print: used by the vendor panel order view's stitching summary, kept here so a single
   stylesheet can be shared for that read-only print case too if linked there. */
@media print {
    .stitching-add-to-cart-wrap,
    .stitching-guest-notice,
    .stitching-add-profile-button,
    .stitching-inline-profile-form {
        display: none !important;
    }

    .stitching-fit-types {
        grid-template-columns: repeat(3, 1fr);
    }

    .stitching-option-item-image-wrap {
        border-color: #000;
    }
}
