/**
 * Shipping Calculator — Public Styles
 *
 * @package ShippingCalculator
 * @version 1.1.1
 */

/* ── Password Form ── */
.shipcalc-password-wrap {
	display: flex;
	justify-content: center;
	padding: 40px 16px;
}

.shipcalc-password-card {
	background: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 40px 32px;
	max-width: 400px;
	width: 100%;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shipcalc-password-icon {
	color: #2271b1;
	margin-bottom: 16px;
}

.shipcalc-password-card h3 {
	margin: 0 0 8px;
	font-size: 22px;
	color: #1d2327;
}

.shipcalc-password-card p {
	margin: 0 0 24px;
	color: #50575e;
	font-size: 14px;
	line-height: 1.5;
}

.shipcalc-pw-error {
	background: #fcf0f1;
	color: #8a1f1f;
	border: 1px solid #f0c5c5;
	border-radius: 6px;
	padding: 10px 14px;
	margin-bottom: 16px;
	font-size: 13px;
}

.shipcalc-password-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.shipcalc-pw-input {
	padding: 12px 14px;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	font-size: 15px;
	outline: none;
	transition: border-color 0.2s;
	width: 100%;
	box-sizing: border-box;
}

.shipcalc-pw-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.shipcalc-pw-button {
	padding: 12px 24px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.shipcalc-pw-button:hover {
	background: #135e96;
}

/* ── Calculator ── */
.shipcalc-wrap {
	padding: 16px 0;
}

.shipcalc-card {
	background: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 32px;
	max-width: 640px;
	margin: 0 auto;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shipcalc-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 2px solid #f0f0f1;
}

.shipcalc-header svg {
	color: #2271b1;
	flex-shrink: 0;
}

.shipcalc-header h2 {
	margin: 0;
	font-size: 22px;
	color: #1d2327;
	font-weight: 700;
	line-height: 1.2;
}

.shipcalc-section {
	margin-bottom: 24px;
}

.shipcalc-section h3 {
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
	margin: 0 0 14px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.shipcalc-field {
	margin-bottom: 16px;
}

.shipcalc-field label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #3c434a;
	margin-bottom: 6px;
}

.shipcalc-field input,
.shipcalc-field select {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	font-size: 15px;
	color: #1d2327;
	background: #fff;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
	-webkit-appearance: none;
}

.shipcalc-field input:focus,
.shipcalc-field select:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.shipcalc-field input::placeholder {
	color: #a7aaad;
}

.shipcalc-field select {
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233c434a' d='M6 8.825L.35 3.175l.7-.7L6 7.4l4.95-4.925.7.7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.shipcalc-field-row {
	display: flex;
	gap: 16px;
}

.shipcalc-field-half {
	flex: 1;
}

/* ── Submit Button ── */
.shipcalc-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 24px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	margin-top: 8px;
}

.shipcalc-button:hover {
	background: #135e96;
}

.shipcalc-button:active {
	transform: scale(0.99);
}

.shipcalc-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.shipcalc-button svg {
	flex-shrink: 0;
}

/* ── Result Area ── */
.shipcalc-result {
	margin-top: 24px;
	border-radius: 10px;
	overflow: hidden;
}

.shipcalc-result-success {
	background: #edfcf2;
	border: 1px solid #b8e6c8;
}

.shipcalc-result-error {
	background: #fcf0f1;
	border: 1px solid #f0c5c5;
}

.shipcalc-result-success .shipcalc-result-cost {
	font-size: 32px;
	font-weight: 700;
	color: #0a6c2e;
	text-align: center;
	padding: 24px 20px 8px;
	line-height: 1;
}

.shipcalc-result-success .shipcalc-result-label {
	text-align: center;
	font-size: 13px;
	color: #3c7a50;
	padding: 0 20px 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 600;
}

.shipcalc-result-success .shipcalc-result-breakdown {
	text-align: center;
	font-size: 13px;
	color: #50575e;
	padding: 4px 20px 20px;
	border-top: 1px solid #d5eddf;
	margin-top: 12px;
	padding-top: 12px;
}

.shipcalc-result-error .shipcalc-result-message {
	padding: 16px 20px;
	color: #8a1f1f;
	font-size: 14px;
	text-align: center;
	font-weight: 500;
}

/* ── Loading ── */
.shipcalc-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 20px;
	margin-top: 16px;
	color: #50575e;
	font-size: 14px;
}

.shipcalc-spinner {
	width: 22px;
	height: 22px;
	border: 3px solid #e0e0e0;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: shipcalc-spin 0.7s linear infinite;
}

@keyframes shipcalc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ── Responsive ── */
@media (max-width: 480px) {
	.shipcalc-card {
		padding: 20px 16px;
		border-radius: 8px;
	}

	.shipcalc-field-row {
		flex-direction: column;
		gap: 0;
	}

	.shipcalc-header h2 {
		font-size: 18px;
	}

	.shipcalc-result-success .shipcalc-result-cost {
		font-size: 26px;
	}
}

/* ── Google Places Autocomplete ── */
.shipcalc-autocomplete-active {
	position: relative;
}

.shipcalc-autocomplete-active input {
	padding-right: 36px;
}

.shipcalc-autocomplete-active::after {
	content: '';
	position: absolute;
	right: 12px;
	top: 38px;
	width: 18px;
	height: 18px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a7aaad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 18px 18px;
	pointer-events: none;
}

/* Override Google's default pac-container styles for consistency. */
.pac-container {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	background: #ffffff !important;
	color: #1d2327 !important;
	border-radius: 8px;
	border: 1px solid #c3c4c7;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	margin-top: 4px;
	z-index: 99999;
}

.pac-container .pac-item {
	padding: 8px 14px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.4;
	color: #50575e !important;
	background: #ffffff !important;
	border-top: 1px solid #f0f0f1;
}

.pac-container .pac-item:first-child {
	border-top: none;
}

.pac-container .pac-item:hover,
.pac-container .pac-item-selected {
	background: #f0f6fc !important;
}

.pac-container .pac-item .pac-icon {
	margin-right: 8px;
}

.pac-container .pac-item .pac-item-query {
	font-weight: 600;
	color: #1d2327 !important;
}

.pac-container .pac-item-query span,
.pac-container .pac-item span {
	color: inherit !important;
}

.pac-container .pac-matched {
	color: #2271b1 !important;
	font-weight: 600;
}

.pac-container::after {
	padding: 6px 14px;
	font-size: 11px;
}
