/**
 * WC Delivery Locations - Public styles
 */

/* ============ PIN-IKON ============ */
/* SVG som CSS-mask. Hvit pin på alle bakgrunner. */
.wcdl-pin-icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	background-color: #fff;
	-webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTEyIDJDOC4xMyAyIDUgNS4xMyA1IDljMCA1LjI1IDcgMTMgNyAxM3M3LTcuNzUgNy0xM2MwLTMuODctMy4xMy03LTctN3ptMCA5LjVjLTEuMzggMC0yLjUtMS4xMi0yLjUtMi41czEuMTItMi41IDIuNS0yLjUgMi41IDEuMTIgMi41IDIuNS0xLjEyIDIuNS0yLjUgMi41eiIvPjwvc3ZnPg==") no-repeat center / contain;
	mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTEyIDJDOC4xMyAyIDUgNS4xMyA1IDljMCA1LjI1IDcgMTMgNyAxM3M3LTcuNzUgNy0xM2MwLTMuODctMy4xMy03LTctN3ptMCA5LjVjLTEuMzggMC0yLjUtMS4xMi0yLjUtMi41czEuMTItMi41IDIuNS0yLjUgMi41IDEuMTIgMi41IDIuNS0xLjEyIDIuNS0yLjUgMi41eiIvPjwvc3ZnPg==") no-repeat center / contain;
	vertical-align: -0.15em;
	font-style: normal;
}

/* ============ SHORTCODE: LOCATION BAR ============ */
.wcdl-location-bar {
	font-size: 14px;
	padding: 10px 16px;
	border-radius: 6px;
	margin: 0 0 16px;
}

.wcdl-location-bar-inner {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* Dark tema (default) */
.wcdl-location-bar.wcdl-style-dark {
	background: #1a1a1a;
	color: #fff;
}
.wcdl-location-bar.wcdl-style-dark.no-location {
	background: #c9302c;
}
.wcdl-location-bar.wcdl-style-dark .wcdl-bar-btn {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.4);
	color: #fff;
}
.wcdl-location-bar.wcdl-style-dark .wcdl-bar-btn:hover {
	background: rgba(255, 255, 255, 0.15);
}

/* Light tema */
.wcdl-location-bar.wcdl-style-light {
	background: #f6f7f7;
	color: #1a1a1a;
	border: 1px solid #e0e0e0;
}
.wcdl-location-bar.wcdl-style-light.no-location {
	background: #fef3f3;
	border-color: #f5c6c6;
	color: #b32d2e;
}
.wcdl-location-bar.wcdl-style-light .wcdl-bar-btn {
	background: #fff;
	border: 1px solid #ccc;
	color: #1a1a1a;
}
.wcdl-location-bar.wcdl-style-light .wcdl-bar-btn:hover {
	background: #f0f0f0;
	border-color: #2271b1;
}

/* Red tema */
.wcdl-location-bar.wcdl-style-red {
	background: #c9302c;
	color: #fff;
}
.wcdl-location-bar.wcdl-style-red .wcdl-bar-btn {
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.5);
	color: #fff;
}
.wcdl-location-bar.wcdl-style-red .wcdl-bar-btn:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* Innretting */
.wcdl-location-bar.wcdl-align-center .wcdl-location-bar-inner {
	justify-content: center;
}
.wcdl-location-bar.wcdl-align-right .wcdl-location-bar-inner {
	justify-content: flex-end;
}

.wcdl-location-bar .wcdl-bar-icon {
	font-size: 16px;
}

.wcdl-location-bar .wcdl-bar-label {
	opacity: 0.85;
}

.wcdl-location-bar .wcdl-bar-name {
	font-weight: 600;
}

.wcdl-location-bar .wcdl-bar-address {
	opacity: 0.75;
	font-size: 13px;
}

.wcdl-location-bar .wcdl-bar-btn {
	padding: 4px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	margin-left: auto;
	transition: all 0.2s;
	font-weight: 500;
}

.wcdl-location-bar .wcdl-bar-select {
	font-weight: 600;
}

.wcdl-location-bar.wcdl-align-center .wcdl-bar-btn,
.wcdl-location-bar.wcdl-align-right .wcdl-bar-btn {
	margin-left: 0;
}

@media (max-width: 600px) {
	.wcdl-location-bar .wcdl-bar-address {
		display: none;
	}
}

/* ============ HEADER BAR (auto) ============ */
.wcdl-header-bar {
	background: #1a1a1a;
	color: #fff;
	font-size: 14px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wcdl-header-bar.no-location {
	background: #c9302c;
}

.wcdl-header-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.wcdl-header-icon {
	font-size: 16px;
}

.wcdl-header-label {
	opacity: 0.85;
}

.wcdl-header-name {
	font-weight: 600;
}

.wcdl-header-address {
	opacity: 0.75;
	font-size: 13px;
}

.wcdl-header-change,
.wcdl-header-select {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.4);
	color: #fff;
	padding: 4px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	margin-left: auto;
	transition: all 0.2s;
}

