.cpc-configurator {
    margin: 24px 0;
}

.cpc-section {
    margin: 0 0 24px;
}

.cpc-section h3 {
    color: var(--wd-title-color, inherit);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px;
}

.cpc-form-error {
    background: #fff1f1;
    border: 1px solid #cc3333;
    border-radius: 6px;
    color: #8a1f1f;
    display: none;
    font-weight: 700;
    margin: 0 0 16px;
    padding: 10px 12px;
}

.cpc-loop-customize-button::before,
.cpc-loop-customize-button::after,
.cpc-loop-customize-button .wd-tools-icon,
.cpc-loop-customize-button .wd-btn-icon,
.cpc-loop-customize-button .cart-icon,
.cpc-loop-customize-button i,
.cpc-loop-customize-button svg {
    display: none !important;
}

.cpc-quantity-grid {
    display: grid;
    gap: 12px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cpc-quantity-card {
    align-items: center;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 8px;
    color: var(--wd-text-color, inherit);
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr auto;
    min-height: 48px;
    padding: 12px 16px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cpc-quantity-card input[type="radio"] {
    accent-color: var(--wd-primary-color, #2271b1);
    height: 18px;
    margin: 0 10px 0 0;
    width: 18px;
}

.cpc-quantity-card:has(input:checked),
.cpc-quantity-card.is-selected {
    border-color: var(--wd-primary-color, #2271b1);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--wd-primary-color, #2271b1) 18%, transparent);
}

.cpc-quantity-left {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.cpc-quantity-left strong,
.cpc-quantity-price strong {
    color: var(--wd-title-color, inherit);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.cpc-quantity-left em {
    background: #ffe36f;
    border-radius: 999px;
    color: #111;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    padding: 4px 7px;
}

.cpc-quantity-price {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    text-align: right;
}

.cpc-quantity-price small {
    color: var(--wd-text-color, #555);
    font-size: 13px;
    line-height: 1.35;
}

.cpc-quantity-custom {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
}

.cpc-custom-quantity-input {
    grid-column: 1 / -1;
    min-height: 42px;
    width: 100%;
}

.cpc-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cpc-color-card {
    align-items: center;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 8px;
    color: var(--wd-text-color, inherit);
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    min-height: 42px;
    padding: 8px 12px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cpc-color-card input {
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    width: 1px !important;
}

.cpc-color-card:has(input:checked),
.cpc-color-card.is-selected {
    border-color: var(--wd-primary-color, #2271b1);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--wd-primary-color, #2271b1) 18%, transparent);
}

.cpc-color-swatch {
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 999px;
    display: inline-block;
    height: 22px;
    width: 22px;
}

.cpc-card-grid,
.cpc-delivery-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cpc-option-card,
.cpc-delivery-card {
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 8px;
    color: var(--wd-text-color, inherit);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cpc-option-card input,
.cpc-delivery-card input {
    left: 10px;
    opacity: 0;
    position: absolute;
    top: 10px;
    z-index: 2;
}

.cpc-option-card:has(input:checked),
.cpc-delivery-card:has(input:checked) {
    border-color: var(--wd-primary-color, #2271b1);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--wd-primary-color, #2271b1) 18%, transparent);
}

.cpc-card-image {
    aspect-ratio: 4 / 3;
    background: #f6f6f6;
    display: block;
}

.cpc-card-image img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.cpc-card-body {
    display: grid;
    gap: 5px;
    padding: 10px;
}

.cpc-card-body strong {
    color: var(--wd-title-color, inherit);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.cpc-card-body span {
    color: var(--wd-text-color, #555);
    font-size: 13px;
    line-height: 1.4;
}

.cpc-card-body em,
.cpc-card-body .cpc-card-price {
    color: var(--wd-primary-color, inherit);
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
}

.cpc-delivery-card {
    align-items: center;
    display: grid;
    gap: 8px;
    justify-items: center;
    min-height: 170px;
    padding: 18px 12px;
    text-align: center;
}

.cpc-delivery-badge {
    border-radius: 999px;
    color: #000;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 8px 12px;
}

.cpc-delivery-label {
    color: var(--wd-text-color, #555);
    font-size: 13px;
    line-height: 1.35;
}

.cpc-delivery-card strong {
    color: var(--wd-title-color, inherit);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.cpc-delivery-card em {
    background: #f7f7f7;
    border-radius: 6px;
    color: var(--wd-primary-color, inherit);
    display: block;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    min-width: 96px;
    padding: 8px 10px;
}

.cpc-logo-preview {
    display: block;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.cpc-logo-preview img {
    border: 1px solid #ddd;
    border-radius: 6px;
    max-height: 140px;
    max-width: 220px;
    padding: 6px;
}

.cpc-logo-dropzone {
    align-items: center;
    background: #fafafa;
    border: 2px dashed #b8c0cc;
    border-radius: 8px;
    box-sizing: border-box;
    cursor: pointer;
    display: grid;
    gap: 8px;
    justify-items: center;
    min-height: 190px;
    padding: 22px;
    position: relative;
    text-align: center;
    transition: background-color 160ms ease, border-color 160ms ease;
    width: 100%;
}

.cpc-logo-dropzone.is-dragging,
.cpc-logo-dropzone:hover {
    background: #f2f7fb;
    border-color: #2271b1;
}

.cpc-configurator .cpc-logo-input[type="file"] {
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    left: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    top: 0 !important;
    width: 1px !important;
    z-index: -1 !important;
}

.cpc-logo-icon {
    align-items: center;
    border: 1px solid #b8c0cc;
    border-radius: 999px;
    color: #2271b1;
    display: flex;
    font-size: 24px;
    font-weight: 700;
    height: 42px;
    justify-content: center;
    line-height: 1;
    width: 42px;
}

.cpc-logo-dropzone-title {
    color: #222;
    font-size: 16px;
    font-weight: 700;
}

.cpc-logo-dropzone-meta {
    color: #666;
    font-size: 13px;
}

.cpc-logo-filename {
    color: #2271b1;
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
    position: relative;
    z-index: 1;
}

.cpc-cart-logo-thumb {
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block;
    height: auto;
    max-width: 90px;
}

.cpc-message {
    min-height: 90px;
    width: 100%;
}

.cpc-price-box {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 14px;
}

.cpc-price-box dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.cpc-price-box dl div {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.cpc-price-box dt,
.cpc-price-box dd {
    margin: 0;
}

.cpc-total {
    border-top: 1px solid #ddd;
    font-size: 18px;
    font-weight: 700;
    padding-top: 10px;
}

@media (max-width: 640px) {
    .cpc-quantity-grid {
        grid-template-columns: 1fr;
    }

    .cpc-quantity-card,
    .cpc-quantity-custom {
        grid-template-columns: 1fr;
    }

    .cpc-quantity-price {
        justify-content: flex-start;
        text-align: left;
    }

    .cpc-card-grid,
    .cpc-delivery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
