/*
 * Casetti: the customer pages' frame (cart, checkout, account, the wishlist page: body.casetti-shop-frame, inc/site/cart.php)
 * as the live Astra pages: a grey page, the white box with the title inside it; WooCommerce's notices, buttons, tables and
 * form fields there (floating labels: assets/js/site/checkout.js adds .casetti-float / .is-filled); then the cart page
 * (table, totals, "Sepeti Temizle", swipe to remove on phones: assets/js/site/cart.js).
 * checkout.css and account.css build on this file.
 */

.casetti-shop-frame {
	--casetti-frame-line: #dddddd;          /* Astra's border colour on these pages */
	--casetti-frame-head: #fbfbfb;          /* table heads, box titles */
	--casetti-notice-bg: #f7f6f7;
	--casetti-notice-text: #515151;
	--casetti-field-text: #666666;
	--casetti-label-float: #4b4f58;
}

/* Frame */
.casetti-shop-frame .site-main {
	padding: 64px 20px;
	background: var(--myco-color-surface);
}

.casetti-shop-frame .page-entry {
	max-width: var(--myco-container);
	margin-inline: auto;
	padding: 85px 107px;
	background: var(--myco-color-bg);
}

.casetti-shop-frame .page-entry .page-hero,
.casetti-shop-frame .page-entry > .section {
	padding: 0;
	border: 0;
	background: none;
}

.casetti-shop-frame .page-entry .myco-container {
	width: auto;
	max-width: none;
}

.casetti-shop-frame .page-entry .page-hero h1 {
	margin: 0 0 24px;
	color: var(--casetti-ink);
	font: 500 30px/1.2 var(--casetti-font-heading);
	letter-spacing: normal;
}

.casetti-shop-frame .entry-content {
	display: flow-root; /* its first child's top margin stays inside (Astra's entry content) */
	color: var(--myco-color-muted);
	font-size: 16px;
	line-height: 1.857;
}

/* WooCommerce's classic-shortcode block is "alignwide": it stays inside the box here */
.casetti-shop-frame .entry-content > .alignwide {
	width: auto;
	margin-inline: 0;
	transform: none;
}

.casetti-shop-frame .entry-content a:not(.button) {
	color: #000;
}

.casetti-shop-frame .entry-content a:not(.button):hover {
	color: var(--myco-color-accent);
}

@media (max-width: 1199px) {
	.casetti-shop-frame .page-entry {
		padding: 54px 38px;
	}
}

@media (max-width: 767px) {
	.casetti-shop-frame .site-main {
		padding: 58px 8px;
	}

	.casetti-shop-frame .page-entry {
		padding: 22px 15px;
	}

	.casetti-shop-frame .page-entry .page-hero h1 {
		margin-bottom: 14px;
		font-size: 27px;
	}

	.casetti-shop-frame .entry-content {
		font-size: 14.6px;
	}
}

/* Notices: grey with a black line on top (Astra's), the button under the text on phones */
.casetti-shop-frame .woocommerce-message,
.casetti-shop-frame .woocommerce-info,
.casetti-shop-frame .woocommerce-error {
	margin: 0 0 2em;
	padding: 1em 2em 1em 3.5em;
	border-top: 3px solid #000;
	background-color: var(--casetti-notice-bg);
	color: var(--casetti-notice-text);
	font-size: inherit;
	line-height: inherit;
}

.casetti-shop-frame .woocommerce-message::before,
.casetti-shop-frame .woocommerce-info::before {
	color: #000;
}

.casetti-shop-frame .woocommerce-error {
	border-top-color: var(--myco-color-danger);
}

.casetti-shop-frame .woocommerce-message a:not(.button),
.casetti-shop-frame .woocommerce-info a:not(.button),
.casetti-shop-frame .woocommerce-error a:not(.button) {
	color: #000;
}

@media (max-width: 544px) {
	.casetti-shop-frame .woocommerce-message,
	.casetti-shop-frame .woocommerce-info,
	.casetti-shop-frame .woocommerce-error {
		display: flex;
		flex-wrap: wrap;
		padding: 1em 2em 1em 3.5em;
	}

	.casetti-shop-frame .woocommerce-message .button,
	.casetti-shop-frame .woocommerce-info .button,
	.casetti-shop-frame .woocommerce-error .button {
		order: 1;
		margin-top: 0.5em;
	}
}