.wcdl-header-change:hover,
.wcdl-header-select:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.7);
}

.wcdl-header-select {
	font-weight: 600;
}

@media (max-width: 600px) {
	.wcdl-header-address {
		display: none;
	}
	.wcdl-header-inner {
		font-size: 13px;
	}
}

/* ============ POPUP ============ */
.wcdl-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
}

.wcdl-popup.is-open {
	display: flex;
}

.wcdl-popup-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	animation: wcdlFadeIn 0.2s ease-out;
}

.wcdl-popup-dialog {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	max-width: 480px;
	width: calc(100% - 40px);
	max-height: 90vh;
	overflow-y: auto;
	animation: wcdlSlideUp 0.25s ease-out;
}

.wcdl-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}

.wcdl-popup-close:hover {
	background: #f0f0f0;
	color: #000;
}

.wcdl-popup-content {
	padding: 36px 32px 32px;
}

.wcdl-popup-content h2 {
	margin: 0 0 8px;
	font-size: 24px;
	font-weight: 700;
	color: #1a1a1a;
}

.wcdl-popup-intro {
	margin: 0 0 24px;
	color: #555;
	font-size: 15px;
	line-height: 1.5;
}

.wcdl-input-group {
	display: flex;
	gap: 8px;
}

#wcdl-postcode {
	flex: 1;
	padding: 12px 14px;
	font-size: 16px;
	border: 2px solid #ddd;
	border-radius: 8px;
	outline: none;
	transition: border-color 0.15s;
}

#wcdl-postcode:focus {
	border-color: #2271b1;
}

.wcdl-btn-primary {
	background: #2271b1;
	color: #fff;
	border: 0;
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s;
}

.wcdl-btn-primary:hover {
	background: #135e96;
}

.wcdl-btn-primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.wcdl-btn-block {
	width: 100%;
	margin-top: 16px;
	padding: 14px;
	font-size: 16px;
}

.wcdl-message {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 14px;
	display: none;
}

.wcdl-message.is-error {
	display: block;
	background: #fde7e9;
	color: #b32d2e;
	border: 1px solid #f1c1c4;
}

.wcdl-message.is-loading {
	display: block;
	background: #f0f6fc;
	color: #2271b1;
}

.wcdl-current {
	margin-top: 8px;
}

.wcdl-current .wcdl-btn-primary,
.wcdl-current .wcdl-btn-secondary {
	margin-top: 12px;
}

.wcdl-current-card {
	background: #f0f6fc !important;
	border-color: #c5d9ed !important;
}

.wcdl-current-card .wcdl-result-icon {
	font-size: 16px;
}

.wcdl-current-card h3 {
	color: #1a1a1a !important;
	margin: 4px 0 !important;
}

.wcdl-current-card p {
	color: #555 !important;
}

.wcdl-current-label {
	display: block;
	color: #666 !important;
	font-size: 12px !important;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 600;
}

.wcdl-result {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #eee;
}

.wcdl-not-found {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #eee;
}

.wcdl-not-found-content {
	padding: 16px 18px;
	background: #fef3f3;
	border: 1px solid #f5c6c6;
	border-radius: 10px;
	color: #5a1f1f;
	font-size: 15px;
	line-height: 1.5;
}

.wcdl-not-found-content p {
	margin: 0 0 10px;
}

.wcdl-not-found-content p:last-child {
	margin-bottom: 0;
}

.wcdl-not-found-content a {
	color: #b32d2e;
	font-weight: 600;
}

.wcdl-btn-secondary {
	background: #f6f7f7;
	color: #1a1a1a;
	border: 1px solid #ccc;
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 500;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.15s;
}

.wcdl-btn-secondary:hover {
	background: #fff;
	border-color: #2271b1;
}

.wcdl-result-card {
	display: flex;
	gap: 14px;
	padding: 16px;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
}

.wcdl-result-icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #16a34a;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-style: normal;
	font-size: 18px;
	line-height: 1;
}

/* Pin-ikon i blå current-sirkel */
.wcdl-current-card .wcdl-result-icon {
	background: #2271b1;
}

/* Header- og bar-ikoner */
.wcdl-header-icon,
.wcdl-bar-icon {
	font-style: normal;
	display: inline-flex;
	align-items: center;
	font-size: 16px;
	line-height: 1;
}

.wcdl-result-text h3 {
	margin: 0 0 4px;
	font-size: 17px;
	color: #14532d;
}

.wcdl-result-text p {
	margin: 0 0 4px;
	color: #166534;
	font-size: 14px;
}

.wcdl-result-text small {
	color: #4d7c5e;
	font-size: 13px;
}

@keyframes wcdlFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

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

/* Shortcode-knapp */
.wcdl-shortcode-btn {
	background: #f6f7f7;
	border: 1px solid #ddd;
	padding: 8px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	transition: all 0.15s;
}

.wcdl-shortcode-btn:hover {
	background: #fff;
	border-color: #2271b1;
}

/* Skjul body når popup er åpen og påkrevd */
body.wcdl-popup-locked {
	overflow: hidden;
}
