/* Custom Cake Topper product page additions. */

/* --------------------------------------------------------------------------
   Concept banner (arriving from the design studio)
   -------------------------------------------------------------------------- */

.tsai-concept-banner {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0 0 24px;
	padding: 14px;
	border: 1px solid rgba(30, 29, 25, 0.1);
	border-radius: 12px;
	background: #fbf7f0;
}

body.single-product div.product .tsai-concept-banner .tsai-concept-banner__img {
	flex: 0 0 auto;
	width: 104px;
	max-width: 104px;
	height: 104px;
	object-fit: cover;
	object-position: center 18%;
	border: 1px solid rgba(30, 29, 25, 0.1);
	border-radius: 10px;
}

.tsai-concept-banner__copy {
	min-width: 0;
}

.tsai-concept-banner__label {
	display: block;
	margin-bottom: 4px;
	color: #8a6a39;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}

.tsai-concept-banner p {
	margin: 0;
	color: #6f685c;
	font-size: 12px;
	line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Product form layout

   The theme styles form.cart as a flex row (quantity + button). Variable
   products put the variation table and the custom fields inside that form,
   so restore a block flow and lay the rows out here instead.
   -------------------------------------------------------------------------- */

body.single-product div.product form.variations_form.cart {
	display: block;
	width: 100%;
}

body.single-product div.product form.cart table.variations {
	width: 100%;
	margin: 0 0 22px;
	border-collapse: collapse;
}

body.single-product div.product table.variations tbody,
body.single-product div.product table.variations tr,
body.single-product div.product table.variations th,
body.single-product div.product table.variations td {
	display: block;
	width: 100%;
}

body.single-product div.product table.variations th.label {
	padding: 0 0 6px;
	color: #6f685c;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-align: left;
	text-transform: uppercase;
}

body.single-product div.product table.variations td.value {
	padding: 0 0 14px;
}

body.single-product div.product table.variations tr:last-child td.value {
	padding-bottom: 0;
}

/* One control style for variation selects and custom inputs. */
body.single-product div.product table.variations select,
.tsai-field input[type="text"],
.tsai-field textarea {
	display: block;
	width: 100%;
	max-width: none;
	padding: 11px 14px;
	border: 1px solid rgba(30, 29, 25, 0.18);
	border-radius: 8px;
	background-color: #fffdf8;
	box-shadow: none;
	color: #1e1d19;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
}

body.single-product div.product table.variations select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236f685c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

body.single-product div.product table.variations select:focus,
.tsai-field input[type="text"]:focus,
.tsai-field textarea:focus {
	border-color: #a9854c;
	outline: none;
}

body.single-product div.product table.variations .reset_variations {
	display: none !important;
}

/* Personalization + additional information. */
.tsai-fields {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	margin: 0 0 18px;
	padding: 0 0 20px;
	border-bottom: 1px solid rgba(30, 29, 25, 0.08);
}

.tsai-field {
	display: block;
	width: 100%;
}

.tsai-field__label {
	display: block;
	margin-bottom: 6px;
	color: #6f685c;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
}

.tsai-field__label em {
	color: #a4513f;
	font-style: normal;
}

.tsai-field textarea {
	min-height: 96px;
	resize: vertical;
}

/* Inline validation message: same wording the server would return, shown
   before the customer reaches the cart. */
.tsai-field__error {
	display: none;
	margin-top: 6px;
	color: #a4513f;
	font-size: 12px;
	line-height: 1.45;
}

.tsai-field.has-error .tsai-field__error {
	display: block;
}

.tsai-field.has-error .tsai-field__label {
	color: #a4513f;
}

.tsai-field input[type="text"][aria-invalid="true"] {
	border-color: #a4513f;
	background-color: #fdf6f4;
}

/* Quantity + add to cart row. */
body.single-product div.product .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 12px;
	width: 100%;
}

body.single-product div.product .woocommerce-variation-add-to-cart .tsai-fields {
	flex: 1 0 100%;
}

body.single-product div.product form.cart .quantity input {
	width: 68px;
	height: 46px;
	border: 1px solid rgba(30, 29, 25, 0.18);
	border-radius: 8px;
	background: #fffdf8;
	color: #1e1d19;
	font-size: 14px;
	text-align: center;
}

body.single-product div.product form.cart .single_add_to_cart_button {
	min-height: 46px;
	padding: 12px 28px;
	border: 0;
	border-radius: 8px;
	background: #1e1d19;
	color: #f7f1e7;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

body.single-product div.product form.cart .single_add_to_cart_button:hover {
	background: #8a6a39;
}

body.single-product div.product form.cart .single_add_to_cart_button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Variation price/availability line once a choice is made. */
body.single-product div.product .woocommerce-variation.single_variation {
	margin: 2px 0 14px;
	color: #6f685c;
	font-size: 13px;
}

body.single-product div.product .woocommerce-variation.single_variation .price {
	display: block;
	margin-bottom: 4px;
	color: #8a6a39;
	font-size: 20px;
	font-weight: 600;
}

@media (max-width: 480px) {
	body.single-product div.product .woocommerce-variation-add-to-cart {
		align-items: stretch;
	}

	body.single-product div.product form.cart .single_add_to_cart_button {
		flex: 1 1 auto;
	}
}

/* Phones: 16px fields. iOS Safari zooms the page in when a smaller field is
   focused, and stays zoomed afterwards. */
@media (max-width: 782px) {
	body.single-product div.product table.variations select,
	.tsai-field input[type="text"],
	.tsai-field textarea,
	body.single-product div.product form.cart .quantity input {
		font-size: 16px;
	}
}
