.kkt-wrapper {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
}

.kkt-form h3 {
    margin-bottom: 18px;
}

.kkt-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.kkt-box-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.kkt-box-card {
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.kkt-box-card:hover {
    border-color: #bdbdbd;
}

.kkt-box-card input[type='radio'] {
    align-self: flex-start;
}

.kkt-box-card input[type='radio']:checked + img {
    outline: 2px solid #2a7f62;
    outline-offset: 2px;
}

.kkt-box-card input {
    margin: 0;
}

.kkt-box-card img {
    width: 100%;
    height: 140px;
    border-radius: 4px;
    background: #fff;
    object-fit: contain;
    padding: 6px;
    border: 1px solid #ececec;
}

.kkt-box-card span {
    font-weight: 600;
}

.kkt-box-title {
    display: block;
    font-weight: 700;
}

.kkt-box-subtitle {
    display: block;
    margin-top: -4px;
    color: #666;
    font-size: 12px;
}

.kkt-preview-btn {
    border: 1px solid #c8c8c8;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.kkt-preview-btn:hover {
    background: #f2f2f2;
}

.kkt-preview-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, 94vw);
    max-height: 88vh;
    background: #fff;
    border-radius: 12px;
    z-index: 100001;
    padding: 18px 18px 10px;
    display: none;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.kkt-preview-modal.is-open {
    display: block;
}

.kkt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    display: none;
}

.kkt-modal-backdrop.is-open {
    display: block;
}

.kkt-modal-close {
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    float: right;
}

.kkt-modal-image {
    width: 100%;
    height: auto;
    max-height: 72vh;
    object-fit: contain;
    display: block;
    background: #fff;
}

.kkt-modal-title {
    margin: 12px 0 4px;
    text-align: center;
    font-weight: 700;
}

.kkt-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kkt-three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kkt-measure-preview {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 16px;
    align-items: start;
}

.kkt-stack-fields {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 8px;
}

.kkt-measure-fields {
    min-width: 0;
}

.kkt-live-preview {
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 12px;
    background: linear-gradient(180deg, #fcfcfc 0%, #f7f7f7 100%);
}

.kkt-preview-head {
    font-weight: 700;
    margin-bottom: 2px;
}

.kkt-preview-code {
    display: block;
    color: #666;
    margin-bottom: 8px;
}

.kkt-live-dims {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 10px;
    color: #444;
    font-weight: 600;
}

.kkt-three-canvas {
    width: 100%;
    height: 290px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: radial-gradient(circle at 30% 20%, #f5f5f5 0%, #e7e7e7 60%, #dddddd 100%);
    margin-bottom: 10px;
    overflow: hidden;
}

.kkt-three-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.kkt-dyn-box-svg {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: linear-gradient(180deg, #f7f7f7 0%, #efefef 100%);
    margin-bottom: 10px;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.12));
}

.kkt-dyn-front {
    fill: url(#kktCardboardPattern);
    stroke: #93794c;
    stroke-width: 2;
}

.kkt-dyn-top {
    fill: #e7d2a5;
    stroke: #93794c;
    stroke-width: 2;
}

.kkt-dyn-side {
    fill: #c9b07f;
    stroke: #93794c;
    stroke-width: 2;
}

.kkt-dyn-back {
    fill: #f0e2c2;
    stroke: #93794c;
    stroke-width: 1.8;
    opacity: 0.9;
}

.kkt-dyn-inner {
    fill: #f5ead2;
    stroke: #b19769;
    stroke-width: 1.6;
}

.kkt-dyn-lid {
    fill: #dcc79a;
    stroke: #93794c;
    stroke-width: 1.8;
}

.kkt-dyn-lid-side {
    fill: #c8b07f;
    stroke: #93794c;
    stroke-width: 1.6;
}

.kkt-dyn-shadow {
    fill: rgba(0, 0, 0, 0.15);
}

.kkt-dyn-flap-left,
.kkt-dyn-flap-right {
    fill: #d9c28f;
    stroke: #93794c;
    stroke-width: 1.5;
}

.kkt-dyn-crease {
    stroke: #8f7851;
    stroke-dasharray: 3 3;
    stroke-width: 1.2;
}

.kkt-dim {
    font-size: 13px;
    fill: #3a3a3a;
    font-weight: 600;
}

.kkt-preview-note {
    display: block;
    margin-top: 6px;
    color: #666;
}

.kkt-form label span {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.kkt-print-price-info {
    display: block;
    margin-top: 8px;
    color: #454545;
}

.kkt-print-extra {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #d8d8d8;
}

.kkt-inline-label {
    display: block;
    margin-bottom: 10px;
}

.kkt-inline-label textarea {
    width: 100%;
    resize: vertical;
}

.kkt-print-price-value,
.kkt-unit-price-value,
.kkt-price-value {
    white-space: nowrap;
    display: inline-block;
}

.kkt-print-price-value .woocommerce-Price-amount,
.kkt-unit-price-value .woocommerce-Price-amount,
.kkt-price-value .woocommerce-Price-amount {
    white-space: nowrap;
}

.kkt-form input[type='number'],
.kkt-form input[type='file'],
.kkt-form select {
    width: 100%;
}

.kkt-qty-control {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    gap: 8px;
    align-items: center;
}

.kkt-qty-btn {
    height: 42px;
    border: 1px solid #d2d2d2;
    background: #f6f6f6;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.kkt-qty-btn:hover {
    background: #ececec;
}

.kkt-qty-control input[name='kkt_quantity'] {
    text-align: center;
    font-weight: 700;
}

.kkt-price-box {
    margin-bottom: 16px;
    background: #f4f8f7;
    border: 1px solid #d9e6e1;
    border-radius: 8px;
    padding: 12px;
}

.kkt-add-cart-btn {
    margin-right: 8px;
}

@media (max-width: 768px) {
    .kkt-measure-preview {
        grid-template-columns: 1fr;
    }

    .kkt-box-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kkt-box-card img {
        height: 110px;
    }

    .kkt-two-col,
    .kkt-three-col {
        grid-template-columns: 1fr;
    }
}
