/* Public CSS */

/* CSS Variables - Kullanıcı Özelleştirilebilir Renkler */
:root {
    --ewgc-form-dark: #6c60f0;
    --ewgc-form-light: #b2cdfd;
    --ewgc-form-shadow: #6c60f070;
}

/* Gift Card Önizleme Alanı */
.ewgc-preview-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 4%);
    border: 1px solid #e9e9e9;
    margin-right: 30px;
}

.ewgc-preview-image {
    margin-bottom: 20px;
    text-align: center;
}

.ewgc-preview-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Önizleme Header - Ad ve Fiyat */
.ewgc-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ewgc-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.ewgc-preview-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--ewgc-form-dark);
}

/* Divider */
.ewgc-preview-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 15px 0;
}

/* Önizleme Detayları */
.ewgc-preview-details {
    font-size: 14px;
}

.ewgc-preview-row {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
}

.ewgc-preview-label {
    font-weight: 600;
    color: #6b7280;
    min-width: 70px;
}

.ewgc-preview-from,
.ewgc-preview-to,
.ewgc-preview-message {
    color: #374151;
    font-style: italic;
    flex: 1;
}

/* Boş durum placeholder */
.ewgc-preview-from:empty::before,
.ewgc-preview-to:empty::before,
.ewgc-preview-message:empty::before {
    content: '...';
    color: #9ca3af;
}

.ewgc-product-form {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e7e7e7;
    width: -webkit-fill-available;
}

.ewgc-product-form h3 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
}

.ewgc-form-group {
    margin-bottom: 20px;
}

.ewgc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.ewgc-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.ewgc-input,
.ewgc-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.ewgc-textarea {
    min-height: 130px !important;
}

#ewgc_recipient_email::placeholder {
    color: #777777;
}

/* Tutar Seçimi - Görseldeki Tasarım */
.ewgc-amount-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.ewgc-amount-option {
    position: relative;
    cursor: pointer;
}

.ewgc-amount-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Kart - Beyaz, Border */
.ewgc-amount-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 55px;
    padding: 16px 14px;
    text-align: center;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Hover - Teal Border + Gölge */
.ewgc-amount-option:hover .ewgc-amount-card {
    border-color: var(--ewgc-form-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--ewgc-form-shadow);
}

/* Seçili - Teal Arka Plan + Checkmark */
.ewgc-amount-option input[type="radio"]:checked+.ewgc-amount-card {
    background: linear-gradient(135deg, var(--ewgc-form-light) 0%, var(--ewgc-form-dark) 100%);
    color: #ffffff;
    border-color: var(--ewgc-form-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--ewgc-form-shadow);
}

.ewgc-amount-option input[type="radio"]:checked+.ewgc-amount-card bdi {
    color: #ffffff;
}

/* Checkmark İkonu - Glassmorphism */
.ewgc-amount-option input[type="radio"]:checked+.ewgc-amount-card::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Özel Tutar Kartı */
.ewgc-custom-card {
    flex-direction: column;
    gap: 8px;
    padding: 12px 10px;
}


.ewgc-custom-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.ewgc-custom-card input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    transition: all 0.2s ease;

}

.ewgc-custom-card input[type="number"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.2);
}


/* Özel tutar seçildiğinde - Teal */
.ewgc-custom-option input[type="radio"]:checked+.ewgc-custom-card {
    background: linear-gradient(135deg, var(--ewgc-form-light) 0%, var(--ewgc-form-dark) 100%);
}

.ewgc-custom-option input[type="radio"]:checked+.ewgc-custom-card .ewgc-custom-label {
    color: #ffffff;
}

.ewgc-custom-option input[type="radio"]:checked+.ewgc-custom-card input[type="number"] {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.ewgc-custom-card input[type="number"]::placeholder {
    color: #9ca3af;
    font-size: 12px;
}

.ewgc-custom-option input[type="radio"]:checked+.ewgc-custom-card input[type="number"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Eski custom-amount class'ını gizle */
.ewgc-custom-amount {
    display: none;
}

/* Cart Gift Card */
.ewgc-cart-gift-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ewgc-cart-gift-card h3 {
    margin-top: 0;
    font-size: 18px;
}

.ewgc-apply-gift-card-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.ewgc-apply-gift-card-form input {
    flex: 1;
}

.ewgc-gift-card-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

.ewgc-gift-card-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ewgc-gift-card-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ewgc-applied-gift-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #d4edda;
    border-radius: 4px;
}

/* Balance Check */
.ewgc-balance-check,
.ewgc-balance-update {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 20px auto;
}

.ewgc-balance-check h3,
.ewgc-balance-update h3 {
    margin-top: 0;
    color: #333;
}

.ewgc-balance-check-form,
.ewgc-balance-update-form {
    margin-top: 20px;
}

.ewgc-balance-check-form {
    display: flex;
    gap: 10px;
}

.ewgc-balance-check-form input {
    flex: 1;
}

.ewgc-balance-result,
.ewgc-update-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}

