/**
 * Sendsei PUDO Map Styles
 * Interactive Pickup Point Selector for WooCommerce Checkout
 */

/* ─── Checkout Inline Container ─── */
.sendsei-pudo-container {
	margin: 10px 0 16px 0;
	font-family: inherit;
}

.sendsei-pudo-unselected-card,
.sendsei-pudo-selected-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 12px 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sendsei-pudo-unselected-card {
	border-color: #cbd5e1;
	border-style: dashed;
	background: #f8fafc;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.sendsei-pudo-prompt {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sendsei-pudo-prompt-icon {
	font-size: 24px;
	line-height: 1;
	flex-shrink: 0;
}

.sendsei-pudo-prompt-text strong {
	display: block;
	font-size: 14px;
	color: #1e293b;
	margin-bottom: 2px;
}

.sendsei-pudo-prompt-text span {
	font-size: 12px;
	color: #64748b;
}

.sendsei-pudo-selected-card {
	border-left: 4px solid #10b981;
}

.sendsei-pudo-selected-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.sendsei-pudo-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #ecfdf5;
	color: #065f46;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.sendsei-pudo-selected-name {
	font-size: 14px;
	font-weight: 600;
	color: #0f172a;
	margin: 0 0 2px 0;
}

.sendsei-pudo-selected-address {
	font-size: 13px;
	color: #475569;
	margin: 0 0 4px 0;
	line-height: 1.4;
}

.sendsei-pudo-selected-schedule {
	font-size: 12px;
	color: #64748b;
	margin: 0 0 8px 0;
	display: flex;
	align-items: center;
	gap: 4px;
}

.sendsei-btn-open-map,
.sendsei-btn-change-map {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #0284c7 !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 6px !important;
	padding: 7px 14px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	cursor: pointer;
	text-decoration: none !important;
	transition: background-color 0.2s ease, transform 0.1s ease;
}

.sendsei-btn-open-map:hover,
.sendsei-btn-change-map:hover {
	background: #0369a1 !important;
	color: #ffffff !important;
}

.sendsei-btn-change-map {
	background: #f1f5f9 !important;
	color: #334155 !important;
	border: 1px solid #cbd5e1 !important;
}

.sendsei-btn-change-map:hover {
	background: #e2e8f0 !important;
	color: #1e293b !important;
}

/* ─── Modal Dialog ─── */
.sendsei-pudo-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.sendsei-pudo-modal * {
	box-sizing: border-box;
}

.sendsei-pudo-modal.active {
	display: flex;
}

