/* ==========================================================================
   Pide Deryası - Besin Değeri / Alerjen Bileşenleri
   Mobil öncelikli. Renk paleti site temasıyla uyumlu.
   ========================================================================== */

:root {
    --pd-green: #033f38;
    --pd-green-soft: #0a5a50;
    --pd-accent: #e63946;
    --pd-amber: #b8860b;
    --pd-amber-bg: #fff8e6;
    --pd-amber-br: #f0dfae;
    --pd-ok: #1b7f4f;
    --pd-ok-bg: #eaf7f0;
    --pd-ok-br: #bfe6d1;
    --pd-ink: #1c2b28;
    --pd-muted: #6b7b77;
    --pd-line: #e8edec;
    --pd-card: #ffffff;
}

/* ---------- Ürün detayı: besin bloğu ---------- */
.pd-nutrition {
    background: var(--pd-card);
    border: 1px solid var(--pd-line);
    border-radius: 16px;
    padding: 16px 14px;
    margin-top: 12px;
    box-shadow: 0 2px 10px rgba(3, 63, 56, .05);
}

.pd-nutrition + .pd-nutrition { margin-top: 12px; }

.pd-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--pd-green);
    margin: 0 0 12px;
}

.pd-sec-title i { font-size: 14px; opacity: .8; }

.pd-sec-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--pd-line);
}

/* ---------- Enerji kutuları ---------- */
.pd-energy {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.pd-energy.pd-energy-2 { grid-template-columns: repeat(2, 1fr); }
.pd-energy.pd-energy-1 { grid-template-columns: 1fr; }

.pd-energy-box {
    background: #f6f9f8;
    border: 1px solid var(--pd-line);
    border-radius: 12px;
    padding: 12px 6px;
    text-align: center;
    min-width: 0;
}

.pd-energy-box.is-main {
    background: linear-gradient(160deg, #04463e 0%, #033f38 100%);
    border-color: #033f38;
}

.pd-energy-val {
    display: block;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 800;
    color: var(--pd-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-energy-box.is-main .pd-energy-val { color: #fff; }

.pd-energy-unit {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--pd-muted);
    margin-top: 3px;
    letter-spacing: .02em;
}

.pd-energy-box.is-main .pd-energy-unit { color: rgba(255, 255, 255, .78); }

@media (max-width: 360px) {
    .pd-energy-val { font-size: 17px; }
    .pd-energy-unit { font-size: 10px; }
}

/* ---------- Alerjen rozetleri ---------- */
.pd-allergens {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid var(--pd-amber-br);
    background: var(--pd-amber-bg);
    color: #8a6100;
}

.pd-chip .pd-chip-ico { font-size: 14px; line-height: 1; }

.pd-chip.is-clear {
    border-color: var(--pd-ok-br);
    background: var(--pd-ok-bg);
    color: var(--pd-ok);
}

/* ---------- İçindekiler ---------- */
.pd-ingredients {
    font-size: 14px;
    line-height: 1.65;
    color: #3b4a47;
    margin: 0;
    word-break: break-word;
}

/* ---------- Yasal not ---------- */
.pd-legal {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f4f7f6;
    border: 1px solid var(--pd-line);
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--pd-muted);
}

.pd-legal i { margin-top: 1px; opacity: .7; }

/* ---------- Liste kartlarındaki kcal rozeti ---------- */
.pd-kcal-badge {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef4f2;
    border: 1px solid #dbe7e3;
    color: var(--pd-green);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    max-width: 100%;
    white-space: normal;
}

.pd-kcal-badge i { font-size: 10px; opacity: .75; }

.pd-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 6px 0 2px;
    max-width: 100%;
    min-width: 0;
}

.pd-allergen-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--pd-amber-bg);
    border: 1px solid var(--pd-amber-br);
    color: #8a6100;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    max-width: 100%;
    white-space: normal;
}

