/* =========================================================
   Ürün Özelleştir – Frontend Stilleri
   ========================================================= */

/* ─── CSS Değişkenleri ─────────────────────────────────── */
:root {
    --uo-primary: #e67e22;
    --uo-primary-dark: #c75b10;
    --uo-success: #27ae60;
    --uo-error: #e74c3c;
    --uo-radius: 12px;
    --uo-shadow: 0 8px 32px rgba(0, 0, 0, .18);
    --uo-transition: .22s cubic-bezier(.4, 0, .2, 1);
    --uo-overlay-bg: rgba(15, 10, 5, .72);
}

/* ─── Özelleştir Butonu ─────────────────────────────────── */
#uo-customize-wrap {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    margin-left: 10px;
    position: relative;
    z-index: 10;
}

.uo-btn-customize {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--uo-transition);
    position: relative;
    overflow: hidden;
    /* Tema butonu ayarlarını (padding, border vb.) devralması için sabit değerler kaldırıldı */
}

.uo-btn-customize::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .15) 0%, transparent 60%);
}

.uo-btn-customize:hover {
    filter: brightness(1.08) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.uo-btn-customize:active {
    transform: scale(0.98);
}

.uo-fee-badge {
    background: rgba(255, 255, 255, .25);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

/* ─── Loop Butonu ───────────────────────────────────────── */
.uo-loop-btn-container {
    margin-top: 10px;
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
    clear: both;
    display: block;
    position: relative;
    z-index: 10;
}

.uo-btn-loop {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--uo-transition);
}

.uo-btn-loop:hover {
    filter: brightness(1.08);
}

/* ─── Ön İzleme Kutusu (sepet'e eklemeden önce) ─────────── */
#uo-preview-wrap {
    margin-top: 12px;
    padding: 14px 16px;
    background: #fff8e1;
    border: 1.5px solid #ffd54f;
    border-radius: var(--uo-radius);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

#uo-preview-inner img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ffd54f;
}

#uo-preview-inner .uo-file-icon {
    width: 64px;
    height: 64px;
    background: #fff3e0;
    border-radius: 8px;
    border: 2px solid #ffd54f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.uo-btn-remove {
    padding: 7px 14px;
    border: 1.5px solid #e74c3c;
    background: #fff;
    color: #e74c3c;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background var(--uo-transition), color var(--uo-transition);
}

.uo-btn-remove:hover {
    background: #e74c3c;
    color: #fff;
}

/* ─── Modal Overlay ─────────────────────────────────────── */
.uo-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--uo-overlay-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: uoFadeIn .25s ease;
}

@keyframes uoFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ─── Modal Kutusu ──────────────────────────────────────── */
.uo-modal-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--uo-shadow);
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 520px;
    position: relative;
    animation: uoSlideUp .28s cubic-bezier(.4, 0, .2, 1);
}

@keyframes uoSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.uo-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    transition: background var(--uo-transition), color var(--uo-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.uo-modal-close:hover {
    background: #e74c3c;
    color: #fff;
}

/* ─── Header ────────────────────────────────────────────── */
.uo-modal-header {
    text-align: center;
    margin-bottom: 22px;
}

.uo-modal-icon {
    font-size: 42px;
    display: block;
    margin-bottom: 8px;
    animation: uoBounce 1.5s ease infinite alternate;
}

@keyframes uoBounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-6px);
    }
}

.uo-modal-header h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 6px;
    color: #222;
    line-height: 1.3;
}

.uo-modal-desc {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* ─── Bırak-Yükle Alanı ─────────────────────────────────── */
.uo-upload-zone {
    border: 2.5px dashed #f9a825;
    border-radius: var(--uo-radius);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--uo-transition), background var(--uo-transition), transform var(--uo-transition);
    background: #fffdf5;
    outline: none;
    user-select: none;
    position: relative;
    /* File input için */
}

/* Gizli file input tıklamayı yakalamamalı (JS üstleniyor) */
.uo-upload-zone input[type="file"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    overflow: hidden;
}

.uo-upload-zone:hover,
.uo-upload-zone:focus,
.uo-upload-zone.drag-over {
    border-color: var(--uo-primary);
    background: #fff3e0;
    transform: scale(1.01);
}

.uo-upload-icon {
    margin-bottom: 12px;
}

.uo-drop-text {
    font-size: 15px;
    color: #444;
    margin: 0 0 6px;
    line-height: 1.5;
}

.uo-file-hint {
    font-size: 11px;
    color: #aaa;
    margin: 0;
}

/* ─── İlerleme Çubuğu ───────────────────────────────────── */
.uo-progress-wrap {
    margin-top: 14px;
    background: #f0f0f0;
    border-radius: 100px;
    height: 10px;
    position: relative;
    overflow: hidden;
}

