/* =========================================================
   ÜRÜN GÖRSEL OLUŞTURMA — FRONTEND (kompakt düzen)
========================================================= */

#mpod-mockup-creator-frontend {
    width: 100%;
}

/* GRID: ortalanmış, dar kolon */
.mockup-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* HER SEÇİCİ SATIRI = kompakt kart */
.mockup-preview-wrapper {
    width: 100%;
    border: 1px solid #e4e4e7;
    background: #fafafa;
    border-radius: 14px;
    padding: 12px 16px;
    box-sizing: border-box;
}

.mockup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

/* SOL: etiket + dropdown */
.mockup-left {
    flex: 1 1 auto;
    min-width: 0;
}

.mockup-left > label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #444;
    margin-bottom: 6px;
}

/* SAĞ: küçük önizleme */
.mockup-right {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}

/* DROPDOWN + OK BUTONLARI */
.mockup-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.mockup-input-group select {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    padding: 11px 14px;
    border-radius: 9px;
    border: 1px solid #c9c9c9;
    font-size: 15px;
    background: #fff;
    box-sizing: border-box;
    height: auto;
}

.frontend-nav-btn {
    background: #1e3a61;
    color: #fff;
    border-radius: 9px;
    padding: 8px 11px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.frontend-nav-btn:hover {
    background: #305789;
}

/* BÜYÜK ÖNİZLEME KUTUSU */
.mockup-preview-box {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
}

.preview-img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    margin: auto !important;
}

.preview-placeholder {
    opacity: 0.5;
    font-size: 13px;
}

.mpod-placement-row{align-items:stretch}.mpod-placement-controls{display:flex;flex-direction:column;justify-content:center}.mpod-placement-help{margin:0 0 12px;color:#667085;font-size:13px}.mpod-adjust-group{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:7px 0}.mpod-adjust-group strong{min-width:58px}.mpod-adjust-group button{min-width:42px;padding:8px 11px;border:1px solid #c9d2df;border-radius:8px;background:#fff;color:#17345d;font-weight:600;cursor:pointer}.mpod-adjust-group button:hover{background:#edf5ff}.mpod-position-pad button{font-size:16px}.mpod-placement-area{margin-top:9px;color:#667085;font-size:12px;line-height:1.45}.mpod-live-placement{position:relative;width:min(360px,42vw);aspect-ratio:1;overflow:hidden;border:1px solid #d8dee8;border-radius:12px;background:#eef1f5}.mpod-live-placement #mpod-placement-mockup{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.mpod-live-placement #mpod-placement-design{position:absolute;height:auto;max-width:none!important;max-height:none!important;margin:0!important;z-index:2}.mpod-live-placement #mpod-placement-frame{position:absolute;z-index:3;border:2px dashed rgba(0,132,255,.8);pointer-events:none;box-sizing:border-box}@media(max-width:700px){.mpod-placement-row{flex-direction:column}.mpod-live-placement{width:100%;max-width:420px;margin:auto}}

#mpod-placement-design {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

#mpod-placement-interaction {
    position: absolute;
    z-index: 4;
    display: none;
    box-sizing: border-box;
    border: 1px solid rgba(34, 113, 177, .75);
    outline: 1px solid rgba(255, 255, 255, .75);
    cursor: move;
    touch-action: none;
    user-select: none;
}

#mpod-placement-interaction:hover,
#mpod-placement-interaction:focus-visible,
#mpod-placement-interaction.is-adjusting {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, .2);
    outline: none;
}

.mpod-placement-resize-handle {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #2271b1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    cursor: nwse-resize;
    box-sizing: border-box;
}

@media (max-width: 700px) {
    .mpod-placement-resize-handle {
        right: -10px;
        bottom: -10px;
        width: 20px;
        height: 20px;
    }
}

/* "ÜRÜN GÖRSELİ OLUŞTUR" BUTONU */
.generate-row {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.generate-btn {
    background: #d32238 !important;
    padding: 13px 30px;
    border-radius: 12px;
    font-size: 17px !important;
    color: #fff !important;
    border: none;
    cursor: pointer;
}

.generate-btn:hover {
    background: #a91026 !important;
}

/* ÖN İZLEME ALANI */
.frontend-preview-area {
    max-width: 100%;
    margin: 18px auto 0;
}

.frontend-preview-area h3 {
    text-align: center;
    margin: 0 0 10px;
    font-size: 18px;
}

#mpod-frontend-preview-container {
    width: 100% !important;
    padding: 18px !important;
    background: #f6f6f6;
    border: 1px solid #ececec;
    border-radius: 14px;
    box-sizing: border-box;
    text-align: center;
}

#mpod-frontend-preview-placeholder {
    opacity: 0.55;
    font-size: 14px;
}

#mpod-frontend-preview-image {
    max-width: 620px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ÇIKTI BUTONLARI (İndir / Link / Ürün Oluştur) */
