/**
 * FiyatX Ara Bul - Mobil Öncelikli ve Responsive Düzenlemeler
 * 
 * 1440px, 768px, 390px ve 320px ekran genişlikleri için test edilmiş düzenlemeler.
 * @package YerelPazar
 */

/* -------------------------------------------------------------------------
 * Mobil Çekmece Menü (Mobile Drawer)
 * ------------------------------------------------------------------------- */
.yp-mobile-drawer {
	position: fixed;
	top: 0;
	left: -320px;
	width: 300px;
	height: 100vh;
	background-color: #ffffff;
	z-index: 1000;
	box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
	transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
}
.yp-mobile-drawer.is-open {
	left: 0;
}
.yp-mobile-drawer-header {
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--yp-border-light);
}
.yp-drawer-close {
	background: none;
	border: none;
	font-size: 26px;
	color: var(--yp-text-muted);
	cursor: pointer;
}
.yp-mobile-drawer-body {
	padding: 20px;
	overflow-y: auto;
}

/* -------------------------------------------------------------------------
 * Mobil Çekmece Giriş / Profil Kartı & Menüsü
 * ------------------------------------------------------------------------- */
.yp-mobile-auth-section {
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--yp-border-light);
}
.yp-mobile-user-card {
	display: flex;
	align-items: center;
	gap: 12px;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	margin-bottom: 12px;
}
.yp-mobile-user-avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--yp-primary, #2563eb), #1d4ed8);
	color: #ffffff;
	font-weight: 700;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
	flex-shrink: 0;
}
.yp-mobile-user-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.yp-mobile-user-name {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.yp-mobile-user-role {
	font-size: 12px;
	font-weight: 600;
	color: #10b981;
}
.yp-mobile-user-quick-links,
.yp-mobile-profile-links ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.yp-mobile-user-quick-links li a,
.yp-mobile-profile-links li a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #334155;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.yp-mobile-user-quick-links li a:hover,
.yp-mobile-profile-links li a:hover {
	background-color: #f1f5f9;
	color: var(--yp-primary, #2563eb);
}
.yp-mobile-guest-card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 14px;
	text-align: center;
}
.yp-mobile-guest-header strong {
	display: block;
	font-size: 15px;
	color: #0f172a;
	margin-bottom: 4px;
}
.yp-mobile-guest-header p {
	font-size: 12.5px;
	color: #64748b;
	margin: 0 0 12px 0;
	line-height: 1.4;
}

.yp-mobile-location-select {
	background-color: var(--yp-bg);
	padding: 12px;
	border-radius: 10px;
	margin-bottom: 20px;
}
.yp-drawer-label {
	font-size: 12px;
	font-weight: 700;
	color: var(--yp-text-muted);
	margin-bottom: 8px;
}
.yp-mobile-nav ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 0;
	margin: 0;
}
.yp-mobile-nav li {
	position: relative;
	width: 100%;
}
.yp-mobile-nav a {
	font-size: 15px;
	font-weight: 600;
	color: var(--yp-dark);
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid var(--yp-border-light);
	text-decoration: none;
}
.yp-mobile-nav a:hover {
	color: var(--yp-primary);
}
.yp-mobile-nav .menu-item-has-children > a {
	padding-right: 40px;
}
.yp-mobile-nav .yp-sub-menu-toggle {
	position: absolute;
	right: 0;
	top: 8px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	color: #475569;
	cursor: pointer;
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
	z-index: 2;
}
.yp-mobile-nav .menu-item-has-children.is-expanded > .yp-sub-menu-toggle {
	transform: rotate(180deg);
	background: var(--yp-primary);
	color: #ffffff;
	border-color: var(--yp-primary);
}
.yp-mobile-nav .sub-menu {
	display: none;
	padding-left: 14px;
	margin: 4px 0 10px 0;
	border-left: 2px solid #cbd5e1;
	list-style: none;
	flex-direction: column;
	gap: 2px;
}
.yp-mobile-nav .menu-item-has-children.is-expanded > .sub-menu {
	display: flex;
}
.yp-mobile-nav .sub-menu a {
	font-size: 13.5px;
	font-weight: 500;
	color: #475569;
	padding: 6px 0;
	border-bottom: none;
}
.yp-mobile-nav .sub-menu a:hover {
	color: var(--yp-primary);
}
.yp-mobile-nav .yp-mobile-highlight {
	color: var(--yp-primary);
	font-weight: 700;
}

