.wepc-configurator {
    margin: 24px 0;
}

.wepc-section {
    margin: 0 0 24px;
}

.wepc-section h3 {
    color: var(--wd-title-color, inherit);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px;
}

.wepc-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;
}

.wepc-loop-customize-button::before,
.wepc-loop-customize-button::after,
.wepc-loop-customize-button .wd-tools-icon,
.wepc-loop-customize-button .wd-btn-icon,
.wepc-loop-customize-button .cart-icon,
.wepc-loop-customize-button i,
.wepc-loop-customize-button svg {
    display: none !important;
}

.wepc-quantity-grid {
    display: grid;
    gap: 12px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wepc-size-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wepc-size-card {
    align-items: center;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 8px;
    color: var(--wd-text-color, inherit);
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: auto 1fr auto;
    min-height: 44px;
    padding: 10px 12px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.wepc-size-card input {
    accent-color: var(--wd-primary-color, #2271b1);
    height: 18px;
    margin: 0;
    width: 18px;
}

.wepc-size-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);
}

.wepc-size-card strong {
    color: var(--wd-title-color, inherit);
    font-size: 13px;
    white-space: nowrap;
}

.wepc-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;
}

.wepc-quantity-card input[type="radio"] {
    accent-color: var(--wd-primary-color, #2271b1);
    height: 18px;
    margin: 0 10px 0 0;
    width: 18px;
}

.wepc-quantity-card:has(input:checked),
.wepc-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);
}

.wepc-quantity-left {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.wepc-quantity-left strong,
.wepc-quantity-price strong {
    color: var(--wd-title-color, inherit);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.wepc-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;
}

.wepc-quantity-price {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    text-align: right;
}

.wepc-quantity-price small {
    color: var(--wd-text-color, #555);
    font-size: 13px;
    line-height: 1.35;
}

.wepc-quantity-custom {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
}

.wepc-custom-quantity-input {
    grid-column: 1 / -1;
    min-height: 42px;
    width: 100%;
}

.wepc-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wepc-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;
}

.wepc-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;
}

.wepc-color-card:has(input:checked),
.wepc-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);
}

.wepc-color-swatch {
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 999px;
    display: inline-block;
    height: 22px;
    width: 22px;
}

.wepc-card-grid,
.wepc-delivery-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wepc-option-card,
.wepc-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;
}

.wepc-option-card input,
.wepc-delivery-card input {
    left: 10px;
    opacity: 0;
    position: absolute;
    top: 10px;
    z-index: 2;
}

.wepc-option-card:has(input:checked),
.wepc-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);
}

.wepc-card-image {
    aspect-ratio: 4 / 3;
    background: #f6f6f6;
    display: block;
    overflow: hidden;
    position: relative !important;
}

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

.wepc-card-preview-button {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #111;
    cursor: zoom-in;
    display: inline-flex !important;
    font-size: 18px;
    height: 24px !important;
    justify-content: center;
    line-height: 1;
    margin: 0 !important;
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    right: 8px !important;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.85);
    top: 8px !important;
    transition: transform 160ms ease;
    width: 24px !important;
    z-index: 10;
}

.wepc-card-preview-button span {
    pointer-events: none;
}

.wepc-card-preview-button:hover,
.wepc-card-preview-button:focus {
    transform: translateY(-1px);
}

.wepc-image-preview-modal {
    align-items: center;
    display: none;
    inset: 0;
    justify-content: center;
    padding: 22px;
    position: fixed;
    z-index: 999999;
}

.wepc-image-preview-modal.is-open {
    display: flex;
}

.wepc-image-preview-backdrop {
    background: rgba(0, 0, 0, 0.72);
    inset: 0;
    position: absolute;
}

.wepc-image-preview-dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    max-height: 92vh;
    max-width: min(920px, 94vw);
    overflow: hidden;
    padding: 14px;
    position: relative;
    width: auto;
    z-index: 1;
}

.wepc-image-preview-dialog img {
    display: block;
    max-height: 78vh;
    max-width: 100%;
    object-fit: contain;
}

.wepc-image-preview-dialog strong {
    color: var(--wd-title-color, #222);
    display: block;
    font-size: 15px;
    line-height: 1.35;
    padding: 12px 38px 0 0;
}

.wepc-image-preview-close {
    align-items: center;
    background: #111;
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 18px;
    height: 32px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 32px;
    z-index: 2;
}

body.wepc-preview-open {
    overflow: hidden;
}

.wepc-card-body {
    display: grid;
    gap: 5px;
    padding: 10px;
}

.wepc-card-body strong {
    color: var(--wd-title-color, inherit);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.wepc-card-body span {
    color: var(--wd-text-color, #555);
    font-size: 13px;
    line-height: 1.4;
}

.wepc-card-body em,
.wepc-card-body .wepc-card-price {
    color: var(--wd-primary-color, inherit);
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
}

.wepc-delivery-card {
    align-items: center;
    display: grid;
    gap: 8px;
    justify-items: center;
    min-height: 170px;
    padding: 18px 12px;
    text-align: center;
}

.wepc-delivery-badge {
    border-radius: 999px;
    color: #000;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 8px 12px;
}

.wepc-delivery-label {
    color: var(--wd-text-color, #555);
    font-size: 13px;
    line-height: 1.35;
}

.wepc-delivery-card strong {
    color: var(--wd-title-color, inherit);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.wepc-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;
}

.wepc-logo-preview {
    display: block;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.wepc-logo-preview img {
    border: 1px solid #ddd;
    border-radius: 6px;
    max-height: 140px;
    max-width: 220px;
    padding: 6px;
}

.wepc-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%;
}

.wepc-logo-dropzone.is-dragging,
.wepc-logo-dropzone:hover {
    background: #f2f7fb;
    border-color: #2271b1;
}

.wepc-configurator .wepc-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;
}

.wepc-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;
}

.wepc-logo-dropzone-title {
    color: #222;
    font-size: 16px;
    font-weight: 700;
}

.wepc-logo-dropzone-meta {
    color: #666;
    font-size: 13px;
}

.wepc-logo-filename {
    color: #2271b1;
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
    position: relative;
    z-index: 1;
}

.wepc-cart-logo-thumb {
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block;
    height: auto;
    max-width: 90px;
}

.wepc-message {
    min-height: 90px;
    width: 100%;
}

.wepc-price-box {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 14px;
}

.wepc-price-box dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.wepc-price-box dl div {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.wepc-price-box dt,
.wepc-price-box dd {
    margin: 0;
}

.wepc-total {
    border-top: 1px solid #ddd;
    font-size: 18px;
    font-weight: 700;
    padding-top: 10px;
}

@media (max-width: 640px) {
    .wepc-quantity-grid {
        grid-template-columns: 1fr;
    }

    .wepc-quantity-card,
    .wepc-quantity-custom {
        grid-template-columns: 1fr;
    }

    .wepc-quantity-price {
        justify-content: flex-start;
        text-align: left;
    }

    .wepc-card-grid,
    .wepc-delivery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
