/* ==========================================================================
   TTW Cart & Checkout - "Where should we deliver?" (assets/js/address.js)
   Cart page "Change" and the product page "Change address". A centred card
   on computers, a sheet from the bottom on phones. Same boxes as the
   checkout: 46px, 8px corners, #D8D7E2 lines, purple focus ring.
   ========================================================================== */
html.ttwc-addr-on { overflow: hidden; }
.ttwc-addr[hidden] { display: none !important; }
.ttwc-addr {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: futura-pt, "Futura PT", Futura, "Century Gothic", "Avenir Next", Avenir, system-ui, sans-serif;
	color: #1A1D45;
	-webkit-text-size-adjust: 100%;
}
.ttwc-addr *, .ttwc-addr *::before, .ttwc-addr *::after { box-sizing: border-box; }
.ttwc-addr-back {
	position: absolute;
	inset: 0;
	background: rgba(11, 14, 63, .45);
	opacity: 0;
	transition: opacity .18s ease;
}
.ttwc-addr-box {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 22px 24px 24px;
	border-radius: 16px;
	background: #FFFFFF;
	box-shadow: 0 18px 50px rgba(11, 14, 63, .25);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .18s ease, transform .18s ease;
}
.ttwc-addr.is-open .ttwc-addr-back { opacity: 1; }
.ttwc-addr.is-open .ttwc-addr-box { opacity: 1; transform: none; }
.ttwc-addr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ttwc-addr h2#ttwc-addr-h {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: #0B0E3F;
}
.ttwc-addr .ttwc-addr-x {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: -6px -8px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #0B0E3F;
	box-shadow: none;
	min-height: 0;
	cursor: pointer;
}
.ttwc-addr .ttwc-addr-x:hover,
.ttwc-addr .ttwc-addr-x:focus,
.ttwc-addr .ttwc-addr-x:active { background: #F4F3F7; color: #0B0E3F; }
.ttwc-addr-sub { margin: 6px 0 16px; padding: 0; font-size: 14.5px; line-height: 1.45; color: #646987; }
.ttwc-addr-form { margin: 0; padding: 0; }
.ttwc-addr-f { display: block; position: relative; margin: 0 0 12px; padding: 0; }
.ttwc-addr-f[hidden] { display: none !important; }
.ttwc-addr-f > span:first-child {
	display: block;
	margin: 0 0 6px;
	font-size: 14px;
	line-height: 18px;
	font-weight: 500;
	color: #0B0E3F;
}
.ttwc-addr input[type="text"],
.ttwc-addr select {
	display: block;
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #D8D7E2;
	border-radius: 8px;
	background: #FFFFFF;
	color: #1A1D45;
	font-family: inherit;
	font-size: 16px; /* no zoom on iPhones */
	line-height: 44px;
	box-shadow: none;
	outline: 0;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
}
.ttwc-addr select {
	padding-right: 40px;
	background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0E3F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px 16px no-repeat;
	cursor: pointer;
}
.ttwc-addr input[type="text"]::placeholder { color: #9A9DB4; opacity: 1; }
.ttwc-addr input[type="text"]:focus,
.ttwc-addr select:focus { border-color: #7035EC; box-shadow: 0 0 0 3px rgba(112, 53, 236, .16); }
.ttwc-addr-street input[type="text"] {
	padding-left: 42px;
	background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237035EC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21.5s-7-6.2-7-12a7 7 0 0 1 14 0c0 5.8-7 12-7 12z'/%3E%3Ccircle cx='12' cy='9.5' r='2.6'/%3E%3C/svg%3E") 14px center / 18px 18px no-repeat;
}
.ttwc-addr-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr); gap: 0 10px; }
.ttwc-addr-row[data-cols="2"] { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.ttwc-addr-row[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
.ttwc-addr-more[hidden] { display: none !important; }
.ttwc-addr .ttwc-addr-manual {
	display: inline-block;
	width: auto;
	min-height: 0;
	box-shadow: none;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1.4;
	margin: -2px 0 12px;
	padding: 2px 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: #7035EC;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.ttwc-addr .ttwc-addr-manual:hover,
.ttwc-addr .ttwc-addr-manual:focus,
.ttwc-addr .ttwc-addr-manual:active { background: none; color: #5C28C9; }
.ttwc-addr-manual[hidden] { display: none !important; }
.ttwc-addr-f.is-bad input[type="text"],
.ttwc-addr-f.is-bad select { border-color: #D93A3A; }
.ttwc-addr-msg,
.ttwc-addr-err { display: block; margin: 6px 0 0; font-size: 13.5px; line-height: 1.35; color: #C62828; }
.ttwc-addr-err { margin: 0 0 12px; }
.ttwc-addr-err:empty { display: none; }
.ttwc-addr .ttwc-addr-save {
	display: block;
	width: 100%;
	height: 50px;
	margin: 4px 0 0;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: #7035EC;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .3px;
	text-transform: none;
	cursor: pointer;
	transition: background-color .15s, opacity .15s;
}
/* the theme's own button:hover/:focus colours must not reach these */
.ttwc-addr .ttwc-addr-save:hover,
.ttwc-addr .ttwc-addr-save:focus,
.ttwc-addr .ttwc-addr-save:active { background: #5C28C9; color: #FFFFFF; }
.ttwc-addr .ttwc-addr-save:focus-visible { outline: 2px solid #0B0E3F; outline-offset: 2px; }
.ttwc-addr .ttwc-addr-save[disabled] { background: #7035EC; color: #FFFFFF; opacity: .6; cursor: default; }
.ttwc-addr.is-busy .ttwc-addr-form { pointer-events: none; }
/* Google's list of suggestions sits in <body>: above the dialog */
.ttwc-addr-on .pac-container { z-index: 2147483600 !important; border-radius: 8px; margin-top: 4px; font-family: inherit; box-shadow: 0 8px 24px rgba(11, 14, 63, .16); }
.ttwc-addr-on .pac-item { padding: 6px 12px; font-size: 14px; line-height: 1.4; cursor: pointer; }

/* phones: a sheet from the bottom */
@media (max-width: 600px) {
	.ttwc-addr { align-items: flex-end; padding: 0; }
	.ttwc-addr-box {
		max-width: none;
		max-height: 92vh;
		padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
		border-radius: 18px 18px 0 0;
		transform: translateY(24px);
	}
	.ttwc-addr h2#ttwc-addr-h { font-size: 20px; }
	.ttwc-addr-row,
	.ttwc-addr-row[data-cols="2"],
	.ttwc-addr-row[data-cols="3"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.ttwc-addr-row[data-cols="3"] > .ttwc-addr-city,
	.ttwc-addr-row[data-cols="1"] > * { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
	.ttwc-addr-back, .ttwc-addr-box { transition: none; }
}

/* the theme's product-page button: a real button now */
#change-address-btn { cursor: pointer; }
#change-address-btn:focus-visible { outline: 2px solid #7035EC; outline-offset: 2px; border-radius: 2px; }
