.kpt3d-breloc {
    --kb-border: #e2e4e8;
    --kb-accent: #2a7bd1;
    margin: 0 0 20px;
    padding: 20px;
    border: 1px solid var(--kb-border);
    border-radius: 14px;
    background: #fafbfc;
    width: 100%;
}

.kpt3d-breloc__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 230px;
    margin-bottom: 18px;
    border-radius: 10px;
    background:
        linear-gradient(45deg, #f0f1f3 25%, transparent 25%, transparent 75%, #f0f1f3 75%) 0 0 / 20px 20px,
        linear-gradient(45deg, #f0f1f3 25%, transparent 25%, transparent 75%, #f0f1f3 75%) 10px 10px / 20px 20px,
        #fff;
}

/* Forma brelocului */
.kpt3d-breloc__shape {
    --size: 4;
    --base: #1c1c1c;
    --logo: #f5f5f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--size) * 32px);
    height: calc(var(--size) * 32px);
    background: var(--base);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18), inset 0 -3px 0 rgba(0, 0, 0, .15);
    transition: width .2s, height .2s, border-radius .2s, background-color .2s;
}

.kpt3d-breloc__shape::before {
    content: "";
    position: absolute;
    top: 8%;
    left: 50%;
    width: 12%;
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
}

.kpt3d-breloc__shape.is-cerc {
    border-radius: 50%;
}

.kpt3d-breloc__shape.is-dreptunghi,
.kpt3d-breloc__shape.is-alegem {
    width: calc(var(--size) * 38px);
    height: calc(var(--size) * 26px);
    border-radius: 18px;
}

.kpt3d-breloc__shape.is-dreptunghi::before,
.kpt3d-breloc__shape.is-alegem::before {
    top: 50%;
    left: 7%;
    width: 9%;
    transform: translateY(-50%);
}

.kpt3d-breloc__shape.is-alegem {
    outline: 2px dashed var(--kb-accent);
    outline-offset: 6px;
}

/* Forma "pentru căruciorul de cumpărături" — randată ca SVG de JS */
.kpt3d-breloc__shape.is-carucior {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    width:  calc(var(--size) * 30px);
    height: calc(var(--size) * 46px);
    overflow: visible;
}

.kpt3d-breloc__shape.is-carucior::before { display: none; }

.kpt3d-carucior-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,.22));
}

.kpt3d-breloc__shape.is-carucior .kpt3d-breloc__logo {
    position: absolute;
    /* Sus, în cercul mare — circa 65% din lățime, centrat sus */
    top: 12%;
    left: 50%;
    width: 60%;
    height: 55%;
    margin-left: -30%;
}

.kpt3d-breloc__shape.is-contur {
    background: transparent;
    box-shadow: none;
}

.kpt3d-breloc__shape.is-contur::before {
    top: 0;
    left: 0;
    width: 14%;
    transform: none;
    border: 4px solid var(--base);
    background: #fff;
}

/* Logo */
.kpt3d-breloc__logo {
    width: 64%;
    height: 64%;
    background: var(--img, none) center / contain no-repeat;
}

.kpt3d-breloc__logo.is-mask {
    background: var(--logo);
    -webkit-mask: var(--img) center / contain no-repeat;
            mask: var(--img) center / contain no-repeat;
}

.kpt3d-breloc__shape.is-contur .kpt3d-breloc__logo {
    width: 90%;
    height: 90%;
    filter:
        drop-shadow(4px 0 0 var(--base)) drop-shadow(-4px 0 0 var(--base))
        drop-shadow(0 4px 0 var(--base)) drop-shadow(0 -4px 0 var(--base));
}

.kpt3d-breloc__logo.is-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: var(--logo);
}

.kpt3d-breloc__logo {
    transition: transform .25s ease;
}

/* Rotire */
.kpt3d-breloc__rotate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: -8px 0 16px;
}

.kpt3d-breloc__rotate-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--kb-border);
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.kpt3d-breloc__rotate-btn:hover {
    border-color: var(--kb-accent);
    color: var(--kb-accent);
}

.kpt3d-breloc__rotate-value {
    min-width: 80px;
    text-align: center;
    font-size: 14px;
    color: #555;
}