.ewgc-balance-result.success,
.ewgc-update-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ewgc-balance-result.error,
.ewgc-update-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ewgc-balance-info {
    margin-top: 15px;
}

.ewgc-balance-info p {
    margin: 8px 0;
    font-size: 16px;
}

.ewgc-balance-info strong {
    color: #14b8a6;
    font-size: 24px;
}

/* Image Upload */
#ewgc_image_preview {
    margin-top: 10px;
}

#ewgc_image_preview img {
    max-width: 200px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Responsive */
@media (max-width: 768px) {
    .ewgc-amount-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .ewgc-amount-card {
        min-height: 50px;
        font-size: 14px;
    }

    .ewgc-apply-gift-card-form {
        flex-direction: column;
    }

    .ewgc-balance-check-form {
        flex-direction: column;
    }

    /* Önizleme responsive */
    .ewgc-preview-container {
        margin-right: 0px;
    }

    .ewgc-preview-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
    }

    .ewgc-preview-amount {
        font-size: 16px;
    }

    .ewgc-preview-image img {
        max-width: 100%;
    }

    /*Mobil Slider Stili*/
    .ewgc-design-slider-container {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 12px;
        min-width: 320px !important;
        max-width: 100% !important;
        justify-self: anchor-center !important;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .ewgc-amount-options {
        grid-template-columns: repeat(3, 1fr);
    }

    /*Tablet Slider Stili*/
    .ewgc-design-slider-container {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-top: 12px;
        max-width: 660px;
    }
}

/* Tasarım Seçici Slider */
.ewgc-design-selector {
    margin-bottom: 25px;
}

.ewgc-design-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 12px;
    max-width: 560px;
}