/* -------------------------------------------------------------------------
 * Laptop & Masaüstü Çoklu Menü Taşma Koruması (1025px - 1366px)
 * ------------------------------------------------------------------------- */
@media (max-width: 1366px) {
	.yp-main-navigation .yp-nav-link {
		padding: 7px 9px !important;
		font-size: 13.5px !important;
		gap: 5px !important;
	}
	.yp-main-navigation .yp-nav-list {
		gap: 3px !important;
	}
}

@media (max-width: 1180px) {
	.yp-main-navigation .yp-nav-link {
		padding: 6px 7px !important;
		font-size: 12.5px !important;
		gap: 4px !important;
	}
	.yp-main-navigation .yp-nav-list {
		gap: 2px !important;
	}
	.yp-brand-title {
		font-size: 18px !important;
	}
	.yp-brand-tagline {
		display: none !important;
	}
}

/* -------------------------------------------------------------------------
 * Tablet & Orta Boyutlar (Max 1024px)
 * ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.yp-search-grid {
		grid-template-columns: 1fr 1fr 1fr;
	}
	.yp-field-keyword {
		grid-column: span 2;
	}
	.yp-search-action {
		grid-column: span 1;
	}
	.yp-btn-search {
		width: 100%;
	}

	.yp-category-grid {
		grid-template-columns: repeat(3, 1fr);
	}

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

	.yp-products-grid {
		grid-template-columns: repeat(3, 1fr);
	}

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

	.yp-store-layout-grid {
		grid-template-columns: 1fr 300px;
		gap: 24px;
	}

	.yp-footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: 32px;
	}
}

/* -------------------------------------------------------------------------
 * Mobil Cihazlar (Max 768px)
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
	/* Alt barın içeriği örtmesini engelleyen safe area payı */
	body {
		padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
	}

	/* Sabit Mobil Alt Navigasyon Çubuğunu Göster */
	.yp-mobile-bottom-nav {
		display: block;
	}

	/* Header Düzenlemeleri */
	.yp-topbar-inner {
		flex-direction: column;
		gap: 6px;
		text-align: center;
	}
	.yp-topbar-actions {
		display: none;
	}

	.yp-main-navigation {
		display: none;
	}
	.yp-btn-vendor {
		display: none;
	}
	/* Mobil üst çubukta profil hap butonunu gizle; mobil çekmece menüsüne taşındı */
	.yp-header-actions .yp-user-menu-wrapper,
	.yp-header-actions .js-open-auth-modal {
		display: none !important;
	}
	.yp-mobile-menu-toggle {
		display: flex;
	}

	/* Hero ve Arama Alanı */
	.yp-hero-section {
		padding: 36px 0 20px;
	}
	.yp-hero-title {
		font-size: 26px;
		letter-spacing: -0.5px;
		line-height: 1.3;
	}
	.yp-hero-subtitle {
		font-size: 14.5px;
		margin-bottom: 20px;
	}

	.yp-search-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}
	.yp-field-keyword,
	.yp-search-action {
		grid-column: span 1;
	}
	.yp-search-extra-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	/* Form ve Panel Tek Sütun Düzeni (Mobile-First) */
	.yp-form-grid,
	.yp-form-row,
	.yp-profile-layout,
	.yp-store-layout-grid,
	.yp-service-detail-grid,
	.yp-reviews-layout-grid,
	.yp-deal-detail-card {
		grid-template-columns: 1fr !important;
		gap: 20px;
	}

	.yp-dash-header {
		flex-direction: column;
		align-items: flex-start;
		padding: 20px;
		gap: 16px;
	}
	.yp-dash-store-status {
		align-items: flex-start;
		width: 100%;
	}

	/* Tablolarda Taşmayı Önleyen Yatay Kaydırma */
	.yp-dash-panel {
		padding: 20px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.yp-dash-table {
		min-width: 500px;
	}

	/* Dokunmatik Form ve Buton Hedefleri (Min 44px) */
	.yp-btn,
	.yp-select-input,
	.yp-text-input,
	.yp-form-control {
		min-height: 46px;
	}

	/* Modal Pencere Sınırlandırması */
	.yp-modal-dialog {
		width: 92%;
		max-width: 420px;
		max-height: 85vh;
		overflow-y: auto;
	}

	/* Yerel Pazar Kategorileri & Kart Taşma Koruması */
	.yp-categories-section {
		overflow: hidden !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.yp-category-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 10px !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}
	.yp-category-card {
		padding: 11px 9px !important;
		gap: 8px !important;
		min-width: 0 !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		overflow: hidden !important;
	}
	.yp-cat-icon-wrap {
		width: 36px !important;
		height: 36px !important;
		font-size: 18px !important;
		border-radius: 8px !important;
		flex-shrink: 0 !important;
	}
	.yp-cat-info {
		min-width: 0 !important;
		overflow: hidden !important;
		flex: 1 1 auto !important;
	}
	.yp-cat-title {
		font-size: 12.5px !important;
		line-height: 1.25 !important;
		white-space: nowrap !important;
		overflow: hidden !important;
		text-overflow: ellipsis !important;
		margin: 0 0 2px 0 !important;
	}
	.yp-cat-count {
		font-size: 11px !important;
		white-space: nowrap !important;
		overflow: hidden !important;
		text-overflow: ellipsis !important;
		display: block !important;
	}
	.yp-cat-arrow {
		display: none !important;
	}
	.yp-categories-sidebar-wrapper {
		flex-direction: column !important;
		gap: 16px !important;
	}
	.yp-cat-sidebar-left,
	.yp-cat-sidebar-right-grid {
		width: 100% !important;
		flex: 1 1 100% !important;
		min-width: 0 !important;
		box-sizing: border-box !important;
	}
	.yp-stores-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
	.yp-products-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}
	.yp-deals-grid,
	.yp-deals-2col {
		grid-template-columns: 1fr;
	}

	/* Tekil Mağaza Sayfası */
	.yp-store-hero-inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
	}
	.yp-store-contact-actions {
		width: 100%;
		flex-direction: column;
	}
	.yp-store-contact-actions .yp-btn {
		width: 100%;
	}
	.yp-deal-detail-card {
		grid-template-columns: 1fr !important;
		padding: 20px !important;
	}

	/* Footer */
	.yp-footer-grid {
		grid-template-columns: 1fr;
		gap: 28px;
	}
	.yp-footer-bottom {
		flex-direction: column;
		gap: 14px;
		text-align: center;
	}
	.yp-legal-links {
		flex-wrap: wrap;
		justify-content: center;
		gap: 10px;
	}
}

