﻿/* ==========================================================================
   mobil.css — Kooptangelsin telefon / tablet uyumu
   Site.master'da responsive.css'ten SONRA yüklenir; yalnızca küçük ekranları
   ve dokunmatik cihazları etkiler, masaüstü görünümünü değiştirmez.
   ========================================================================== */

html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
iframe { max-width: 100%; }

/* --------------------------------------------------------------------------
   Dokunmatik cihazlar: ürün kartlarındaki "Favori" ve "Sepete ekle"
   butonları normalde fareyle üzerine gelince açılıyor. Telefonda/tablette
   üzerine gelme olmadığı için her zaman görünür yapıyoruz.
   -------------------------------------------------------------------------- */
@media (hover: none), (max-width: 991px) {
    .product-block .icon-box {
        top: 12px !important;
        right: 12px !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    .product-block .ui-btn {
        width: 44px;
        height: 44px;
        line-height: 44px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    }
}

/* --------------------------------------------------------------------------
   Tablet ve altı (< 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {

    /* Ürünler sayfası: ürünler önce, kategori/popüler ürünler kenar çubuğu sonra */
    .featured-products .row.clearfix > .content-side { order: -1; }
    .featured-products .row.clearfix > .content-side.mt-md-60 { margin-top: 0 !important; }
    .featured-products .shop-sidebar { margin-top: 40px; }

    /* Filtre sekmeleri yatay kaydırılabilir */
    .mixitup-gallery .filters .filter-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        gap: 6px;
        padding-bottom: 6px;
    }
    .mixitup-gallery .filters .filter-tabs li { flex: 0 0 auto; white-space: nowrap; }

    /* ---------------- Sepet / Sipariş / Sipariş detay tabloları -------------
       Tablolar küçük ekranda yana taşıyordu (Adet, Toplam ve "Sipariş Ver"
       ekran dışında kalıyordu). Her ürün satırı bir karta dönüşüyor. */
    .table-responsive { overflow-x: visible; }

    table.mobil-kart,
    table.mobil-kart > tbody,
    table.mobil-kart > tbody > tr,
    table.mobil-kart > tbody > tr > td {
        display: block;
        width: 100%;
    }
    table.mobil-kart { border: 0 !important; background: transparent; }
    table.mobil-kart > thead > tr:not(.baslik-satir) { display: none; }
    table.mobil-kart > thead,
    table.mobil-kart > thead > tr.baslik-satir,
    table.mobil-kart > thead > tr.baslik-satir > td { display: block; width: 100%; }

    /* ürün kartı */
    table.mobil-kart > tbody > tr.cart_item {
        position: relative;
        display: grid;
        grid-template-columns: 76px 1fr;
        column-gap: 14px;
        align-items: center;
        margin-bottom: 14px;
        padding: 14px;
        background: #fff !important;
        border: 1px solid #e3e3e3;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    }
    table.mobil-kart > tbody > tr.cart_item > td {
        border: 0 !important;
        padding: 6px 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        grid-column: 2;
    }
    table.mobil-kart > tbody > tr.cart_item > td.product-thumbnail {
        grid-column: 1;
        grid-row: 1 / span 5;
        align-self: start;
        min-width: 0;
        padding: 0 !important;
    }
    table.mobil-kart > tbody > tr.cart_item > td.product-thumbnail img {
        width: 76px !important;
        height: 76px !important;
        object-fit: cover;
        border-radius: 8px;
    }
    table.mobil-kart > tbody > tr.cart_item > td.product-name {
        font-weight: 600;
        line-height: 1.35;
        padding-right: 34px !important;
    }
    table.mobil-kart > tbody > tr.cart_item > td.product-name .variation { margin: 2px 0 0; padding: 0; }

    /* etiket : değer satırları */
    table.mobil-kart > tbody > tr.cart_item > td.product-price,
    table.mobil-kart > tbody > tr.cart_item > td.product-quantity,
    table.mobil-kart > tbody > tr.cart_item > td.product-subtotal {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        border-top: 1px dashed #ececec !important;
    }
    table.mobil-kart > tbody > tr.cart_item > td[data-label]::before {
        content: attr(data-label);
        margin-right: auto;
        font-size: 13px;
        font-weight: 500;
        color: #8a8f8d;
    }
    table.mobil-kart > tbody > tr.cart_item > td.product-name::before { display: none; }
    table.mobil-kart > tbody > tr.cart_item > td.product-subtotal { font-weight: 700; color: var(--headings-color); }
    table.mobil-kart .product-details__quantity { margin: 0; }

    /* sil (x) butonu sağ üst köşede */
    table.mobil-kart > tbody > tr.cart_item > td.product-remove {
        position: absolute;
        top: 10px;
        right: 10px;
        width: auto;
        padding: 0 !important;
        z-index: 2;
    }
    table.mobil-kart > tbody > tr.cart_item > td.product-remove a {
        width: 30px; height: 30px; line-height: 30px; border-radius: 30px;
    }

    /* özet (toplam) satırı ve geniş satırlar: kart grid'i kullanılmaz */
    table.mobil-kart > tbody > tr.cart_item.ozet-satir,
    table.mobil-kart > tbody > tr.cart_item.genis-satir,
    table.mobil-kart > tbody > tr.cart_item.baslik-satir {
        display: block;
    }
    table.mobil-kart > tbody > tr.cart_item.ozet-satir > td,
    table.mobil-kart > tbody > tr.cart_item.genis-satir > td,
    table.mobil-kart > tbody > tr.cart_item.baslik-satir > td {
        text-align: left !important;
    }
    table.mobil-kart td.bos-hucre { display: none !important; }
    table.mobil-kart > tbody > tr.ozet-satir h4 { font-size: 18px; margin: 0 0 8px; }
    table.mobil-kart table.cart-total { width: 100%; margin-bottom: 14px; }
    table.mobil-kart table.cart-total td { padding: 12px 14px !important; }
    table.mobil-kart table.cart-total td:last-child { font-weight: 700; white-space: nowrap; text-align: right; }

    /* bölüm başlıkları (SİPARİŞİM, ÜYELİK BİLGİLERİ, ÖDEME YÖNTEMİ) */
    table.mobil-kart tr.baslik-satir {
        margin: 22px 0 10px;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    table.mobil-kart tr.baslik-satir > td {
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        font-weight: 700;
        letter-spacing: .3px;
        color: var(--headings-color);
    }

    /* üyelik bilgileri tablosu: etiket sütunu dar */
    table.mobil-kart tr.genis-satir table.cart-total td:first-child { width: 38%; color: #8a8f8d; }
    table.mobil-kart tr.genis-satir table.cart-total td:last-child { white-space: normal; text-align: left; font-weight: 500; }

    /* ödeme yöntemi seçimi: css/odeme.css */

    /* "Sipariş Ver" / "Siparişi Tamamla" tam genişlik */
    table.mobil-kart tr.ozet-satir .theme-btn,
    table.mobil-kart tr.buton-satir .theme-btn,
    .odeme-havale .theme-btn {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* Hesabım: menü ve içerik arası boşluk */
    .services-details .service-sidebar { margin-bottom: 24px; }
}

/* --------------------------------------------------------------------------
   Telefon (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {

    /* Logo daha küçük, üst bar daha az yer kaplasın */
    .main-header .header-upper .logo img,
    .mobile-menu .nav-logo img {
        width: 84px !important;
        height: 84px !important;
    }
    .main-header .header-upper .logo { padding: 8px 0; }
    .main-header .outer-box .ui-btn,
    .main-header .mobile-nav-toggler { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }

    /* Sayfa başlığı */
    .page-title { padding-top: 28px; padding-bottom: 28px; }
    .page-title .title { font-size: 28px; line-height: 1.2; }

    /* Formlar: kenara yapışmasın; iOS'ta odaklanınca zoom yapmasın (16px) */
    .row > input.form-control,
    .row > textarea.form-control,
    .row > select.form-control {
        margin-left: calc(var(--bs-gutter-x, 1.5rem) * .5);
        margin-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
        width: calc(100% - var(--bs-gutter-x, 1.5rem));
        margin-bottom: 10px;
    }
    input.form-control, select.form-control, textarea.form-control,
    .sidebar-search input, .search-inner input { font-size: 16px !important; }

    /* Butonlar alt alta, tam genişlik */
    .contact-details .mb-12 .theme-btn,
    .services-details .mb-12 .theme-btn,
    .error-page__inner .theme-btn {
        display: block;
        width: 100%;
        margin: 0 0 10px 0 !important;
        text-align: center;
    }

    /* Ürün detay: butonlar ve adet */
    .product-details__buttons { display: flex; flex-direction: column; gap: 10px; }
    .product-details__buttons .theme-btn { display: block; width: 100%; text-align: center; }
    .product-details__buttons-1, .product-details__buttons-2 { margin: 0 !important; width: 100%; }
    .product-details__title { font-size: 24px; line-height: 1.3; }
    .product-details .bxslider .thumb-box li { width: 64px; height: 64px; }

    /* Ürün listesi: telefonda 2 sütun */
    .featured-products .filter-list > .product-block,
    .related-product .filter-list > .product-block {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 6px;
        padding-right: 6px;
    }
    .featured-products .filter-list,
    .related-product .filter-list { margin-left: -6px; margin-right: -6px; }
    .product-block .inner-box { padding: 10px; margin-bottom: 12px; min-height: 0 !important; height: calc(100% - 12px); }
    .product-block .image { height: auto; }
    .product-block .image img { max-height: 150px; object-fit: contain; }
    .product-block .content { padding-top: 10px; }
    .product-block .content h4 { font-size: 14px; line-height: 1.35; margin-bottom: 4px; word-break: break-word; }
    .product-block .content .price { font-size: 15px; }
    .product-block .icon-box { top: 6px !important; right: 6px !important; }
    .product-block .ui-btn { width: 38px; height: 38px; line-height: 38px; margin-bottom: 6px; }

    /* Modal pencereler ekrana sığsın */
    .modal-dialog.largeModal { width: auto !important; max-width: calc(100% - 24px); margin: 12px auto; }

    /* Hesabım: siparişlerim listesi */
    .services-details .post-widget .post .price[style*="float"] { float: none !important; display: block; margin: 4px 0; }
    .services-details .post-widget .post img[width="80"] { width: 60px; height: 60px; object-fit: cover; }

    /* Ödeme sayfası */
    #paytriframe { min-height: 600px; }
}

/* Çok dar telefonlar (< 360px): ürünler tek sütun */
@media (max-width: 359px) {
    .featured-products .filter-list > .product-block,
    .related-product .filter-list > .product-block { flex: 0 0 100%; max-width: 100%; }
}