/* Câmpuri */
.kpt3d-breloc__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.kpt3d-breloc__field {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.kpt3d-breloc__label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    padding: 0;
}

.kpt3d-breloc__color-name {
    font-weight: 400;
}

.kpt3d-breloc select,
.kpt3d-breloc textarea {
    width: 100%;
}

.kpt3d-breloc__hint {
    display: block;
    margin-top: 4px;
    color: #777;
}

.kpt3d-breloc__status {
    margin-top: 6px;
    font-size: 14px;
}
.kpt3d-breloc__status.is-ok      { color: #2e7d32; }
.kpt3d-breloc__status.is-error   { color: #c62828; }
.kpt3d-breloc__status.is-loading { color: #555; }

/* Culori */
.kpt3d-breloc__colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kpt3d-breloc__colors legend {
    width: 100%;
}

.kpt3d-breloc__swatch {
    position: relative;
    cursor: pointer;
}

.kpt3d-breloc__swatch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.kpt3d-breloc__swatch span {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .2);
    transition: transform .15s, box-shadow .15s;
}

.kpt3d-breloc__swatch.is-original span {
    background: conic-gradient(#e53935, #fbc02d, #43a047, #1e88e5, #8e24aa, #e53935);
}

.kpt3d-breloc__swatch input:checked + span {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--kb-accent);
    transform: scale(1.05);
}

.kpt3d-breloc__swatch input:focus-visible + span {
    outline: 2px solid var(--kb-accent);
    outline-offset: 3px;
}

.kpt3d-breloc__total {
    padding-top: 12px;
    border-top: 1px solid var(--kb-border);
    font-size: 18px;
}

@media (max-width: 480px) {
    .kpt3d-breloc__row { grid-template-columns: 1fr; }
    .kpt3d-breloc__preview { height: 200px; }
}

/* Simulare 3D (în locul galeriei produsului) */
.kpt3d-3d {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 35%, #ffffff 0%, #eef0f3 70%, #e3e6ea 100%);
}

.kpt3d-3d__stage {
    width: 100%;
    aspect-ratio: 1 / 1;
    cursor: grab;
}

.kpt3d-3d__stage:active {
    cursor: grabbing;
}

.kpt3d-3d__stage canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.kpt3d-3d__hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .85);
    font-size: 12px;
    color: #555;
    pointer-events: none;
    white-space: nowrap;
}

.woocommerce-product-gallery.kpt3d-hidden {
    display: none !important;
}

.kpt3d-breloc.has-3d .kpt3d-breloc__preview {
    display: none;
}

.kpt3d-breloc.has-3d .kpt3d-breloc__rotate {
    margin-top: 0;
}

.kpt3d-breloc > .kpt3d-3d {
    margin-bottom: 16px;
}

.kpt3d-3d__reset {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border: 1px solid #d7dae0;
    border-radius: 20px;
    background: rgba(255, 255, 255, .92);
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.kpt3d-3d__reset:hover {
    border-color: #2a7bd1;
    color: #2a7bd1;
}

.kpt3d-3d__reset[hidden],
.kpt3d-3d__hint[hidden] {
    display: none;
}

/* Protecție împotriva stilurilor de butoane din temă (WoodMart) */
.kpt3d-breloc .kpt3d-breloc__rotate .kpt3d-breloc__rotate-btn,
.kpt3d-3d button.kpt3d-3d__reset {
    min-height: 0 !important;
    height: auto;
    margin: 0;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    transition: border-color .15s, color .15s;
}

.kpt3d-breloc .kpt3d-breloc__rotate .kpt3d-breloc__rotate-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 1px solid #d7dae0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #333 !important;
    font-size: 20px !important;
}

.kpt3d-breloc .kpt3d-breloc__rotate .kpt3d-breloc__rotate-btn:hover {
    border-color: #2a7bd1 !important;
    color: #2a7bd1 !important;
}

.kpt3d-3d button.kpt3d-3d__reset {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 2;
    padding: 7px 14px !important;
    border: 1px solid #d7dae0 !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, .95) !important;
    color: #333 !important;
    font-size: 13px !important;
}