/* -------------------------------------------------------------------------
 * Kompakt Telefonlar (Max 390px - iPhone 12/13/14 vb.)
 * ------------------------------------------------------------------------- */
@media (max-width: 390px) {
	.yp-container {
		padding: 0 14px;
	}

	.yp-hero-title {
		font-size: 23px;
	}
	.yp-hero-subtitle {
		font-size: 13.5px;
	}

	.yp-products-grid,
	.yp-products-3col {
		grid-template-columns: 1fr !important;
	}

	.yp-category-grid {
		grid-template-columns: 1fr !important;
	}
	.yp-category-card {
		padding: 10px 12px !important;
	}

	.yp-dash-tabs {
		gap: 6px;
	}
	.yp-dash-tab {
		padding: 10px 12px;
		font-size: 13px;
	}

	.yp-store-profile-avatar {
		width: 80px;
		height: 80px;
	}
	.yp-store-page-title {
		font-size: 24px;
	}
}

/* -------------------------------------------------------------------------
 * En Küçük Telefonlar (Max 320px - iPhone SE 1. Nesil, Küçük Androidler)
 * ------------------------------------------------------------------------- */
@media (max-width: 320px) {
	.yp-container {
		padding: 0 10px;
	}

	.yp-brand-title {
		font-size: 17px;
	}
	.yp-brand-tagline {
		display: none;
	}

	.yp-hero-title {
		font-size: 20px;
	}
	.yp-hero-badge {
		font-size: 11px;
		padding: 4px 10px;
	}

	.yp-dash-title {
		font-size: 22px;
	}
	.yp-dash-panel {
		padding: 14px;
	}

	.yp-bottom-nav-inner {
		height: 54px;
	}
	.yp-bottom-nav-item .nav-label {
		font-size: 9px;
	}
	.yp-bottom-nav-item .nav-icon {
		width: 22px;
		height: 22px;
	}
}

