/* ===== Plate Editor Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Bebas+Neue&family=Inter:wght@400;700&family=Lato:wght@400;700&family=Lobster&family=Merriweather:wght@400;700&family=Montserrat:wght@400;700&family=Nunito:wght@400;700&family=Open+Sans:wght@400;700&family=Oswald:wght@400;700&family=Pacifico&family=Playfair+Display:wght@400;700&family=Poppins:wght@400;700&family=Raleway:wght@400;700&family=Roboto:wght@400;700&family=Rubik:wght@400;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

.pe-wrapper {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: visible;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    user-select: none;
}

/* ---- Top Bar ---- */
.pe-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 16px 4px;
}
.pe-top-actions { display: flex; gap: 10px; align-items: center; }

.pe-btn-save {
    display: flex; align-items: center; gap: 6px;
    background: #5b9bd5;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.pe-btn-save:hover { background: #4a87c0; }


/* ---- Canvas Area ---- */
.pe-canvas-area {
    padding: 0;
}

.pe-plate-outer {
    background: #111;
    border-radius: 18px;
    padding: 4px 12px 0;
    box-shadow: 0 4px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
}

.pe-plate-inner {
    position: relative;
    background: #f0f0ee;
    border-radius: 8px;
    width: 100%;
    height: auto;
    min-height: 100px;
    overflow: hidden;
    cursor: default;
}

/* ---- Ruler ---- */
.pe-ruler {
    height: 24px;
    position: relative;
    background: transparent;
    margin-top: 2px;
    overflow: hidden;
}
.pe-ruler canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---- Elements on canvas ---- */
.pe-element {
    position: absolute;
    cursor: move;
    touch-action: none;
}
.pe-element.selected { outline: 2px solid #4a87c0; }

.pe-element-text {
    white-space: nowrap;
    font-family: 'Rubik', sans-serif;
    font-size: 48px;
    font-weight: 400;
    color: #000;
    line-height: 1;
}

.pe-element-image img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

/* ---- Handles ---- */
.pe-handles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.pe-handle {
    position: absolute;
    width: 22px; height: 22px;
    background: #4a87c0;
    border: 2px solid #fff;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    pointer-events: all;
    color: #fff;
}
.pe-handle svg { width: 12px; height: 12px; }
.pe-handle-move    { top: -11px; left: -11px; cursor: move; }
.pe-handle-settings{ top: -11px; right: -11px; cursor: pointer; }
.pe-handle-delete  { bottom: -11px; left: -11px; cursor: pointer; }
.pe-handle-resize  { bottom: -11px; right: -11px; cursor: se-resize; background: #4a87c0; }

/* ---- Tooltip ---- */
.pe-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%; transform: translateX(-50%);
    background: rgba(74,135,192,.9);
    color: #fff;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    z-index: 10;
}
.pe-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%; transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(74,135,192,.9);
}
.pe-element:hover .pe-tooltip { opacity: 1; }

/* ---- Properties Bar ---- */
.pe-props-bar {
    background: #e8e8e8;
    border-top: 1px solid #d0d0d0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 56px;
}

.pe-prop-group {
    display: flex; align-items: center; gap: 6px;
}
.pe-prop-label {
    font-size: 11px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Alignment buttons */
.pe-align-btns { display: flex; gap: 2px; }
.pe-align-btn {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 7px;
    cursor: pointer;
    color: #444;
    display: flex; align-items: center;
    transition: background .1s, border-color .1s;
}
.pe-align-btn:hover, .pe-align-btn.active { background: #4a87c0; border-color: #4a87c0; color: #fff; }
.pe-align-btn svg { width: 14px; height: 14px; }

/* Number input */
.pe-num-input {
    display: flex; align-items: center;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
}
.pe-num-input input {
    width: 52px;
    border: none;
    outline: none;
    text-align: center;
    font-size: 13px;
    padding: 5px 4px;
    background: transparent;
}
.pe-num-input-icon {
    padding: 0 6px;
    color: #888;
    border-right: 1px solid #ccc;
    display: flex; align-items: center;
}
.pe-num-input-icon svg { width: 12px; height: 12px; }

/* Toggle buttons */
.pe-toggle-btn {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    font-weight: 600;
    transition: background .1s;
    display: flex; align-items: center;
}
.pe-toggle-btn.active { background: #4a87c0; border-color: #4a87c0; color: #fff; }

/* Font select */
.pe-font-select {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    outline: none;
    min-width: 110px;
}

/* Color swatch */
.pe-color-swatch {
    width: 28px; height: 28px;
    border-radius: 5px;
    border: 2px solid #bbb;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}
.pe-color-swatch input[type=color] {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    opacity: 0;
    cursor: pointer;
}

/* Upload button */
.pe-upload-btn {
    display: flex; align-items: center; gap: 6px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 12px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    transition: background .1s;
}
.pe-upload-btn:hover { background: #f0f0f0; }
.pe-upload-btn svg { width: 14px; height: 14px; }

/* ---- Bottom Bar ---- */
.pe-bottom-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 16px;
    position: relative;
}

.pe-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    border: 2px solid transparent;
    background: transparent;
    transition: all .15s;
    min-width: 72px;
}
.pe-tab-btn:hover { background: #e0e0e0; }
.pe-tab-btn.active {
    border: 2px dashed #888;
    background: #fff;
    color: #222;
}
.pe-tab-add {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ccc;
    min-width: unset;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0;
}
.pe-tab-add:hover { background: #f0f0f0; border-color: #aaa; }

/* ---- Add Menu ---- */
.pe-add-menu {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    padding: 8px 0;
    z-index: 100;
    min-width: 200px;
}
.pe-add-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    font-size: 14px;
    color: #222;
    cursor: pointer;
    transition: background .1s;
}
.pe-add-item:hover { background: #f5f5f5; }
.pe-add-item svg { color: #555; flex-shrink: 0; }

/* ---- Emoji Picker ---- */
.pe-emoji-picker {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    padding: 12px;
    z-index: 101;
    width: 280px;
}
.pe-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}
.pe-emoji-btn {
    font-size: 22px;
    padding: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    line-height: 1;
    text-align: center;
    transition: background .1s;
}
.pe-emoji-btn:hover { background: #f0f0f0; }

/* ---- Color Tab ---- */
.pe-color-tab {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #e8e8e8;
    border-top: 1px solid #d0d0d0;
}
.pe-color-tab-label { font-size: 13px; color: #555; }
.pe-bg-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.pe-bg-swatch {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .15s, transform .1s;
}
.pe-bg-swatch:hover { transform: scale(1.1); }
.pe-bg-swatch.active { border-color: #4a87c0; }

/* ---- Save Success ---- */
.pe-save-toast {
    position: fixed;
    top: 20px; left: 50%; transform: translateX(-50%);
    background: #2e7d32;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.pe-save-toast.show { opacity: 1; }

/* Responsive */
@media (max-width: 600px) {
    .pe-plate-inner { height: 140px; }
    .pe-element-text { font-size: 28px; }
    .pe-props-bar { gap: 6px; }

    .pe-bottom-bar {
        gap: 4px;
        padding: 8px 6px 12px;
        justify-content: space-around;
    }
    .pe-tab-btn {
        min-width: 0;
        flex: 1;
        padding: 7px 4px;
        font-size: 10px;
        border-radius: 10px;
        gap: 3px;
    }
    .pe-tab-btn svg { width: 20px !important; height: 20px !important; }
    .pe-tab-add {
        width: 40px;
        height: 40px;
        flex: none;
    }
    .pe-tab-add svg { width: 22px !important; height: 22px !important; }
}

/* ---- Plate background image layer ---- */
.pe-plate-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    z-index: 0;
    pointer-events: none;
}
/* When a plate image is set, hide the heavy black outer border */
.pe-plate-outer.pe-has-plate-image {
    background: transparent;
    box-shadow: none;
    padding: 0;
}
.pe-plate-outer.pe-has-plate-image .pe-plate-inner {
    background: transparent;
    border-radius: 0;
}
.pe-element { z-index: 1; }

/* ---- Plate selector (above canvas) ---- */
.pe-plate-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 4px;
    flex-wrap: wrap;
}
.pe-plate-sel-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}
.pe-plate-thumbs {
    display: flex;
    gap: 8px;
}
.pe-plate-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px;
    border: 2px solid transparent;
    transition: border-color .15s;
}
.pe-plate-thumb img {
    width: 90px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.pe-plate-thumb span { font-size: 10px; color: #555; }
.pe-plate-thumb.active { border-color: #4a87c0; }
.pe-plate-thumb:hover { border-color: #aaa; }

/* ---- Plate thumbnails in color tab props bar ---- */
.pe-bg-plate-thumb {
    width: 70px;
    height: 24px;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, transform .1s;
}
.pe-bg-plate-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.pe-bg-plate-thumb:hover { transform: scale(1.05); border-color: #aaa; }
.pe-bg-plate-thumb.active { border-color: #4a87c0; }

.pe-divider {
    color: #ccc;
    font-size: 18px;
    margin: 0 4px;
}

/* ---- Type label in top bar ---- */
.pe-type-label {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    letter-spacing: .3px;
}
.pe-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
    position: relative;
}
/* Plate bg layer */
.pe-plate-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
}
.pe-plate-outer.pe-has-plate-image { background: transparent; box-shadow: none; padding: 0; }
.pe-plate-outer.pe-has-plate-image .pe-plate-inner { background: transparent; border-radius: 0; }
.pe-element { z-index: 1; }

/* plate selector */
.pe-plate-selector { display:flex; align-items:center; gap:10px; padding:8px 16px 4px; flex-wrap:wrap; }
.pe-plate-sel-label { font-size:12px; color:#666; font-weight:600; }
.pe-plate-thumbs { display:flex; gap:8px; }
.pe-plate-thumb { display:flex; flex-direction:column; align-items:center; gap:3px; cursor:pointer; border-radius:8px; padding:4px; border:2px solid transparent; transition:border-color .15s; }
.pe-plate-thumb img { width:80px; height:26px; object-fit:cover; border-radius:4px; display:block; }
.pe-plate-thumb span { font-size:10px; color:#555; }
.pe-plate-thumb.active { border-color:#4a87c0; }
.pe-plate-thumb:hover { border-color:#aaa; }

/* inline plate thumbs in color tab */
.pe-bg-plate-thumb { width:64px; height:22px; border-radius:4px; border:2px solid transparent; cursor:pointer; overflow:hidden; transition:border-color .15s,transform .1s; }
.pe-bg-plate-thumb img { width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; }
.pe-bg-plate-thumb:hover { transform:scale(1.05); border-color:#aaa; }
.pe-bg-plate-thumb.active { border-color:#4a87c0; }
.pe-divider { color:#ccc; font-size:18px; margin:0 2px; }

/* canvas area responsive */
.pe-canvas-area { padding:0 16px; overflow:hidden; }
.pe-plate-inner { position:relative; overflow:hidden; }

/* ---- Color Zone Overlay ---- */
.pe-zone-overlay {
    border-radius: 4px;
    mix-blend-mode: multiply;
}
.pe-zone-info {
    font-size: 12px;
    color: #4a87c0;
    font-weight: 600;
    padding: 4px 0;
    width: 100%;
}

/* ---- Limited color palette (no browser color picker) ---- */
.pe-text-color-swatches {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pe-color-choice,
.pe-bg-swatch {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    border: 1px solid #777;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.pe-color-choice {
    padding: 0;
    cursor: pointer;
    appearance: none;
}
.pe-color-choice.active,
.pe-bg-swatch.active {
    outline: 3px solid rgba(74,135,192,.35);
    border-color: #4a87c0;
}
.pe-color-choice:hover,
.pe-bg-swatch:hover {
    transform: scale(1.06);
}


/* ---- Text edit area under color palette ---- */
.pe-text-edit-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}
.pe-text-edit-label {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}
.pe-text-edit-input {
    width: 100%;
    min-height: 52px;
    border: 1px solid #bbb;
    border-radius: 5px;
    background: #fff;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.35;
    outline: none;
    resize: vertical;
    user-select: text;
}
.pe-text-edit-input:focus {
    border-color: #4a87c0;
    box-shadow: 0 0 0 3px rgba(74,135,192,.15);
}

/* FULL WIDTH OVERRIDE */
.plate-editor-wrapper,
.plate-editor-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.plate-editor-canvas {
    width: 100% !important;
}

.entry-content,
.container,
.wrap {
    max-width: 100% !important;
}

/* Remove all native/browser color pickers. Colors are only fixed text swatches. */
.pe-wrapper input[type="color"],
.pe-wrapper .pcr-app,
.pe-wrapper .pickr,
.pe-wrapper .pcr-button,
.pe-bg-swatches,
.pe-bg-swatch {
    display: none !important;
}
.pe-color-help {
    width: 100%;
    background: #fff;
    border: 1px dashed #bbb;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    color: #555;
}

/* ===== FULL BLEED FINAL FIX ===== */
.plate-editor-wrapper {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    max-width: 100vw;
}

.plate-editor-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Elementor override */
.elementor-section .plate-editor-wrapper,
.elementor-container .plate-editor-wrapper {
    width: 100vw !important;
    max-width: 100vw !important;
}

/* remove paddings */
.elementor-section,
.elementor-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}


/* ===== REAL FULL WIDTH + RATIO FIX =====
   The plugin wrapper class is .pe-wrapper, not .plate-editor-wrapper.
   Also prevent plate background cropping when full width. */
.pe-wrapper {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
}

.pe-canvas-area,
.pe-plate-outer,
.pe-plate-inner,
.pe-canvas {
    width: 100% !important;
    max-width: 100% !important;
}

.pe-plate-bg {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
}

/* Elementor / theme containers */
.elementor .pe-wrapper,
.elementor-section .pe-wrapper,
.elementor-container .pe-wrapper,
.elementor-widget-shortcode .pe-wrapper {
    width: 100% !important;
    max-width: none !important;
}

.elementor-widget-shortcode,
.elementor-widget-container {
    width: 100% !important;
    max-width: none !important;
}



/* black color is now allowed in the palette */

.pe-bottom-bar {
    gap: 34px !important;
}

.pe-tab-btn {
    min-width: 86px;
    padding: 14px 18px;
    color: #505963;
}

.pe-tab-btn .pe-tab-icon {
    color: #4f5862;
    display: block;
    transition: transform .15s ease, color .15s ease;
}

.pe-tab-btn span {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .01em;
}

.pe-tab-btn:hover .pe-tab-icon,
.pe-tab-btn.active .pe-tab-icon {
    color: #222;
    transform: translateY(-1px);
}

.pe-tab-btn.active {
    border-color: #7f7f7f;
    background: rgba(255,255,255,.72);
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.pe-tab-add {
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 3px solid #d1d1d1 !important;
    color: #3f454b !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.07);
}

.pe-tab-add:hover {
    border-color: #999 !important;
    background: #fafafa !important;
}

.pe-tab-add .pe-tab-icon {
    color: #3f454b;
}

.pe-text-color-swatches {
    gap: 10px;
}

.pe-color-choice {
    width: 72px !important;
    height: 38px !important;
    border-radius: 7px !important;
}


/* ===== HANDLE ICON UPGRADE ===== */
.pe-handle {
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    background: #4a87c0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

.pe-handle svg {
    width: 18px !important;
    height: 18px !important;
    stroke-width: 2.2 !important;
    color: #fff !important;
}

/* hover */
.pe-handle:hover {
    transform: scale(1.08);
    background: #3a6fa3 !important;
}

/* ===== PREMIUM UI ===== */

/* Hide all handles */
.pe-handle {
    display: none !important;
}

/* Keep ONLY bottom-right resize handle */
.pe-handle.br {
    display: flex !important;
    position: absolute;
    width: 18px !important;
    height: 18px !important;
    background: #4a87c0 !important;
    border-radius: 50% !important;
    bottom: -8px;
    right: -8px;
    box-shadow: 0 3px 8px rgba(0,0,0,.25);
}

/* Clean selection */
.pe-element {
    border: 1px dashed transparent;
}

.pe-element.active {
    border: 2px solid #4a87c0;
}

/* Hover effect */
.pe-element:hover {
    box-shadow: 0 0 0 2px rgba(74,135,192,0.15);
}


/* ===== MOUSE RESIZE FINAL ===== */
/* Eski 4 köşe ikonlarını kapat; sadece sağ-alt resize noktası kalsın. */
.pe-handle {
    display: none !important;
}

.pe-handle-resize {
    display: flex !important;
    position: absolute !important;
    right: -12px !important;
    top: -12px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: #4a87c0 !important;
    border: 3px solid #fff !important;
    cursor: nwse-resize !important;
    pointer-events: all !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.28) !important;
    z-index: 30 !important;
}

.pe-handle-resize svg {
    display: none !important;
}

.pe-handle-resize::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translate(-1px,-1px);
}

.pe-element.selected {
    border: 2px solid #4a87c0 !important;
    box-shadow: 0 0 0 2px rgba(74,135,192,.12) !important;
}


/* ===== FINAL UI FIX ===== */

/* + button */
.pe-tab-add::before {
    content: "+";
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

/* colorful color icon */
.pe-tab-btn[data-tab="color"] .pe-tab-icon {
    background: linear-gradient(45deg, #ff4d4d, #4da6ff, #ffd24d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* better icons */
.pe-tab-icon {
    width: 26px !important;
    height: 26px !important;
    stroke-width: 2.2 !important;
}

/* active tab */
.pe-tab-btn.active {
    border: 2px solid #4a87c0;
    background: #fff;
}

.pe-tab-btn.active .pe-tab-icon {
    color: #4a87c0;
}


/* Text input label cleanup */
.pe-text-edit-label {
    font-weight: 600;
}



/* ===== FINAL OUTSIDE CONTROLS + CONTEXT MENU ===== */

/* Keep only outside delete + resize controls */
.pe-handle {
    display: none !important;
}

.pe-handle-delete,
.pe-handle-resize {
    display: flex !important;
    position: absolute !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: all !important;
    border: 3px solid #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.26) !important;
    z-index: 40 !important;
}

.pe-handle-delete {
    top: -15px !important;
    right: -15px !important;
    background: #d43b31 !important;
    color: #fff !important;
    cursor: pointer !important;
}

.pe-handle-resize {
    right: -15px !important;
    bottom: -15px !important;
    background: #4a87c0 !important;
    color: #fff !important;
    cursor: nwse-resize !important;
}

.pe-handle-delete svg,
.pe-handle-resize svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
}

.pe-element.selected {
    border: 2px solid #4a87c0 !important;
    box-shadow: 0 0 0 2px rgba(74,135,192,.12) !important;
}

.pe-context-menu {
    position: fixed;
    z-index: 999999;
    min-width: 150px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
    font-family: inherit;
}

.pe-context-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 9px 11px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    color: #222;
}

.pe-context-item:hover {
    background: #f2f5f8;
}

.pe-context-item.pe-danger {
    color: #c8322b;
    font-weight: 600;
}

.pe-context-item.pe-danger:hover {
    background: #fff0ef;
}


/* ===== FIX ICONS + MENU ===== */

/* allow overflow */
.pe-canvas,
.pe-wrapper,
.pe-plate-container,
.pe-element {
    overflow: visible !important;
}

/* move icons outside */
.pe-handle-delete {
    top: -18px !important;
    left: -18px !important;
}

.pe-handle-resize {
    bottom: -18px !important;
    right: -18px !important;
}

/* context menu fix */
.pe-context-item {
    background: #c8342f !important;
    color: #fff !important;
}

.pe-context-item.pe-danger {
    color: #fff !important;
}

.pe-context-item:hover {
    background: #a92b26 !important;
}


/* ---- Zoom controls ---- */
.pe-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 3px 6px;
    overflow: visible;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.pe-wrapper .pe-btn-zoom,
.pe-wrapper .pe-btn-zoom:hover,
.pe-wrapper .pe-btn-zoom:focus,
.pe-wrapper .pe-btn-zoom:active {
    width: 32px !important; height: 32px !important;
    border: 1px solid #ddd !important;
    background: #f5f5f5 !important;
    background-color: #f5f5f5 !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    color: #333 !important;
    border-radius: 6px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}
.pe-wrapper .pe-btn-zoom:hover {
    background: #e8e8e8 !important;
    background-color: #e8e8e8 !important;
    border-color: #bbb !important;
}
.pe-wrapper .pe-zoom-icon {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    line-height: 32px !important;
    text-align: center !important;
    font-size: 18px !important;
    font-family: Arial, sans-serif !important;
    color: #333 !important;
    pointer-events: none !important;
}
.pe-zoom-label {
    font-size: 13px;
    color: #555;
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

/* ===== PORTRAIT PRODUCT (T-Shirt etc.) — limit canvas width ===== */
.pe-wrapper[data-portrait="1"] {
    max-width: var(--pe-max-canvas-w, 500px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.pe-wrapper[data-portrait="1"] .pe-canvas-area,
.pe-wrapper[data-portrait="1"] .pe-plate-outer,
.pe-wrapper[data-portrait="1"] .pe-plate-inner,
.pe-wrapper[data-portrait="1"] .pe-canvas {
    max-width: 100% !important;
}

/* ===== REAL OUTSIDE HANDLE FIX ===== */
/* Ikonlar kutunun DISINDA dursun, kutuya girmesin */
.pe-handles {
    position: absolute !important;
    inset: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
}

.pe-element,
.pe-element.selected,
.pe-element-text,
.pe-element-image {
    overflow: visible !important;
}

/* Silme: sol ust kosenin tamamen disi */
.pe-handle-delete {
    top: -34px !important;
    left: -34px !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* Resize: sag alt kosenin tamamen disi */
.pe-handle-resize {
    right: -34px !important;
    bottom: -34px !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
}

/* ikon boyutlari */
.pe-handle-delete,
.pe-handle-resize {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    box-sizing: border-box !important;
}

/* secim kutusu ikonlar yuzunden genislemesin */
.pe-element.selected {
    outline: 2px solid #4a87c0 !important;
    border: none !important;
}


/* ===== PLATE CAROUSEL ===== */
.pe-plate-selector{padding:10px 12px 8px;background:#f5f5f5;border-top:1px solid #e0e0e0}
.pe-plate-sel-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.pe-plate-sel-label{font-size:13px;font-weight:600;color:#444}
.pe-plate-sel-counter{font-size:12px;color:#888}
.pe-plate-carousel{display:flex!important;flex-direction:row!important;align-items:center!important;gap:6px!important;width:100%}
.pe-wrapper .pe-carousel-btn{flex-shrink:0!important;width:34px!important;height:34px!important;min-width:34px!important;border-radius:50%!important;border:1px solid #ccc!important;background:#f5f5f5!important;background-color:#f5f5f5!important;color:#333!important;font-size:20px!important;line-height:34px!important;cursor:pointer!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important;box-shadow:none!important;float:none!important;position:static!important}
.pe-wrapper .pe-carousel-btn:hover{background:#e0e0e0!important}
.pe-wrapper .pe-carousel-btn:disabled{opacity:.3!important;cursor:default!important;pointer-events:none!important}
.pe-plate-thumbs-wrap{flex:1 1 auto;overflow:hidden;min-width:0}
.pe-plate-thumbs{display:flex!important;flex-direction:row!important;gap:8px!important;width:100%}
.pe-plate-thumb{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 4px;border:2px solid transparent;border-radius:10px;cursor:pointer;background:#fff;transition:border-color .15s;box-sizing:border-box}
.pe-plate-thumb:hover{border-color:#aac4e8}
.pe-plate-thumb.active{border-color:#4a87c0;background:#f0f6ff}
.pe-plate-thumb img{width:100%;height:64px;object-fit:contain;border-radius:6px}
.pe-plate-thumb span{font-size:11px;color:#555;text-align:center;word-break:break-word;line-height:1.3}

/* ===== CAROUSEL TEXT-ONLY THUMBS ===== */
.pe-plate-thumb {
    flex: 1;
    min-width: 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 8px 6px !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    background: #fff !important;
    transition: border-color .15s, background .15s !important;
    text-align: center !important;
}
.pe-plate-thumb:hover { border-color: #aac4e8 !important; background: #f5f9ff !important; }
.pe-plate-thumb.active { border-color: #4a87c0 !important; background: #e8f0fa !important; }
.pe-plate-thumb img {
    display: block !important;
    width: 100% !important;
    height: 52px !important;
    object-fit: contain !important;
    border-radius: 4px !important;
}
.pe-plate-thumb-label {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #444 !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
}
.pe-plate-thumb.active .pe-plate-thumb-label { color: #1a5fa0 !important; }
