/* Mobil uyumluluk — ITEMRESMİ */

@media (max-width: 768px) {
    :root {
        --header-h: 56px;
    }

    html,
    body {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100vw;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin-inline: auto;
        padding-left: 14px;
        padding-right: 14px;
        box-sizing: border-box;
    }

    .header-inner {
        max-width: 100%;
        overflow: hidden;
    }

    .listing-detail-page,
    .listing-detail-grid,
    .listing-detail-modern,
    .listing-detail-card,
    .listing-detail-desc {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .listing-detail-actions,
    .listing-detail-actions-modern {
        width: 100%;
        max-width: 100%;
    }

    .listing-detail-actions .btn-primary,
    .listing-detail-actions .btn-secondary,
    .listing-detail-actions .btn-ghost,
    .listing-buy-form,
    .listing-contact-form {
        width: 100%;
        max-width: 100%;
    }

    .listing-buy-form button,
    .listing-contact-form button {
        width: 100%;
        box-sizing: border-box;
    }

    .admin-card,
    .panel-layout-content,
    .site-main {
        max-width: 100%;
        overflow-x: hidden;
    }

    table.admin-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    body.has-mobile-nav {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    /* Flash */
    .epin-toast-stack {
        top: auto;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        right: 12px;
        left: 12px;
        max-width: none;
    }
    .flash {
        left: 12px;
        right: 12px;
        top: 12px;
        font-size: 13px;
    }

    /* —— Header —— */
    .site-header {
        border-bottom-color: var(--border);
    }

    .header-inner {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 0 8px;
        min-height: auto;
    }

    .header-nav,
    .header-mid,
    .header-balance-pill,
    .btn-header-outline,
    .link-login span,
    .header-admin-link,
    .btn-header-accent .btn-label,
    .btn-register {
        /* handled per-element below */
    }

    .header-nav { display: none; }

    .logo-mark {
        width: 34px;
        height: 34px;
        font-size: 10px;
    }

    .logo-text strong { font-size: 14px; }

    .header-auth {
        gap: 6px;
        margin-left: auto;
    }

    .btn-header-accent {
        padding: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
        border-radius: var(--radius);
    }

    .btn-header-accent .btn-label { display: none; }

    .btn-header-outline,
    .header-balance-pill,
    .header-admin-link {
        display: none !important;
    }

    .link-login {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        flex-shrink: 0;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text);
        font-size: 0;
        gap: 0;
    }

    .link-login .ico {
        font-size: 16px;
        margin: 0;
    }

    .link-login-text {
        display: none;
    }

    .btn-register {
        padding: 8px 12px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .header-notif,
    .header-cart,
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }

    .header-profile-trigger {
        padding: 3px;
        width: 40px;
        height: 40px;
    }

    .header-profile-trigger img {
        width: 32px;
        height: 32px;
    }

    .header-profile-trigger span,
    .header-profile-chevron {
        display: none;
    }

    /* Mobil arama satırı */
    .header-mobile-bar {
        display: flex;
        width: 100%;
        order: 10;
        gap: 8px;
        padding-bottom: 2px;
    }

    .header-mobile-bar .search-form {
        flex: 1;
    }

    .header-mobile-bar .search-form input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .header-mobile-bar .btn-categories-icon {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text);
        font-family: inherit;
        cursor: pointer;
    }

    .btn-categories-icon[aria-expanded="true"] {
        border-color: var(--accent);
        color: var(--accent);
        background: rgba(0, 212, 170, 0.1);
    }

    .mobile-cat-sheet {
        display: none;
        width: 100%;
        order: 11;
    }

    .mobile-cat-sheet.open {
        display: block;
    }

    .mobile-cat-sheet-inner {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 10px 12px 12px;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 4px;
        max-height: 50vh;
        overflow-y: auto;
    }

    .mobile-cat-sheet-title {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-muted);
        margin-bottom: 4px;
    }

    .mobile-cat-sheet a {
        padding: 10px 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        color: var(--text-muted);
    }

    .mobile-cat-sheet a:hover,
    .mobile-cat-sheet a:active {
        background: var(--bg-input);
        color: var(--text);
    }

    .mobile-cat-sheet-all {
        color: var(--gold) !important;
        font-weight: 700 !important;
        margin-top: 4px;
    }

    /* Mobil menü */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text);
        cursor: pointer;
        font-family: inherit;
        flex-shrink: 0;
        position: relative;
        z-index: 110;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-drawer {
        display: block !important;
        position: fixed;
        inset: 0;
        z-index: 350;
        pointer-events: none;
        visibility: hidden;
    }

    .mobile-drawer.open {
        pointer-events: auto;
        visibility: visible;
    }

    .site-header {
        z-index: 200;
    }

    .mobile-menu-btn,
    .btn-categories-icon {
        position: relative;
        z-index: 201;
        touch-action: manipulation;
    }

    .mobile-drawer-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        transition: opacity 0.25s;
    }

    .mobile-drawer.open .mobile-drawer-backdrop {
        opacity: 1;
    }

    .mobile-drawer-panel {
        position: absolute;
        top: 0;
        right: 0;
        width: min(300px, 88vw);
        height: 100%;
        background: var(--bg-card);
        border-left: 1px solid var(--border);
        transform: translateX(100%);
        transition: transform 0.28s ease;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        padding-bottom: env(safe-area-inset-bottom, 16px);
    }

    .mobile-drawer.open .mobile-drawer-panel {
        transform: translateX(0);
    }

    .mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px;
        border-bottom: 1px solid var(--border);
    }

    .mobile-drawer-head strong {
        font-size: 15px;
    }

    .mobile-drawer-close {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--text);
        cursor: pointer;
        font-family: inherit;
    }

    .mobile-drawer-nav {
        padding: 12px;
    }

    .mobile-drawer-nav a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 14px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 4px;
    }

    .mobile-drawer-nav a .ico {
        width: 20px;
        font-size: 18px;
        color: var(--accent);
    }

    .mobile-drawer-nav a:hover,
    .mobile-drawer-nav a.active {
        background: rgba(251, 146, 60, 0.1);
        color: #ffe8d4;
    }

    .mobile-drawer-section {
        padding: 8px 18px 4px;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .mobile-drawer-cats {
        padding: 0 12px 16px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-drawer-cats a {
        padding: 8px 12px;
        background: var(--bg-input);
        border: 1px solid var(--border);
        border-radius: 999px;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-muted);
    }

    .mobile-drawer-foot {
        margin-top: auto;
        padding: 16px;
        border-top: 1px solid var(--border);
    }

    .mobile-drawer-foot .btn-register,
    .mobile-drawer-foot .profile-logout-link {
        display: flex !important;
        width: 100%;
        justify-content: center;
        padding: 14px;
        border-radius: var(--radius);
        font-weight: 700;
        font-size: 14px;
    }

    .mobile-drawer-foot .profile-logout-link {
        background: rgba(239, 68, 68, 0.12);
        border: 1px solid rgba(239, 68, 68, 0.3);
        color: #fca5a5;
    }

    /* —— İlan grid: 2 sütun —— */
    .listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
        width: 100%;
        max-width: 100%;
    }

    .listing-card {
        min-width: 0;
        max-width: 100%;
    }

    .listing-card > a {
        min-width: 0;
    }

    .listing-card-title {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    section.container,
    .section-box {
        max-width: 100%;
        margin-inline: auto;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .listing-commission-box {
        padding: 12px;
    }

    .listing-commission-row {
        flex-wrap: wrap;
        font-size: 12px;
    }

    .listing-commission-row dd {
        white-space: normal;
        text-align: left;
        width: 100%;
    }

    .listing-my-table-wrap {
        display: none !important;
    }

    .listing-my-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .product-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        justify-content: stretch;
    }

    .product-grid .product-card {
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .deals-section .section-box,
    .deals-section .product-grid {
        width: 100%;
    }

    .listing-card-body {
        padding: 10px;
    }

    .listing-card-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .listing-card-price {
        font-size: 12px;
        margin-top: 4px;
    }

    .listing-seller {
        margin-bottom: 8px;
        padding: 6px 8px;
        gap: 8px;
    }

    .listing-seller-avatar {
        width: 30px;
        height: 30px;
    }

    .listing-seller-name {
        font-size: 12px;
    }

    .listing-seller-label {
        font-size: 9px;
    }

    .logo-img {
        height: 34px;
        max-width: 130px;
    }

    .badge-featured,
    .badge-vitrin {
        top: 6px;
        left: 6px;
        padding: 3px 6px;
        font-size: 8px;
    }

    .product-card-info {
        padding: 10px;
    }

    .product-card-info h3 {
        font-size: 11px;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .product-card-visual .overlay-title {
        font-size: 0.85rem;
        left: 10px;
        right: 10px;
        bottom: 8px;
    }

    /* Bölümler */
    .section-box {
        padding: 14px 12px 16px;
        margin: 12px 0;
        border-radius: var(--radius-lg);
    }

    .section-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .listing-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        margin: 0 -4px;
        scrollbar-width: none;
    }

    .listing-tabs::-webkit-scrollbar { display: none; }

    .listing-tab {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 12px;
    }

    .link-see-all {
        align-self: flex-end;
        font-size: 12px;
    }

    .category-pills {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        scrollbar-width: none;
    }

    .category-pills::-webkit-scrollbar { display: none; }

    .category-pill {
        flex-shrink: 0;
        font-size: 11px;
        padding: 7px 12px;
    }

    .deals-header {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }

    .deals-title {
        grid-column: 1;
        justify-content: center;
    }

    .deals-header .link-see-all {
        grid-column: 1;
        justify-self: center;
    }

    .deals-title {
        font-size: 1rem;
    }

    /* Hero */
    .page-header {
        padding: 16px 0 8px;
        text-align: center;
    }

    .page-header h1 {
        font-size: 1.25rem;
        text-align: center;
    }

    .hero-section {
        padding: 12px 0 4px;
    }

    .hero-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 14px;
        scrollbar-width: none;
    }

    .hero-tabs::-webkit-scrollbar { display: none; }

    .hero-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .hero-banner {
        aspect-ratio: 16 / 9;
        max-height: 220px;
        border-radius: var(--radius-lg);
    }

    .hero-banner img {
        width: 100%;
        height: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .hero-banner-placeholder {
        min-height: 0;
        font-size: 0.85rem;
    }

    .cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
        margin: 16px 0;
    }

    .cta-banner h2 {
        font-size: 1.1rem;
    }

    .cta-banner p {
        font-size: 13px;
    }

    /* Footer */
    .site-footer {
        margin-top: 24px;
    }

    .footer-trust {
        padding: 24px 0;
    }

    .etbis-badge {
        flex-direction: column;
        text-align: center;
        padding: 16px 20px;
        gap: 10px;
        max-width: 100%;
    }

    .footer-top-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }

    .footer-social-row {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .footer-pill {
        width: 100%;
        justify-content: center;
        max-width: 280px;
    }

    .footer-quick {
        padding: 12px 0;
    }

    .footer-quick-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .quick-card {
        flex-direction: column;
        text-align: center;
        padding: 14px 10px;
        font-size: 11px;
        gap: 8px;
    }

    .qc-icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .footer-links {
        padding: 20px 0;
    }

    .footer-cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 16px;
    }

    .footer-col h4 {
        margin-bottom: 10px;
    }

    .footer-col a {
        font-size: 12px;
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        font-size: 11px;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    /* live-support widget: live-support.css */

    /* Alt mobil menü */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 90;
        background: rgba(12, 16, 24, 0.96);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: stretch;
    }

    .mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px;
        font-size: 10px;
        font-weight: 600;
        color: var(--text-muted);
        max-width: 72px;
        border-radius: 8px;
    }

    .mobile-bottom-nav a .ico {
        font-size: 18px;
    }

    .mobile-bottom-nav a.active,
    .mobile-bottom-nav a:hover {
        color: var(--text-warm);
    }

    .mobile-bottom-nav a.active {
        background: rgba(251, 146, 60, 0.1);
    }

    /* LiveChat balonu — alt barın üstündə (açıq chat üçün ayrıca .epin-lc-open) */
    body.has-mobile-nav:not(.epin-lc-open) #chat-widget-container {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
        z-index: 200 !important;
    }

    body.has-mobile-nav.epin-lc-open #chat-widget-container {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100dvh !important;
        z-index: 9999 !important;
    }

    body.has-mobile-nav .live-support {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
        z-index: 200;
    }

    .chat-fab {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        right: 12px !important;
        z-index: 200;
    }

    /* Auth */
    .auth-page {
        padding: 24px 16px 80px;
    }

    .auth-box {
        padding: 28px 20px;
    }

    /* Panel */
    .panel-page {
        padding: 16px 0 80px;
    }

    .panel-page-head h1 {
        font-size: 1.2rem;
    }

    .panel-page-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .panel-page-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px;
    }

    .panel-page-nav a {
        padding: 10px 8px;
        font-size: 11px;
        text-align: center;
        flex-direction: column;
        gap: 6px;
        margin: 0;
    }

    .panel-page-nav a .ico {
        margin: 0 auto;
    }

    .panel-stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .panel-stat {
        padding: 14px;
    }

    .panel-stat strong {
        font-size: 1.2rem;
    }

    .cart-row,
    .order-row {
        flex-wrap: wrap;
        padding: 12px;
        gap: 10px;
    }

    .cart-row img {
        width: 52px;
        height: 52px;
    }

    .admin-table {
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
    }

    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px;
    }

    .admin-nav-section {
        width: 100%;
    }

    .admin-nav a {
        padding: 8px 10px;
        font-size: 12px;
    }

    .admin-content {
        padding: 16px;
    }

    .admin-topbar {
        padding: 12px 16px;
    }

    .admin-topbar h1 {
        font-size: 1.1rem;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .admin-grid-2 {
        grid-template-columns: 1fr;
    }

    .admin-table-wrap {
        margin: 0 -4px;
    }

    body.admin-body {
        padding-bottom: 0;
    }

    body.admin-body.has-mobile-nav {
        padding-bottom: 0;
    }

    /* Profil modal */
    .profile-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin-top: auto;
        align-self: flex-end;
    }

    .profile-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .profile-quick-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .profile-quick-item {
        min-height: 72px;
        padding: 12px 6px;
        font-size: 10px;
    }

    .profile-quick-item .ico {
        font-size: 18px;
    }

    .listing-detail-page {
        padding: 16px 0 80px;
    }

    .listing-detail-grid {
        gap: 20px;
    }

    .listing-detail-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .listing-detail-actions .btn-primary,
    .listing-detail-actions .btn-secondary,
    .listing-detail-actions .btn-ghost {
        width: 100%;
        text-align: center;
    }
}

/* Çok küçük ekran — yine 2 sütun, daha sıkı */
@media (max-width: 380px) {
    .listing-grid,
    .product-grid {
        gap: 8px;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin-inline: auto;
        padding-left: 14px;
        padding-right: 14px;
        box-sizing: border-box;
    }
}

/* Masaüstünde gizle */
@media (min-width: 769px) {
    .header-mobile-bar,
    .mobile-menu-btn,
    .mobile-bottom-nav,
    .mobile-cat-sheet,
    .btn-categories-icon {
        display: none !important;
    }

    .mobile-drawer {
        display: none !important;
    }

    .header-mid {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .header-mobile-bar {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-mid {
        display: none !important;
    }
}