/* -------------------------------------------------------------------------
 * Bağımsız Hizmetler & Ustalar Responsive Kuralları
 * ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.yp-services-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
	.yp-service-detail-grid {
		grid-template-columns: 1fr 300px !important;
	}
}

@media (max-width: 768px) {
	.yp-services-grid {
		grid-template-columns: 1fr !important;
	}
	.yp-service-detail-grid {
		grid-template-columns: 1fr !important;
	}
	.yp-service-sidebar {
		order: -1;
		margin-bottom: 24px;
	}
	.yp-service-sidebar > div {
		position: static !important;
	}
	.yp-btn-services-shortcut {
		padding: 5px 8px;
		font-size: 11px;
	}
}

@media (max-width: 390px) {
	.yp-service-footer {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	.yp-service-actions {
		width: 100%;
		justify-content: space-between;
	}
	.yp-btn-services-shortcut {
		display: none;
	}
}

/* -------------------------------------------------------------------------
 * Esnafa Destek CTA Bandı & Mobil Taşma Koruması
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
	.yp-vendor-cta-section {
		padding: 24px 0 !important;
		overflow: hidden !important;
	}
	.yp-vendor-cta-card {
		flex-direction: column !important;
		align-items: stretch !important;
		padding: 24px 18px !important;
		gap: 20px !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		overflow: hidden !important;
	}
	.yp-cta-pill {
		max-width: 100% !important;
		box-sizing: border-box !important;
		white-space: normal !important;
		word-break: break-word !important;
		font-size: 11.5px !important;
		line-height: 1.4 !important;
		display: inline-block !important;
	}
	.yp-vendor-cta-title {
		font-size: 20px !important;
		line-height: 1.3 !important;
		margin-bottom: 10px !important;
		word-break: break-word !important;
	}
	.yp-vendor-cta-desc {
		font-size: 13.5px !important;
		line-height: 1.5 !important;
		margin-bottom: 16px !important;
		max-width: 100% !important;
	}
	.yp-vendor-perks {
		grid-template-columns: 1fr !important;
		gap: 8px !important;
		margin-bottom: 20px !important;
	}
	.yp-vendor-actions {
		flex-direction: column !important;
		align-items: stretch !important;
		gap: 10px !important;
		width: 100% !important;
	}
	.yp-vendor-actions .yp-btn {
		width: 100% !important;
		justify-content: center !important;
		text-align: center !important;
	}
	.yp-vendor-graphic-box {
		min-width: 0 !important;
		width: 100% !important;
		padding: 18px !important;
		box-sizing: border-box !important;
	}
}

@media (max-width: 390px) {
	.yp-vendor-cta-card {
		padding: 18px 14px !important;
	}
	.yp-vendor-cta-title {
		font-size: 18px !important;
	}
	.yp-cta-pill {
		font-size: 11px !important;
		padding: 4px 10px !important;
	}
}

/* -------------------------------------------------------------------------
 * PWA Mobil Hızlı Yükleme Bildirimi (Floating Banner)
 * ------------------------------------------------------------------------- */
@media (min-width: 769px) {
	.yp-mobile-pwa-banner {
		display: none !important;
	}
}

.yp-mobile-pwa-banner {
	position: fixed;
	bottom: 72px;
	left: 12px;
	right: 12px;
	z-index: 998;
	background: #0f172a;
	color: #ffffff;
	border-radius: 12px;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.15);
	animation: ypPwaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.yp-pwa-banner-content {
	display: flex;
	align-items: center;
	padding: 10px 14px;
	gap: 12px;
	width: 100%;
	box-sizing: border-box;
}

.yp-pwa-banner-icon {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	background: rgba(34, 197, 94, 0.15);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.yp-pwa-banner-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.yp-pwa-banner-text strong {
	font-size: 13px;
	font-weight: 700;
	color: #f8fafc;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.yp-pwa-banner-text span {
	font-size: 11px;
	color: #94a3b8;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.yp-pwa-banner-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.yp-pwa-banner-btn {
	padding: 6px 12px !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	border-radius: 6px !important;
	background: #16a34a !important;
	color: #ffffff !important;
	border: none !important;
	cursor: pointer;
}

.yp-pwa-banner-close {
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 20px;
	line-height: 1;
	padding: 4px;
	cursor: pointer;
}

.yp-pwa-banner-close:hover {
	color: #ffffff;
}

@keyframes ypPwaSlideUp {
	from {
		transform: translateY(30px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}