.uo-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--uo-primary), #ffd54f);
    border-radius: 100px;
    transition: width .3s ease;
}

.uo-progress-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 11px;
    color: #888;
}

/* ─── Hata Kutusu ───────────────────────────────────────── */
.uo-alert {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 12px;
}

.uo-alert-error {
    background: #fdecea;
    border: 1px solid #e74c3c;
    color: #c0392b;
}

.uo-alert-success {
    background: #eafaf1;
    border: 1px solid #27ae60;
    color: #1e8449;
}

/* ─── Modal Önizleme ────────────────────────────────────── */
.uo-modal-preview {
    margin-top: 16px;
    padding: 14px;
    background: #f9f9f9;
    border-radius: var(--uo-radius);
    text-align: center;
}

.uo-preview-file img {
    max-width: 100%;
    max-height: 160px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
    object-fit: contain;
}

.uo-preview-file .uo-pdf-icon {
    font-size: 52px;
    display: block;
}

.uo-preview-name {
    margin: 8px 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.uo-fee-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff8e1;
    border: 1px solid #ffd54f;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    color: #795548;
    margin-top: 8px;
}

/* ─── Modal Footer ──────────────────────────────────────── */
.uo-modal-footer {
    margin-top: 18px;
    text-align: center;
}

.uo-btn-confirm {
    display: inline-block;
    padding: 13px 30px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: none;
    border-radius: var(--uo-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--uo-transition), box-shadow var(--uo-transition);
    box-shadow: 0 4px 16px rgba(39, 174, 96, .35);
}

.uo-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(39, 174, 96, .45);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
    .uo-modal-box {
        padding: 24px 16px 20px;
    }

    .uo-modal-header h2 {
        font-size: 17px;
    }
}

/* =========================================================
   Sepet / Checkout – Tasarım Bilgisi (woocommerce_get_item_data)
   WooCommerce bu içeriği <dd> etiketi içinde wp_kses_post ile render eder.
   ========================================================= */

/* ─── Tasarım Wrap (thumbnail + ad yan yana) ────────────── */
.uo-item-design-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e1 100%);
    border: 1.5px solid #ffe082;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(230, 126, 34, .10);
    max-width: 280px;
    vertical-align: middle;
    margin-top: 2px;
    transition: box-shadow .18s ease;
    text-decoration: none;
}

.uo-item-design-wrap:hover {
    box-shadow: 0 4px 12px rgba(230, 126, 34, .20);
}

/* ─── Thumbnail ─────────────────────────────────────────── */
.uo-item-thumb {
    display: inline-block;
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 7px;
    border: 2px solid #ffd54f;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    flex-shrink: 0;
    /* Resmin soluk çıkmaması için */
    image-rendering: auto;
}

/* PDF / non-image ikon placeholder */
.uo-item-thumb.uo-item-thumb-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff3e0;
    border: 2px solid #ffd54f;
    border-radius: 7px;
    font-size: 22px;
    line-height: 1;
    gap: 2px;
    flex-shrink: 0;
}

.uo-item-thumb-ext {
    font-size: 8px;
    font-weight: 800;
    color: #f57f17;
    letter-spacing: .5px;
    line-height: 1;
    text-transform: uppercase;
}

/* ─── Dosya Adı ─────────────────────────────────────────── */
.uo-item-design-name {
    font-size: 12px;
    font-weight: 600;
    color: #4a3800;
    line-height: 1.35;
    /* Uzun adları kırp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 180px;
    word-break: break-word;
}

/* ─── Ek Ücret Değeri ───────────────────────────────────── */
.uo-item-fee-val {
    font-weight: 700;
    color: #b45309;
}

/* WooCommerce'in .variation dt/dd etiketleri için override ─ */
/* Tasarım kalemine ait dt gizlenebilir ya da renklendirilebilir */
dl.variation dt:has(+ dd > .uo-item-design-wrap) {
    color: #e67e22;
    font-weight: 700;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
    .uo-item-design-wrap {
        max-width: 100%;
    }

    .uo-item-design-name {
        max-width: 120px;
    }
}

/* ─── Responsive Cart ───────────────────────────────────── */
@media (max-width: 480px) {
    .uo-item-design-wrap {
        max-width: 100%;
    }

    .uo-item-design-name {
        max-width: 120px;
    }
}

/* ─── Global Responsive Overrides ────────────────────────── */
@media (max-width: 768px) {
    #uo-customize-wrap {
        display: flex;
        margin-left: 0;
        margin-top: 12px;
        width: 100%;
    }

    .uo-btn-customize {
        width: 100%;
        justify-content: center;
    }
}