.ewgc-design-slider {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ewgc-design-slider-track {
    display: flex;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ewgc-design-item {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.ewgc-design-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ewgc-design-item:hover {
    border-color: var(--ewgc-form-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ewgc-design-item.selected {
    border: 2px solid var(--ewgc-form-dark);
    box-shadow: 0 4px 12px var(--ewgc-form-shadow);
}

.ewgc-design-checkmark {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ewgc-design-item.selected .ewgc-design-checkmark {
    display: flex;
}

.ewgc-slider-arrow {
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ewgc-slider-arrow:hover {
    border-color: var(--ewgc-form-dark);
    background: var(--ewgc-form-dark);
}

.ewgc-slider-arrow .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ewgc-slider-arrow:hover .dashicons {
    color: #ffffff;
}

.ewgc-slider-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .ewgc-design-item {
        width: 100px;
        height: 75px;
    }

    .ewgc-slider-arrow {
        width: 35px;
        height: 35px;
    }
}

/* Özel Görsel Yükleme Bilgilendirme */
.ewgc-upload-info {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
    margin-bottom: 0;
    font-style: italic;
}

/* Order-received sayfasında boş meta satırlarını gizle */
.woocommerce-order-details .woocommerce-table--order-details tbody tr td:empty,
.woocommerce-order-details .woocommerce-table--order-details tbody tr td:empty+td {
    display: none !important;
}

/* Meta key ve value boşsa tüm satır gizle */
.woocommerce-order-details .woocommerce-table--order-details tbody tr:has(td:empty) {
    display: none !important;
}

/* ===== MİKTAR + TESLİMAT TARİHİ AYNI SATIR ===== */
.ewgc-form-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ewgc-form-col {
    display: flex;
    flex-direction: column;
}

.ewgc-col-quantity {
    flex: 0 0 30%;
    max-width: 30%;
}

.ewgc-col-date {
    flex: 0 0 calc(70% - 12px);
    max-width: calc(70% - 12px);
    padding-left: 12px;
}

.ewgc-timezone-notice {
    font-size: 86% !important;
    margin-bottom: 6px !important;
}

/* +/- Miktar Wrapper */
.ewgc-qty-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.ewgc-qty-btn {
    flex: 0 0 36px;
    height: 42px;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #374151;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ewgc-qty-btn:hover {
    background: #e5e7eb;
}

.ewgc-qty-input {
    flex: 1;
    border: none !important;
    border-left: 1px solid #d1d5db !important;
    border-right: 1px solid #d1d5db !important;
    border-radius: 0 !important;
    text-align: center;
    -moz-appearance: textfield;
    height: 42px;
    margin: 0 !important;
    box-shadow: none !important;
}

.ewgc-qty-input::-webkit-outer-spin-button,
.ewgc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Mobil */
@media (max-width: 480px) {
    .ewgc-form-col {
        width: -webkit-fill-available;
    }

    .ewgc-form-row {
        flex-direction: column;
        gap: 20px;
    }

    .ewgc-qty-btn {
        flex: 0 0 80px;
        font-size: 14px !important;
    }

    .ewgc-col-quantity,
    .ewgc-col-date {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .ewgc-col-date {
        padding-left: 0px;
    }
}

/* ===== datetime-local MOBIL RENDER DÜZELTMESİ ===== */
/* Tüm boyutlarda input tam genişlikte kalsin */
.ewgc-col-date,
.ewgc-col-date .ewgc-input,
input#ewgc_delivery_date {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

input[type="datetime-local"]#ewgc_delivery_date,
input[type="date"]#ewgc_delivery_date {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    display: block !important;
}

/* Breakpoint'i 768px'e yükselt (480px modern telefonlar için çok dar) */
@media (max-width: 768px) {
    .ewgc-form-row {
        flex-direction: column;
        gap: 16px;
    }

    .ewgc-col-quantity,
    .ewgc-col-date {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    input#ewgc_delivery_date {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 45px !important;
    }
}

/* ===== TARİH INPUT PLACEHOLDER ===== */
input#ewgc_delivery_date::placeholder {
    color: #9ca3af;
    opacity: 1;
}

input#ewgc_delivery_date::-webkit-input-placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Değer girildiğinde placeholder gizlenir (doğal davran) */
input#ewgc_delivery_date::-webkit-datetime-edit {
    color: #374151;
}

input#ewgc_delivery_date:not([value])::-webkit-datetime-edit,
input#ewgc_delivery_date[value=""]::-webkit-datetime-edit {
    color: #9ca3af;
}

/* ===== TARİH INPUT WRAPPER PLACEHOLDER ===== */
.ewgc-date-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* Placeholder overlay değer yokken görünür */
.ewgc-date-input-wrapper::before {
    content: attr(data-placeholder);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
}

/* Değer girildiğinde veya focus'ta placeholder gizle */
.ewgc-date-input-wrapper.has-value::before,
.ewgc-date-input-wrapper.has-focus::before {
    display: none;
}

/* Input arka planı şeffaf olmamalı ki placeholder görünsün */
.ewgc-date-input-wrapper .ewgc-input {
    width: 100%;
    position: relative;
    z-index: 1;
    color: #374151;
}

/* Boşken input yazısını saydamlaştırarak placeholder görecek yap */
.ewgc-date-input-wrapper:not(.has-value) .ewgc-input::-webkit-datetime-edit-fields-wrapper {
    color: transparent;
}

.ewgc-date-input-wrapper:not(.has-value) .ewgc-input::-webkit-datetime-edit {
    color: transparent;
}

.ewgc-date-input-wrapper.has-value .ewgc-input::-webkit-datetime-edit-fields-wrapper,
.ewgc-date-input-wrapper.has-value .ewgc-input::-webkit-datetime-edit {
    color: #374151;
}

/* ===== EWGC TARAYICI DIALOG ===== */

/* Plugin bildirimlerini anında CSS ile gizle — JS çalışmadan önce flash olmasın */
.woocommerce-info:has(.ewgc-notice-msg) {
    display: none !important;
}
.ewgc-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ewgc-dialog-overlay.ewgc-dialog-visible {
    opacity: 1;
}

.ewgc-dialog-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 36px 30px 28px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    transform: translateY(-24px) scale(0.97);
    transition: transform 0.3s ease;
}

.ewgc-dialog-overlay.ewgc-dialog-visible .ewgc-dialog-box {
    transform: translateY(0) scale(1);
}

.ewgc-dialog-icon {
    font-size: 44px;
    line-height: 1;
    color: #3b82f6;
    margin-bottom: 16px;
}

.ewgc-dialog-message {
    font-size: 15px;
    color: #374151;
    line-height: 1.65;
    margin-bottom: 26px;
}

.ewgc-dialog-message strong {
    color: #111827;
}

.ewgc-dialog-ok {
    display: inline-block;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 11px 38px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.01em;
}

.ewgc-dialog-ok:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.ewgc-dialog-ok:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .ewgc-dialog-box {
        padding: 28px 20px 22px;
        border-radius: 12px;
    }
    .ewgc-dialog-icon {
        font-size: 36px;
    }
}