/**
 * Packlink PRO at checkout and on the cart page: the drop-off button, the
 * chosen point, the picker window and the « no drop-off point » notice,
 * restyled in the MUKI look. CSS only: the plugin's files are untouched.
 * Loaded on the cart and checkout only, after Packlink's own CSS
 * (packlink-checkout.css, packlink-location-picker.css); the « body »
 * prefixes and the few !important outweigh those files and Fluid Checkout.
 */

/* ==========================================================================
   1. « Sélectionner un point de dépôt »: a secondary button
   ========================================================================== */

body #packlink-drop-off-picker {
	min-height: 0;
	margin: 12px 0 0;
	padding: 10px 16px;
	border: 1px solid var(--espresso) !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--espresso) !important;
	font-family: var(--font-mono);
	font-size: 10.5px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.14em;
	text-align: left;
	text-transform: uppercase;
	white-space: normal;
	cursor: pointer;
	transition: background-color var(--fade) var(--ease), color var(--fade) var(--ease);
}

body #packlink-drop-off-picker:hover,
body #packlink-drop-off-picker:focus-visible {
	background: var(--espresso) !important;
	color: var(--cream) !important;
}

body #packlink-drop-off-picker:focus-visible {
	outline: 1px solid var(--espresso);
	outline-offset: 2px;
}

/* The chosen point, written under the button by the plugin:
   « Le colis sera livré à : » then name, address, town */
body #packlink-drop-off-picker + .woocommerce-shipping-destination {
	margin: 12px 0 0;
	color: var(--espresso);
	font-family: var(--font-serif);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.45;
	letter-spacing: 0;
	text-transform: none;
}

body #packlink-drop-off-picker + .woocommerce-shipping-destination strong {
	display: inline-block;
	margin-bottom: 2px;
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 10.5px;
	font-weight: 400;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* ==========================================================================
   2. The picker window
   ========================================================================== */

body #pl-picker-modal {
	top: 6vh;
	left: 50%;
	width: min(960px, 90vw);
	height: 88vh;
	transform: translateX(-50%);
	z-index: 100000; /* above the header, the side cart and the admin bar */
	border: 1px solid var(--line) !important;
	border-radius: 0;
	background: var(--ground);
	box-shadow: 0 16px 48px rgba(56, 36, 29, 0.14);
	color: var(--espresso);
}

/* Close cross: inside the window, top right, espresso, large tap area */
body #pl-picker-modal svg#pl-picker-modal-close {
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 44px;
	height: 44px;
	padding: 8px;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

body #pl-picker-modal svg#pl-picker-modal-close path {
	stroke: var(--espresso);
	stroke-width: 1.2;
}

body #pl-picker-modal svg#pl-picker-modal-close:hover {
	background: var(--cream);
}

body #pl-picker-modal .lp-content {
	min-height: 0;
	background: var(--ground);
}

body #pl-picker-modal .lp-locations {
	padding: 0 24px 24px;
}

/* Search box: like the checkout fields */
body #pl-picker-modal .lp-input-wrapper {
	width: auto;
	height: auto;
	margin: 64px 0 20px;
}

body #pl-picker-modal .lp-input-wrapper > .input {
	width: 100%;
}

body #pl-picker-modal .lp-input-wrapper > .input > input {
	height: 52px;
	padding: 20px 14px 0;
	border: 1px solid var(--line);
	border-radius: 0;
	background: var(--white);
	box-shadow: none;
	color: var(--espresso);
	font-family: var(--font-serif);
	font-size: 16px;
}

body #pl-picker-modal .lp-input-wrapper > .input > input:focus {
	border: 1px solid var(--espresso) !important;
}

body #pl-picker-modal .lp-input-wrapper > .input > .label,
body #pl-picker-modal .lp-input-wrapper > .input > input:focus + .label,
body #pl-picker-modal .lp-input-wrapper > .input > input:valid + .label {
	left: 14px;
	color: var(--muted);
	font: 400 10.5px/1.4 var(--font-mono) !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

body #pl-picker-modal .lp-input-wrapper > .input > .label {
	top: 18px;
}

body #pl-picker-modal .lp-input-wrapper > .input > input:focus + .label,
body #pl-picker-modal .lp-input-wrapper > .input > input:valid + .label {
	top: 8px;
}

/* The list: one point per line, hairlines between them */
body #pl-picker-modal [data-lp-id="locations"] {
	border-top: 1px solid var(--espresso);
}

body #pl-picker-modal .lp-location-wrapper {
	align-items: center;
	min-height: 64px;
	padding: 8px 12px;
	border: 1px solid transparent;
	border-bottom: 1px solid var(--line);
	background: transparent;
}

body #pl-picker-modal .lp-location-wrapper:hover {
	background: var(--white);
}

body #pl-picker-modal .lp-location-wrapper.selected {
	border: 1px solid var(--espresso);
	background: var(--white);
}

body #pl-picker-modal .lp-location-wrapper > * {
	min-height: 0;
	color: var(--espresso);
	font: 400 11px/1.5 var(--font-mono);
	letter-spacing: 0.1em;
}

body #pl-picker-modal .lp-location-wrapper > *:not(.street) {
	line-height: 1.5;
}