/* Buttons: black, white text, Poppins in capitals (the live shop's WooCommerce buttons) */
.casetti-shop-frame .woocommerce :is(a, button, input).button,
.casetti-shop-frame .woocommerce :is(a, button, input).button.alt {
	display: inline-block;
	min-height: 0;
	padding: 13px 30px;
	border: 1px solid var(--casetti-ink);
	border-radius: 0;
	background: var(--casetti-ink);
	color: #fff;
	font: 600 16px/1 var(--casetti-font-heading);
	letter-spacing: 2px;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background var(--myco-transition), color var(--myco-transition);
}

@media (hover: hover) {
	.casetti-shop-frame .woocommerce :is(a, button, input).button:hover,
	.casetti-shop-frame .woocommerce :is(a, button, input).button.alt:hover {
		border-color: var(--casetti-ink);
		background: #fff;
		color: var(--casetti-ink);
	}
}

/* Disabled buttons (WooCommerce keeps them half transparent): the theme's disabled rules in layout.css are more specific. */
.casetti-shop-frame .woocommerce :is(a, button, input).button:is(.disabled, :disabled) {
	border-color: var(--casetti-ink) !important;
	background: var(--casetti-ink) !important;
	color: #fff !important;
}

@media (max-width: 767px) {
	.casetti-shop-frame .woocommerce :is(a, button, input).button {
		padding: 12px 32px;
		font-size: 14.6px;
	}
}

/* Tables (Astra's: a light head, lines between rows) */
.casetti-shop-frame .woocommerce table.shop_table {
	border: 1px solid var(--casetti-frame-line);
	border-radius: 0;
	border-collapse: separate;
}

.casetti-shop-frame .woocommerce table.shop_table thead {
	background-color: var(--casetti-frame-head);
}

.casetti-shop-frame .woocommerce table.shop_table th {
	color: var(--casetti-ink);
	font-weight: 700;
}

.casetti-shop-frame .woocommerce table.shop_table td,
.casetti-shop-frame .woocommerce table.shop_table th {
	padding: 0.7em 1em;
	border-bottom-width: 0;
	border-color: var(--casetti-frame-line);
}

.casetti-shop-frame .woocommerce table.shop_table thead th {
	border-width: 0;
}

.casetti-shop-frame .woocommerce table.shop_table td {
	border-top: 1px solid var(--casetti-frame-line);
}

.casetti-shop-frame .woocommerce table.shop_table tfoot th,
.casetti-shop-frame .woocommerce table.shop_table tfoot td {
	font-weight: 500;
}

.casetti-shop-frame .woocommerce table.shop_table .woocommerce-Price-amount {
	font-weight: 400;
}

/* Form fields: Astra's "modern" fields; with JavaScript the label sits inside the field and shows small once it holds a
   value (checkout.js). */
.casetti-shop-frame .woocommerce form .form-row {
	margin: 0 0 6px;
	padding: 3px;
}

.casetti-shop-frame .woocommerce form .form-row label {
	color: var(--myco-color-muted);
	font-size: 14.4px;
	font-weight: 700;
	line-height: 2;
}

.casetti-shop-frame .woocommerce form .form-row .required {
	visibility: visible;
	color: #e2401c;
	font-weight: 700;
	text-decoration: none;
}

.casetti-shop-frame .woocommerce form .form-row :is(input.input-text, textarea, select),
.casetti-shop-frame .woocommerce form .form-row .select2-container--default .select2-selection--single {
	min-height: 0;
	padding: 0.9em 0.8em;
	border: 1px solid var(--casetti-frame-line);
	border-radius: 4px;
	background-color: #fff;
	color: var(--casetti-field-text);
	font-size: 14px;
	line-height: 1;
	box-shadow: none;
}

.casetti-shop-frame .woocommerce form .form-row textarea {
	min-height: 7em;
	line-height: 1.5;
}

.casetti-shop-frame .woocommerce form .form-row .select2-container--default .select2-selection--single {
	height: auto;
	padding-right: 2em;
}

.casetti-shop-frame .woocommerce form .form-row .select2-container--default .select2-selection--single .select2-selection__rendered {
	padding: 0;
	color: var(--casetti-field-text);
	line-height: 1.35;
}

.casetti-shop-frame .woocommerce form .form-row .select2-container--default .select2-selection--single .select2-selection__arrow {
	top: 50%;
	width: 1.7em;
	transform: translateY(-50%);
}

