/* =====================================================
   Etiket Hesaplayıcı Widget — Konsept A
   İki Panel: Sol (Konfigürasyon) | Sağ (Canlı Fiyat)
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.eh-root {
    --eh-primary:      #f66d21;
    --eh-primary-dark: #e05e19;
    --eh-navy:         #1a365d;
    --eh-text:         #1e293b;
    --eh-muted:        #64748b;
    --eh-border:       #e2e8f0;
    --eh-bg:           #ffffff;
    --eh-bg-right:     #f8fafc;
    --eh-success:      #16a34a;
    --eh-radius:       20px;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--eh-bg);
    border-radius: var(--eh-radius);
    box-shadow:
        0 0 0 1px rgba(26,54,93,0.07),
        0 8px 32px rgba(26,54,93,0.13);
    width: 100%;
    max-width: 620px;
    overflow: hidden;
    box-sizing: border-box;
}

.eh-root * { box-sizing: border-box; }

/* ---- Header ---- */
.eh-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--eh-border);
    background: var(--eh-bg);
}

.eh-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--eh-navy);
    margin: 0 0 2px;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.eh-subtitle {
    font-size: 0.8rem;
    color: var(--eh-muted);
    margin: 0;
}

/* ---- Product Tabs ---- */
.eh-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--eh-border);
    flex-wrap: wrap;
    background: var(--eh-bg);
}

.eh-tab {
    padding: 6px 18px;
    border-radius: 50px;
    border: 1.5px solid var(--eh-border);
    background: transparent;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--eh-muted);
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    line-height: 1.4;
}

.eh-tab:hover {
    border-color: var(--eh-primary);
    color: var(--eh-primary);
}

.eh-tab.active {
    background: var(--eh-primary);
    border-color: var(--eh-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(246,109,33,0.32);
}

/* ---- Body: Two-panel grid ---- */
.eh-body {
    display: grid;
    grid-template-columns: 1fr 210px;
    min-height: 400px;
}

/* ---- Left Panel ---- */
.eh-panel-left {
    padding: 14px 18px;
    border-right: 1px solid var(--eh-border);
    overflow-y: auto;
    max-height: 340px; /* Daha kompakt görünmesi için yükseklik kısıldı */
}

.eh-panel-left::-webkit-scrollbar { width: 4px; }
.eh-panel-left::-webkit-scrollbar-track { background: transparent; }
.eh-panel-left::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ---- Right Panel ---- */
.eh-panel-right {
    background: var(--eh-bg-right);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- Sections ---- */
.eh-section { margin-bottom: 12px; }

.eh-sec-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    color: var(--eh-muted);
    margin-bottom: 6px;
}

/* ---- Dimensions ---- */
.eh-dim-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.eh-dim-field { display: flex; flex-direction: column; gap: 5px; }

.eh-dim-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--eh-text);
}

.eh-dim-wrap { position: relative; }

.eh-dim-input {
    width: 100%;
    padding: 7px 28px 7px 10px;
    border: 1.5px solid var(--eh-border);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--eh-text);
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    -moz-appearance: textfield;
    font-weight: 600;
}

.eh-dim-input::-webkit-inner-spin-button,
.eh-dim-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.eh-dim-input::placeholder { color: #cbd5e1; font-weight: 400; }

.eh-dim-input:focus {
    outline: none;
    border-color: var(--eh-primary);
    box-shadow: 0 0 0 3px rgba(246,109,33,0.11);
}

.eh-custom-qty-active {
    border-color: var(--eh-primary) !important;
    background-color: rgba(246,109,33,0.03) !important;
    box-shadow: 0 0 0 3px rgba(246,109,33,0.1);
}

.eh-dim-unit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: var(--eh-muted);
    pointer-events: none;
    font-weight: 500;
}

/* ---- Option Chips ---- */
.eh-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.eh-chip {
    padding: 4px 10px;
    border-radius: 50px;
    border: 1.5px solid var(--eh-border);
    background: #fff;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--eh-text);
    cursor: pointer;
    transition: all 0.16s ease;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}

.eh-chip:hover {
    border-color: var(--eh-primary);
    color: var(--eh-primary);
    background: rgba(246,109,33,0.04);
}

.eh-chip.active {
    background: var(--eh-navy);
    border-color: var(--eh-navy);
    color: #fff;
    box-shadow: 0 1px 6px rgba(26,54,93,0.2);
}