/* Name of the point: Classico */
body #pl-picker-modal .lp-location-wrapper > .name {
	padding-right: 16px;
	font: 400 17px/1.3 var(--font-serif);
	letter-spacing: 0;
	text-transform: none;
	white-space: normal;
}

body #pl-picker-modal .lp-location-wrapper > .street > .street-name {
	margin-top: 0;
	white-space: normal;
}

body #pl-picker-modal .lp-location-wrapper > .city {
	padding-right: 16px;
	white-space: normal;
}

/* Phones: name, address, hours and buttons in one column */
body #pl-picker-modal .lp-location-wrapper > .composite {
	margin: 12px 0;
	color: var(--espresso);
	font: 400 11px/1.6 var(--font-mono);
	letter-spacing: 0.1em;
}

/* Packlink writes « <b>Name</b>, address ». The name goes on its own line;
   the « , » left at the start of the address line is pushed out of the box
   (two DM Mono characters) and clipped. */
body #pl-picker-modal .composite .street-name {
	overflow: hidden;
	text-indent: calc(-2ch - 0.2em);
}

/* Floated full width, so the address after it is the box's first line,
   the one text-indent moves. */
body #pl-picker-modal .composite .street-name b {
	display: block;
	float: left;
	width: 100%;
	margin-bottom: 4px;
	font: 400 17px/1.3 var(--font-serif);
	letter-spacing: 0;
	text-indent: 0;
	text-transform: none;
}

/* « Horaires », « Voir sur la carte »: quiet underlined links */
body #pl-picker-modal .lp-working-hours-btn,
body #pl-picker-modal [data-lp-id="composite-show-on-map"] {
	margin-top: 6px;
	color: var(--espresso);
	font: 400 10.5px/1.4 var(--font-mono);
	letter-spacing: 0.14em;
	text-decoration: underline;
	text-transform: uppercase;
	text-underline-offset: 0.3em;
	cursor: pointer;
}

body #pl-picker-modal .lp-hour-wrapper * {
	height: auto;
	color: var(--espresso);
	font: 400 11px/1.8 var(--font-mono);
	letter-spacing: 0.08em;
}

body #pl-picker-modal .lp-hour-wrapper .day {
	color: var(--muted);
	font-weight: 400;
}

/* « Sélectionner »: a secondary button */
body #pl-picker-modal .lp-select-button {
	height: auto;
	margin-right: 16px;
	padding: 9px 14px;
	border: 1px solid var(--espresso);
	border-radius: 0;
	background: transparent;
	color: var(--espresso);
	font: 400 10.5px/1.4 var(--font-mono);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transition: background-color var(--fade) var(--ease), color var(--fade) var(--ease);
}

body #pl-picker-modal .lp-select-button:hover {
	background: var(--espresso);
	color: var(--cream);
}

/* Map pin in espresso, no blue or green */
body #pl-picker-modal .lp-show-on-map-btn,
body #pl-picker-modal a:hover > .lp-show-on-map-btn {
	width: 20px;
	height: 30px;
	margin: 0 8px 0 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 30'%3E%3Cpath d='M10 1C5 1 1 5 1 10c0 6.5 9 18 9 18s9-11.5 9-18c0-5-4-9-9-9Z' fill='none' stroke='%2338241D' stroke-width='1.2'/%3E%3Ccircle cx='10' cy='10' r='3.2' fill='none' stroke='%2338241D' stroke-width='1.2'/%3E%3C/svg%3E") !important;
	background-position: center;
	opacity: 0.85;
}

body #pl-picker-modal a:hover > .lp-show-on-map-btn {
	opacity: 1;
}

body #pl-picker-modal .lp-radio {
	border-color: var(--espresso);
	background: var(--white);
}

body #pl-picker-modal .lp-spinner-wrapper {
	background: var(--ground);
}

body #pl-picker-modal .lp-spinner {
	border-color: var(--line);
	border-left-color: var(--espresso);
}

/* Phones: full screen, the cross stays in reach */
@media (max-width: 47.99em) {
	body #pl-picker-modal {
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		height: 100dvh;
		transform: none;
		border: 0 !important;
		box-shadow: none;
	}

	body #pl-picker-modal svg#pl-picker-modal-close {
		position: fixed;
		top: 6px;
		right: 6px;
		width: 44px;
		height: 44px;
	}

	body #pl-picker-modal .lp-locations {
		padding: 0 18px 24px;
	}

	body #pl-picker-modal .lp-input-wrapper {
		margin-top: 56px;
	}

	body #pl-picker-modal .lp-location-wrapper {
		padding: 4px 0;
	}

	body #pl-picker-modal .composite .lp-select-column {
		display: flex;
		align-items: center;
		gap: 16px;
		margin-top: 10px;
	}
}

/* ==========================================================================
   3. « Aucun point de dépôt n'est disponible… »: a quiet notice
   ========================================================================== */

body #no-drop-off-locations-message {
	margin: 10px 0 0;
}

body #no-drop-off-locations-message .woocommerce-info {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	color: var(--muted) !important;
	font-family: var(--font-mono) !important;
	font-size: 10.5px !important;
	line-height: 1.6;
	letter-spacing: 0.06em !important;
}

body #no-drop-off-locations-message .woocommerce-info::before {
	content: none;
	display: none;
}