.frontend-output-controls {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.frontend-output-controls .button,
.frontend-output-controls .frontend-action {
    padding: 11px 22px;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: 0.2s ease;
    font-weight: 600;
}

#mpod-frontend-download { background: #d32238 !important; color: #fff !important; }
#mpod-frontend-download:hover { background: #a91026 !important; }

#mpod-frontend-copy-link { background: #111 !important; color: #fff !important; }
#mpod-frontend-copy-link:hover { background: #000 !important; }

.frontend-action.success { background: #27ae60 !important; color: #fff !important; }
.frontend-action.success:hover { background: #2ecc71 !important; }

#mpod-frontend-create-product.loading {
    opacity: 0.6;
    pointer-events: none;
}
#mpod-frontend-create-product.loading::after {
    content: " ...";
    animation: dots 1s infinite;
}
@keyframes dots {
    0%   { content: " ..."; }
    33%  { content: " ....."; }
    66%  { content: " ......"; }
    100% { content: " ..."; }
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .mockup-row {
        flex-direction: column;
        align-items: stretch;
    }
    .mockup-right {
        justify-content: flex-start;
    }
}

/* --------------------------------------
   RESİMLİ ÖZEL DROPDOWN (sadece Ürün)
-------------------------------------- */
select.pig-dd-native {
    display: none !important;
}

select.mpod-design-native {
    display: none !important;
}

.mpod-design-picker {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

#mpod-mockup-creator-frontend button.mpod-design-picker-toggle,
#mpod-mockup-creator-frontend button.mpod-design-picker-toggle:hover,
#mpod-mockup-creator-frontend button.mpod-design-picker-toggle:focus,
#mpod-mockup-creator-frontend button.mpod-design-picker-toggle:active {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 13px;
    border: 1px solid #c9c9c9;
    border-radius: 9px;
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    color: #222 !important;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    box-shadow: none !important;
    text-shadow: none !important;
}

.mpod-design-picker-toggle img {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    object-fit: contain;
    border-radius: 5px;
    background: #f3f5f7;
}

.mpod-design-picker-toggle span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mpod-design-picker-toggle b {
    color: #667085;
    font-size: 16px;
    font-weight: 400;
}

.mpod-design-picker-panel {
    display: none;
    position: absolute;
    z-index: 10020;
    top: calc(100% + 6px);
    left: 0;
    width: min(860px, calc(100vw - 80px));
    max-height: 520px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #d7dce3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(20, 35, 55, .18);
    box-sizing: border-box;
}

.mpod-design-picker.open .mpod-design-picker-panel {
    display: block;
}

.mpod-design-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

#mpod-mockup-creator-frontend button.mpod-design-card,
#mpod-mockup-creator-frontend button.mpod-design-card:hover,
#mpod-mockup-creator-frontend button.mpod-design-card:focus,
#mpod-mockup-creator-frontend button.mpod-design-card:active {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: stretch;
    padding: 8px;
    border: 1px solid #dfe3e8;
    border-radius: 9px;
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    color: #27364a !important;
    cursor: pointer;
    text-align: left;
    text-shadow: none !important;
}

.mpod-design-card:hover,
.mpod-design-card:focus-visible {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

#mpod-mockup-creator-frontend .mpod-design-card.selected,
#mpod-mockup-creator-frontend .mpod-design-card.selected:hover,
#mpod-mockup-creator-frontend .mpod-design-card.selected:focus {
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, .2);
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    color: #27364a !important;
}

.mpod-design-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 6px;
    background: #f4f6f8;
}

.mpod-design-card span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    line-height: 1.35;
}

.mpod-design-picker-empty {
    grid-column: 1 / -1;
    padding: 18px;
    color: #667085;
    text-align: center;
}

@media (max-width: 600px) {
    .mpod-design-picker-panel {
        position: fixed;
        top: 12vh;
        right: 14px;
        left: 14px;
        width: auto;
        max-height: 76vh;
        padding: 10px;
    }
    .mpod-design-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.pig-dd {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    vertical-align: middle;
    font-size: 14px;
}

.pig-dd-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 9px;
    cursor: pointer;
}

.pig-dd-thumb {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 4px;
    background: #f1f1f1;
}

.pig-dd-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pig-dd-caret {
    flex: 0 0 auto;
    margin-left: 4px;
    color: #888;
}

.pig-dd-list {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 9px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
    display: none;
}

.pig-dd.open .pig-dd-list {
    display: block;
}

.pig-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

.pig-dd-item:hover {
    background: #eef3ff;
}


/* 0.1.2 — hizalama düzeltmeleri */
#mpod-mockup-creator-frontend .mockup-notes,
#mpod-mockup-creator-frontend .mockup-notes * {
    text-align: left !important;
}

.pig-dd-item .pig-dd-label {
    text-align: left !important;
    flex: 1 1 auto;
}

.pig-dd-item .pig-dd-thumb {
    margin-left: auto;
    margin-right: 0;
    flex: 0 0 30px;
}


/* 0.1.3 — ürün dropdown hizası */
.pig-dd-selected .pig-dd-label {
    order: 1;
    text-align: left !important;
    font-size: 15px !important;
    line-height: 1.4;
}
.pig-dd-selected .pig-dd-thumb {
    order: 2;
    margin-left: auto;
    margin-right: 0;
}
.pig-dd-selected .pig-dd-caret {
    order: 3;
}
.pig-dd-item .pig-dd-label {
    font-size: 15px !important;
}


/* Önizleme ürün bilgisi: ad / SKU / fiyat */
.mpod-preview-product-info {
    text-align: center;
    margin: -4px 0 12px;
    line-height: 1.35;
}
.mpod-preview-product-info > div {
    margin: 1px 0;
    font-size: 15px;
}
#mpod-preview-product-name {
    font-weight: 600;
}
#mpod-preview-product-sku {
    font-size: 14px;
}
#mpod-preview-product-price {
    font-weight: 600;
}


/* 1.1.11 - Ürün Oluştur ana butonu: ortalı ve kompakt */
#mpod-mockup-creator-frontend .generate-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}
#mpod-mockup-creator-frontend .generate-row .mockup-left {
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
}
#mpod-mockup-creator-frontend .generate-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
}
#mpod-mockup-creator-frontend .mockup-notes + .generate-row {
    margin-top: -2px !important;
}