.casetti-shop-frame .woocommerce form .form-row :is(input.input-text, textarea, select):focus {
	border-color: var(--casetti-ink);
}

.casetti-shop-frame .woocommerce form .form-row.woocommerce-invalid :is(input.input-text, select),
.casetti-shop-frame .woocommerce form .form-row.woocommerce-invalid .select2-selection--single {
	border-color: #d65d67;
}

.casetti-shop-frame .woocommerce form .form-row .description {
	color: #777;
	font-size: 12px;
	line-height: 1.4;
}

.casetti-shop-frame .woocommerce form .form-row.casetti-float {
	position: relative;
}

.casetti-shop-frame .woocommerce form .form-row.casetti-float > label:not(.checkbox, .woocommerce-form__label-for-checkbox, .screen-reader-text) {
	position: absolute;
	z-index: 1;
	top: 3px;
	left: 3px;
	max-width: 95%;
	margin: 0.35em 0 0;
	padding: 0 1.1em;
	overflow: hidden;
	color: var(--casetti-label-float);
	font-size: 11.2px;
	font-weight: 400;
	line-height: 1.625;
	white-space: nowrap;
	text-overflow: ellipsis;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease-out;
}

.casetti-shop-frame .woocommerce form .form-row.casetti-float.is-filled > label {
	opacity: 1;
}

.casetti-shop-frame .woocommerce form .form-row.casetti-float.is-filled :is(input.input-text, textarea, select),
.casetti-shop-frame .woocommerce form .form-row.casetti-float.is-filled .select2-container--default .select2-selection--single {
	padding: 1.45em 0.8em 0.35em;
}

.casetti-shop-frame .woocommerce form .form-row.casetti-float.is-filled textarea {
	padding-top: 1.9em;
}

.casetti-shop-frame .woocommerce form .form-row :is(input.input-text, textarea)::placeholder {
	color: var(--casetti-field-text);
	opacity: 1;
}

.casetti-shop-frame .woocommerce form .form-row .password-input .show-password-input {
	top: 50%;
	right: 0.7em;
	color: #9a9a9a;
	transform: translateY(-50%);
}

.casetti-shop-frame .woocommerce form .form-row input.input-text[type="password"] {
	padding-right: 45px;
}

@media (prefers-reduced-motion: reduce) {
	.casetti-shop-frame .woocommerce form .form-row.casetti-float > label {
		transition: none;
	}
}

/* Cart: the table */
.woocommerce-cart .woocommerce table.cart .product-thumbnail img {
	width: auto;
	max-width: 70px;
	height: auto;
}

.woocommerce-cart .woocommerce table.cart td {
	vertical-align: middle;
}

.woocommerce-cart .woocommerce table.cart .product-name a {
	color: #000;
	text-decoration: none;
}

.woocommerce-cart .woocommerce table.cart .product-name a:hover {
	color: var(--myco-color-accent);
}

.woocommerce-cart .woocommerce table.cart td.product-remove {
	text-align: center;
}

.woocommerce-cart .woocommerce a.remove {
	position: relative;
	display: inline-block;
	width: 20px;
	height: 20px;
	border-radius: 100%;
	color: #4b4f58 !important; /* WooCommerce colours the cross with !important (red) */
	font: 400 18px/21px system-ui, sans-serif;
	text-align: center;
	vertical-align: middle;
	text-decoration: none;
}

.woocommerce-cart .woocommerce a.remove::before {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid #4b4f58;
	border-radius: 100%;
}

.woocommerce-cart .woocommerce a.remove:hover {
	background: transparent;
	color: #000 !important;
}

.woocommerce-cart .woocommerce a.remove:hover::before {
	border-color: #000;
}

/* Cart: the actions row (coupon left; update and "Sepeti Temizle" right) */
.woocommerce-cart .woocommerce table.cart td.actions {
	text-align: right;
}

.woocommerce-cart .woocommerce table.cart td.actions .coupon {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 5px 0;
}

.woocommerce-cart .woocommerce table.cart td.actions .coupon .input-text {
	width: auto;
	min-width: 9em;
	min-height: 0;
	padding: 0.5em 0.75em;
	border: 1px solid var(--casetti-frame-line);
	border-radius: 0;
	font-size: 14px;
	line-height: 1.5;
}