/* Kategori kartlarındaki üst rozet (görsel üzerinde) */
.pd-kcal-float {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(3, 63, 56, .88);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    backdrop-filter: blur(3px);
    white-space: nowrap;
}

/* ---------- Ürün detayı başlık/fiyat düzeni ---------- */
.pd-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pd-detail-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--pd-ink);
    margin: 0;
    line-height: 1.3;
    flex: 1 1 160px;
    min-width: 0;
}

.pd-detail-price {
    font-size: 19px;
    font-weight: 800;
    color: var(--pd-accent);
    white-space: nowrap;
}

.pd-portion-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pd-muted);
}

/* Sabit "Sipariş Ver" butonunun içeriği kapatmasını önle */
.pd-safe-bottom { padding-bottom: 130px !important; }


/* ---------- Sabit "Sipariş Ver" butonu: içeriği daha az kapatsın ---------- */
.order-button {
    bottom: 82px !important;
    padding: 9px 15px !important;
    font-size: 14px !important;
    gap: 7px !important;
    animation: none !important;
    box-shadow: 0 4px 14px rgba(230, 57, 70, .35) !important;
}

.order-button img {
    width: 24px !important;
    height: 24px !important;
}

/* ==========================================================================
   MOBİL KULLANILABİLİRLİK DÜZELTMELERİ
   ========================================================================== */

/* --- Alt menü çubuğu: dar ekranlarda metinler taşıyordu --- */
.menubar-footer.footer-fixed > ul.inner {
    display: flex !important;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0 2px;
}

.menubar-footer.footer-fixed > ul.inner > li {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    list-style: none;
}

.menubar-footer.footer-fixed > ul.inner > li > a {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 6px 1px;
    font-size: 10.5px !important;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menubar-footer.footer-fixed > ul.inner > li > a > i {
    font-size: 17px;
    line-height: 1;
}

@media (max-width: 360px) {
    .menubar-footer.footer-fixed > ul.inner > li > a { font-size: 9.5px !important; }
    .menubar-footer.footer-fixed > ul.inner > li > a > i { font-size: 15px; }
}

/* --- Dar ekranda kcal rozetindeki porsiyon kısmını gizle (satır kaymasın) --- */
@media (max-width: 360px) {
    .pd-kcal-badge > span { display: none; }
}

/* --- Dokunma deneyimi --- */
html { -webkit-text-size-adjust: 100%; }

a, button, .btn-add, .btn-sidebar, .back-btn, .order-button, .tf-box-column, .box-collections {
    -webkit-tap-highlight-color: rgba(3, 63, 56, .12);
    touch-action: manipulation;
}

/* Karta dokunulduğunda görsel geri bildirim */
.tf-box-column:active,
.box-collections:active,
.tf-box-row:active {
    transform: scale(.985);
    transition: transform .08s ease;
}

/* Geri / menü düğmeleri için yeterli dokunma alanı (min 44px) */
.back-btn, .btn-sidebar {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* --- Sayfa taşmasını kesin olarak engelle --- */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; height: auto; }

/* --- Uzun ürün adları kartı bozmasın --- */
.tf-box-column .content-box h3,
.tf-box-column .content-box h1,
.tf-box-row .content-box h5,
.pd-detail-title {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* --- iPhone çentikli ekranlarda alt boşluk --- */
@supports (padding: max(0px)) {
    .menubar-footer.footer-fixed { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
    .order-button { bottom: max(82px, calc(82px + env(safe-area-inset-bottom))) !important; }
}

/* --- Sipariş butonu: dar ekranda içeriği daha az kapatsın --- */
@media (max-width: 400px) {
    .order-button {
        padding: 8px 13px !important;
        font-size: 13px !important;
        gap: 6px !important;
        opacity: .96;
    }
    .order-button img { width: 21px !important; height: 21px !important; }
}

/* Masaüstünde ortalanmış, telefon genişliğinde görünüm bozulmasın */
@media (min-width: 992px) {
    .order-button { right: calc(50% - 230px) !important; }
}