.kpt3d-3d button.kpt3d-3d__reset:hover {
    border-color: #2a7bd1 !important;
    color: #2a7bd1 !important;
}

.kpt3d-3d button.kpt3d-3d__reset[hidden] {
    display: none !important;
}

/* Miniatura logo-ului încărcat */
.kpt3d-breloc__thumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid var(--kb-border);
    border-radius: 10px;
    background: #fff;
}

.kpt3d-breloc__thumb[hidden] {
    display: none;
}

.kpt3d-breloc__thumb-img {
    flex: 0 0 72px;
    height: 72px;
    border-radius: 6px;
    background-color: #fff;
    background-image:
        var(--thumb, none),
        linear-gradient(45deg, #eceef1 25%, transparent 25%, transparent 75%, #eceef1 75%),
        linear-gradient(45deg, #eceef1 25%, transparent 25%, transparent 75%, #eceef1 75%);
    background-size: contain, 12px 12px, 12px 12px;
    background-position: center, 0 0, 6px 6px;
    background-repeat: no-repeat, repeat, repeat;
}

.kpt3d-breloc__thumb-img.is-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #c62828;
}

.kpt3d-breloc__thumb-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 13px;
    line-height: 1.4;
}

.kpt3d-breloc__thumb-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.kpt3d-breloc__thumb-size {
    color: #777;
}

.kpt3d-breloc__status.is-warn {
    color: #b26a00;
}

/* Notă sub simularea 3D */
.kpt3d-3d__note {
    margin: -8px 0 20px;
    padding: 10px 14px;
    border-left: 3px solid #2a7bd1;
    border-radius: 0 8px 8px 0;
    background: #f3f7fc;
    font-size: 13px;
    line-height: 1.5;
    color: #444;
}

/* Text opțional sub siglă (cerc) */
.kpt3d-stacked-text[hidden] { display:none !important; }
.kpt3d-stacked-text input { width:100%; }
.kpt3d-stacked-text > small { display:block; margin-top:6px; line-height:1.5; color:#667085; }

/* Calculator de preț */
.kpt3d-breloc__calculator {
    margin-top: 4px;
    padding: 14px 16px;
    border: 1px solid var(--kb-border);
    border-radius: 10px;
    background: #fff;
}

.kpt3d-breloc__calculator-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}

.kpt3d-breloc__calculator-body {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.kpt3d-breloc__calc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpt3d-breloc__calc-label {
    font-weight: 600;
    white-space: nowrap;
}

.kpt3d-breloc__qty-input {
    width: 80px !important;
    padding: 6px 8px !important;
    border: 1px solid var(--kb-border) !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    text-align: center;
}

.kpt3d-breloc__calc-result {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 14px;
    color: #333;
}

.kpt3d-breloc__calc-tier {
    font-weight: 600;
    color: var(--kb-accent);
}

.kpt3d-breloc__calc-unit {
    font-weight: 500;
}

.kpt3d-breloc__price-table-wrap {
    margin-top: 12px;
}

.kpt3d-breloc__price-table-toggle {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: var(--kb-accent) !important;
    font-size: 13px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: 500 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
}

.kpt3d-breloc__price-table-toggle:hover {
    text-decoration: underline;
}

.kpt3d-breloc__price-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 13px;
}

.kpt3d-breloc__price-table th,
.kpt3d-breloc__price-table td {
    padding: 6px 10px;
    border: 1px solid var(--kb-border);
    text-align: center;
}

.kpt3d-breloc__price-table th:first-child,
.kpt3d-breloc__price-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.kpt3d-breloc__price-table thead th {
    background: #f3f4f6;
    font-weight: 700;
}

.kpt3d-breloc__price-table tr.is-active td {
    background: #eef5ff;
    font-weight: 700;
    color: #1a56c4;
}

.kpt3d-breloc__price-table td.is-active-col,
.kpt3d-breloc__price-table th.is-active-col {
    background: #f0f7ff;
}

.kpt3d-breloc__price-table tr.is-active td.is-active-col {
    background: #d4e8ff;
}

.kpt3d-breloc__price-table[hidden] { display: none; }