.sendsei-pudo-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.7);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.sendsei-pudo-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 1020px;
	height: 88vh;
	max-height: 720px;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 10;
	animation: sendseiFadeInUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sendseiFadeInUp {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ─── Modal Header ─── */
.sendsei-pudo-modal-header {
	padding: 14px 20px;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #ffffff;
	flex-shrink: 0;
}

.sendsei-pudo-header-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.sendsei-pudo-carrier-logo {
	max-height: 28px;
	max-width: 80px;
	object-fit: contain;
}

.sendsei-pudo-header-title {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
	line-height: 1.2;
}

.sendsei-pudo-header-subtitle {
	font-size: 12px;
	color: #64748b;
	margin: 2px 0 0 0;
}

.sendsei-pudo-btn-close {
	background: transparent;
	border: none;
	font-size: 22px;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	line-height: 1;
	transition: color 0.15s ease, background 0.15s ease;
}

.sendsei-pudo-btn-close:hover {
	color: #0f172a;
	background: #f1f5f9;
}

/* ─── Mobile View Switcher Tabs ─── */
.sendsei-pudo-mobile-tabs {
	display: none;
	border-bottom: 1px solid #e2e8f0;
	background: #f8fafc;
	flex-shrink: 0;
}

.sendsei-pudo-mobile-tab-btn {
	flex: 1;
	padding: 10px 14px;
	border: none;
	background: transparent;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border-bottom: 2px solid transparent;
}

.sendsei-pudo-mobile-tab-btn.active {
	color: #0284c7;
	border-bottom-color: #0284c7;
	background: #ffffff;
}

/* ─── Modal Body Split View ─── */
.sendsei-pudo-modal-body {
	flex: 1;
	display: flex;
	overflow: hidden;
	position: relative;
	min-height: 0;
}

/* Sidebar (List & Search) */
.sendsei-pudo-sidebar {
	width: 380px;
	min-width: 320px;
	border-right: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	background: #f8fafc;
	flex-shrink: 0;
}

.sendsei-pudo-search-container {
	padding: 12px;
	background: #ffffff;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.sendsei-pudo-search-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sendsei-pudo-search-input:focus {
	border-color: #0284c7;
	box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.sendsei-pudo-list {
	flex: 1;
	overflow-y: auto;
	padding: 10px;
	gap: 8px;
	display: flex;
	flex-direction: column;
}

.sendsei-pudo-item {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 10px 12px;
	cursor: pointer;
	transition: all 0.15s ease;
	position: relative;
}

.sendsei-pudo-item:hover {
	border-color: #93c5fd;
	background: #f0f7ff;
}

.sendsei-pudo-item.selected {
	border-color: #10b981;
	background: #ecfdf5;
	box-shadow: 0 0 0 1px #10b981;
}

.sendsei-pudo-item-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}

.sendsei-pudo-item-title {
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
	margin: 0;
	line-height: 1.3;
}

.sendsei-pudo-item-radio {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid #cbd5e1;
	margin-left: 8px;
	flex-shrink: 0;
	position: relative;
}

.sendsei-pudo-item.selected .sendsei-pudo-item-radio {
	border-color: #10b981;
	background: #10b981;
}

.sendsei-pudo-item.selected .sendsei-pudo-item-radio::after {
	content: '';
	position: absolute;
	width: 6px;
	height: 6px;
	background: #ffffff;
	border-radius: 50%;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.sendsei-pudo-item-address {
	font-size: 12px;
	color: #475569;
	margin: 0 0 4px 0;
	line-height: 1.35;
}

.sendsei-pudo-item-schedule {
	font-size: 11px;
	color: #64748b;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 4px;
	line-height: 1.3;
}

.sendsei-pudo-item-empty {
	padding: 24px 16px;
	text-align: center;
	color: #64748b;
	font-size: 13px;
}

/* Map Wrapper */
.sendsei-pudo-map-wrapper {
	flex: 1;
	position: relative;
	height: 100%;
	background: #e2e8f0;
}

.sendsei-pudo-map-element {
	width: 100%;
	height: 100%;
}

/* Leaflet Custom Popup Styling */
.sendsei-pudo-popup .leaflet-popup-content-wrapper {
	border-radius: 8px;
	padding: 4px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.sendsei-pudo-popup-content {
	font-size: 13px;
	line-height: 1.4;
	color: #1e293b;
	padding: 4px;
}

.sendsei-pudo-popup-title {
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 4px;
	color: #0f172a;
}

.sendsei-pudo-popup-address {
	font-size: 12px;
	color: #475569;
	margin-bottom: 6px;
}

.sendsei-pudo-popup-schedule {
	font-size: 11px;
	color: #64748b;
	margin-bottom: 8px;
}

.sendsei-btn-select-popup {
	display: block;
	width: 100%;
	background: #10b981;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	transition: background 0.15s ease;
}

.sendsei-btn-select-popup:hover {
	background: #059669;
}

/* ─── Modal Footer ─── */
.sendsei-pudo-modal-footer {
	padding: 12px 20px;
	border-top: 1px solid #e2e8f0;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	gap: 12px;
}

.sendsei-pudo-footer-info {
	font-size: 13px;
	color: #334155;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sendsei-pudo-footer-info strong {
	color: #0f172a;
}

.sendsei-pudo-footer-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.sendsei-btn-cancel {
	background: #f1f5f9;
	color: #475569;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.sendsei-btn-cancel:hover {
	background: #e2e8f0;
	color: #1e293b;
}

.sendsei-btn-confirm {
	background: #10b981;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	padding: 8px 18px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.sendsei-btn-confirm:hover:not(:disabled) {
	background: #059669;
}

.sendsei-btn-confirm:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	background: #94a3b8;
}

/* ─── Mobile Adaptations (< 768px) ─── */
@media (max-width: 768px) {
	.sendsei-pudo-modal {
		padding: 0;
	}

	.sendsei-pudo-modal-dialog {
		width: 100%;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
	}

	.sendsei-pudo-mobile-tabs {
		display: flex;
	}

	.sendsei-pudo-modal-body {
		flex-direction: column;
	}

	.sendsei-pudo-sidebar {
		width: 100%;
		min-width: 100%;
		border-right: none;
		height: 100%;
	}

	.sendsei-pudo-map-wrapper {
		width: 100%;
		height: 100%;
	}

	/* On mobile, tab switcher controls which one is shown */
	.sendsei-pudo-modal-body.tab-map .sendsei-pudo-sidebar {
		display: none;
	}

	.sendsei-pudo-modal-body.tab-map .sendsei-pudo-map-wrapper {
		display: block;
	}

	.sendsei-pudo-modal-body.tab-list .sendsei-pudo-sidebar {
		display: flex;
	}

	.sendsei-pudo-modal-body.tab-list .sendsei-pudo-map-wrapper {
		display: none;
	}

	.sendsei-pudo-footer-info {
		display: none;
	}
}