.woocommerce-cart .woocommerce table.cart td.actions .button {
	margin: 5px 0 5px 5px;
	padding: 0.5em 1em;
	font-size: 14px;
	line-height: 1.5;
}

.woocommerce-cart .woocommerce table.cart td.actions .coupon .button {
	margin: 0;
}

/* Cart: totals and cross-sells in boxes with a title band */
.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce-cart .cart-collaterals .cross-sells {
	margin-bottom: 2em;
	padding: 0 20px;
	border: 1px solid var(--casetti-frame-line);
}

.woocommerce-cart .cart-collaterals .cart_totals > h2,
.woocommerce-cart .cart-collaterals .cross-sells > h2 {
	margin: 0 -20px 20px;
	padding: 0.7em 1em;
	border-bottom: 1px solid var(--casetti-frame-line);
	background-color: var(--casetti-frame-head);
	color: var(--casetti-ink);
	font: 700 1.2rem/1.4 var(--casetti-font-heading);
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table {
	margin: 0 0 6px;
	border: 0;
}

.woocommerce-cart .cart-collaterals .cart_totals table th {
	width: 40%;
}

.woocommerce-cart .cart-collaterals .cart_totals table :is(th, td) {
	padding-inline: 0 1em;
	border-top: 1px solid var(--casetti-frame-line);
	vertical-align: top;
	line-height: 1.5;
}

.woocommerce-cart .cart-collaterals .cart_totals table tr:first-child :is(th, td) {
	border-top: 0;
}

.woocommerce-cart .woocommerce .wc-proceed-to-checkout {
	padding: 1em 0;
}

.woocommerce-cart .woocommerce .wc-proceed-to-checkout a.checkout-button {
	display: block;
	margin-bottom: 1em;
	padding: 1em;
	font-size: 17.6px;
	line-height: 1.8;
}

.woocommerce-cart ul#shipping_method li {
	margin: 0;
	padding: 0.25em 0 0.25em 22px;
	text-indent: -22px;
	list-style: none;
}

.woocommerce-cart .woocommerce-shipping-calculator .button {
	width: 100%;
}

/* The empty cart / wishlist: the notice and the button under it */
.casetti-shop-frame .woocommerce .cart-empty {
	margin-bottom: 2em;
}

.casetti-shop-frame .return-to-shop {
	margin: 0;
}

.woocommerce-cart .casetti-swipe__layer {
	display: none;
}

@media (max-width: 921px) {
	.woocommerce-cart .cart-collaterals .cart_totals,
	.woocommerce-cart .cart-collaterals .cross-sells {
		width: 100%;
		float: none;
	}
}

@media (max-width: 767px) {
	/* The product picture stays on phones, centred above the row's lines (Astra's) */
	.woocommerce-cart .woocommerce table.cart td.product-thumbnail {
		display: block;
	}

	.woocommerce-cart .woocommerce table.cart td.product-thumbnail img {
		margin-inline: auto;
	}

	.woocommerce-cart .woocommerce table.cart td.product-thumbnail::before {
		display: none;
	}

	.woocommerce-cart .woocommerce table.cart td.actions {
		text-align: left;
	}

	.woocommerce-cart .woocommerce table.cart td.actions .coupon .input-text {
		flex: 1 1 auto;
		min-width: 0;
	}

	.woocommerce-cart .woocommerce table.cart td.actions > .button {
		display: block;
		width: 100%;
		margin: 10px 0 0;
	}

	/* Swipe to remove (cart.js): the row's cells slide over a red "Sil" layer */
	.woocommerce-cart tr.casetti-swipe {
		position: relative;
		overflow: hidden;
	}

	.woocommerce-cart .woocommerce table.shop_table tr.casetti-swipe > td {
		position: relative;
		z-index: 2;
		background: var(--myco-color-bg); /* opaque over the red layer (WooCommerce tints even rows with a transparent grey) */
	}

	.woocommerce-cart .woocommerce table.shop_table tr.casetti-swipe:nth-child(2n) > td {
		background: var(--myco-color-surface);
	}

	.woocommerce-cart .casetti-swipe__layer {
		position: absolute;
		z-index: 1;
		top: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 120px;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: #c0392b;
		color: #fff;
		font-size: 15px;
		font-weight: 600;
		letter-spacing: 0.04em;
	}
}