/* ---- Quantity Preset Buttons ---- */
.eh-qty-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.eh-qty-btn {
    padding: 6px 4px;
    border-radius: 8px;
    border: 1.5px solid var(--eh-border);
    background: #fff;
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--eh-text);
    cursor: pointer;
    transition: all 0.16s ease;
    font-family: inherit;
    text-align: center;
    line-height: 1.2;
}

.eh-qty-btn:hover {
    border-color: var(--eh-primary);
    color: var(--eh-primary);
}

.eh-qty-btn.active {
    background: var(--eh-primary);
    border-color: var(--eh-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(246,109,33,0.28);
}

/* ---- Divider ---- */
.eh-divider {
    height: 1px;
    background: var(--eh-border);
    margin: 12px 0;
    flex-shrink: 0;
}

/* ---- Price Area ---- */
.eh-price-area {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Breakdown rows */
.eh-brow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.eh-blabel {
    font-size: 0.75rem;
    color: var(--eh-muted);
    font-weight: 500;
}

.eh-bval {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--eh-text);
}

.eh-bval.muted { color: #c5d0dc; font-weight: 400; }

.eh-bval.discount {
    background: rgba(22,163,74,0.1);
    color: var(--eh-success);
    padding: 2px 7px;
    border-radius: 50px;
    font-size: 0.71rem;
    font-weight: 700;
}

/* Total block */
.eh-total-wrap { margin-bottom: 12px; }

.eh-total-lbl {
    font-size: 0.72rem;
    color: var(--eh-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.eh-kdv-badge {
    font-size: 0.64rem;
    background: #e2e8f0;
    color: var(--eh-muted);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.eh-total-price {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--eh-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
    transition: all 0.3s ease;
}

.eh-total-price.muted {
    font-size: 0.9rem;
    color: #c5d0dc;
    font-weight: 500;
    letter-spacing: 0;
}

.eh-total-price.loading {
    font-size: 0.82rem;
    color: var(--eh-muted);
    font-weight: 500;
    letter-spacing: 0;
    animation: eh-pulse 1.2s ease-in-out infinite;
}

@keyframes eh-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.eh-delivery {
    font-size: 0.7rem;
    color: var(--eh-success);
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ---- CTA Buttons ---- */
.eh-ctas {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
    margin-bottom: 8px;
}

.eh-btn-primary {
    width: 100%;
    padding: 11px 10px;
    border-radius: 10px;
    border: none;
    background: var(--eh-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.2;
}

.eh-btn-primary:not(.disabled):hover {
    background: var(--eh-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(246,109,33,0.38);
}

.eh-btn-outline {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1.5px solid var(--eh-border);
    background: #fff;
    color: var(--eh-text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.2;
}

.eh-btn-outline:not(.disabled):hover {
    border-color: #25d366;
    color: #25d366;
    background: rgba(37,211,102,0.04);
}

.eh-btn-primary.disabled,
.eh-btn-outline.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Messages ---- */
.eh-error {
    font-size: 0.76rem;
    color: #dc2626;
    padding: 8px;
    background: rgba(220,38,38,0.06);
    border-radius: 8px;
    margin-bottom: 8px;
}

/* ---- Secure badge ---- */
.eh-secure {
    font-size: 0.67rem;
    color: #c5d0dc;
    text-align: center;
    margin: 2px 0 0;
}

/* ---- Modal ---- */
.eh-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.eh-modal-box {
    position: relative;
    max-height: 95vh;
    overflow: hidden;
    border-radius: var(--eh-radius);
    width: 100%;
    max-width: 620px; /* İçteki beyaz kutuyla (eh-root) birebir aynı genişlik */
    
    /* UX Uzmanı Dokunuşu: Havada asılı derin gölge */
    box-shadow: 15px 20px 40px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.15);
    
    /* UX Uzmanı Dokunuşu: Micro-Bevel (Zarif 3D Çerçeve Kalınlığı) */
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.eh-modal-close {
    position: absolute;
    top: 16px;
    right: 18px; /* Sağ kenardan biraz daha içeride dursun */
    background: rgba(0,0,0,0.08);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 10;
    transition: background 0.15s;
}

.eh-modal-close:hover { background: rgba(0,0,0,0.15); }

/* ---- Responsive ---- */
@media (max-width: 580px) {
    .eh-body {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .eh-panel-left {
        border-right: none;
        border-bottom: 1px solid var(--eh-border);
        max-height: none;
    }
    .eh-panel-right {
        background: var(--eh-bg);
    }
    .eh-qty-grid { grid-template-columns: repeat(3, 1fr); }
    .eh-total-price { font-size: 1.9rem; }
}
