/* Mp-rm */
.mprm-container {

	.mprm-header + .mprm-page-template-items {
		margin-top: 0;
	}

	&[class*="mprm-taxonomy-items-"] {
		.mprm-header.with-image{
			margin-bottom: 70px;
			&:before {
				background: rgba(0, 0, 0, 0.4);
			}

			.position-fullwidth & {
				position: relative;
				width: 100vw;
				left: 50%;
				transform: translateX(-50%);
			}
		}

		// old taxonomy page style
		.row {
			@include media-breakpoint-up(xl, $grid-breakpoints-old) {
				margin-left: - $grid-gutter-width;
				margin-right: - $grid-gutter-width;
			}

			.mprm-col {
				padding-bottom: 35px;
				position: relative;
				& + .mprm-col {
					&:before {
						content: '';
						position: absolute;
						top: 0;
						left: $grid-gutter-width/2;
						right: $grid-gutter-width/2;
						border-bottom: 1px solid $color__background-hr;
						@include media-breakpoint-up(xl, $grid-breakpoints-old) {
							left: $grid-gutter-width;
							right: $grid-gutter-width;
						}
					}
				}

				&:not(:first-child){
					padding-top: 35px;
				}
				@include media-breakpoint-up(md) {
					&:nth-child(2){
						padding-top: 0;
						&:before {
							content: none;
						}
					}
					&:nth-child(odd){
						border-right: 1px solid $color__background-hr;
					}
				}
				@include media-breakpoint-up(xl, $grid-breakpoints-old) {
					padding-left: $grid-gutter-width;
					padding-right: $grid-gutter-width;
				}
			}
		}

		&.mprm-taxonomy-items-list {
			.mprm-image {
				@media ( max-width: 768px ) {
					margin-bottom: 2em;
				}
			}
		}

		&.mprm-taxonomy-items-list,
		&.mprm-taxonomy-items-grid {
			.mprm-header-wrap .mprm-item-title {
				padding-left: 5px;
				padding-right: 5px;
			}
		}

		&.mprm-taxonomy-items-grid {
			> .mprm-row {
				display: flex;
				flex-wrap: wrap;
				padding-bottom: 0;
				margin-left: - $grid-gutter-width/2;
				margin-right: - $grid-gutter-width/2;
				@include media-breakpoint-up(xl, $grid-breakpoints-old) {
					margin-left: - $grid-gutter-width;
					margin-right: - $grid-gutter-width;
				}
				&:after {
					content: none;
				}

				> .mprm-columns {
					float: none;
					/*rtl:ignore*/
					margin-left: 0;
					flex: 0 0 100%;
					width: 100%;
					position: relative;
					margin-bottom: 0;
					padding: 35px $grid-gutter-width/2;
					@include media-breakpoint-up(xl, $grid-breakpoints-old) {
						padding: 35px $grid-gutter-width;
					}
					&:before {
						content: '';
						position: absolute;
						top: 0;
						left: $grid-gutter-width/2;
						right: $grid-gutter-width/2;
						border-bottom: 1px solid $color__background-hr;
						@include media-breakpoint-up(xl, $grid-breakpoints-old) {
							left: $grid-gutter-width;
							right: $grid-gutter-width;
						}
					}

					&.mprm-four {
						@include media-breakpoint-up(md) {
							flex: 0 0 33.33%;
							width: 33.33%;

							&:not(:nth-child(3)) {
								border-right: 1px solid $color__background-hr;
							}
						}
					}
				}
			}

			>.mprm-header + .mprm-row,
			>.mprm-row:first-child {
				> .mprm-columns {
					&:first-child {
						padding-top: 0;
						&:before {
							content: none;
						}
					}
				}

				> .mprm-four:nth-child(-n + 3) {
					@include media-breakpoint-up(md) {
						padding-top: 0;
						&:before {
							content: none;
						}
					}
				}
			}
		}
	}

	&.mprm-shortcode-items,
	&[class*="mprm-taxonomy-items-"],
	&.mprm-widget-items {
		.mprm {
			&-row {
				padding-bottom: 60px;
				&:last-child {
					padding-bottom: 20px;
				}
			}

			&-header-wrap,
			&-main-cnt-wrap {
				display: flex;
				justify-content: space-between;
				@include grid-indent(5px);
			}

			&-header-wrap {
				.mprm-title,
				.mprm-item-title {
					flex: 1 1 75%;
					margin-bottom: 0;
				}
			}

			&-title {
				a {
					color: inherit;
				}
				&.mprm-content-container {
					a {
						font-weight: inherit;
					}
				}
			}
			&-excerpt,
			&-proportions,
			&-ingredients {
				@include font-size(.875);
			}
			&-proportion {
				display: inline-block;
				&:not(:last-child) {
					margin-right: 4px;
				}
			}

			&-image-wrap {
				position: relative;

				a + .mprm-tags,
				img + .mprm-tags {
					position: absolute;
					top: 20px;
					left: 20px;
				}
			}

			&-tags {
				a {
					width: 71px;
					height: 71px;
					line-height: 71px;
					@include font-size(1);
					padding: 1px;
					border-radius: 50%;
					margin: 0 10px 10px 0;
					display: inline-block;
					vertical-align: middle;
					text-align: center;
					overflow: hidden;
					z-index: 1;

					span {
						vertical-align: middle;
						line-height: 16px;
						display: inline-block;
					}
					&:hover {
						box-shadow: 0 0 0 0;
					}
				}
			}
		}
	}

	&.mprm-shortcode-items,
	&[class*="mprm-taxonomy-items-"] .mprm-container,
	&.mprm-widget-items {

		&[class*="mprm-view-"] {
			.mprm-header.with-image .mprm-header-content {
				background: rgba(0, 0, 0, 0.4);
			}
		}

		&.mprm-view-grid {
			.mprm-image {
				/*rtl:ignore*/
				margin-right: 0;
			}
		}

		&.mprm-view-list {

			.mprm-row {
				display: flex;
				flex-wrap: wrap;
				padding-bottom: 0;
				margin-left: - $grid-gutter-width/2;
				margin-right: - $grid-gutter-width/2;
				@include media-breakpoint-up(xl, $grid-breakpoints-old) {
					margin-left: - $grid-gutter-width;
					margin-right: - $grid-gutter-width;
				}
				&:after {
					content: none;
				}

				> .mprm-columns {
					float: none;
					/*rtl:ignore*/
					margin-left: 0;
					flex: 0 0 100%;
					width: 100%;
					position: relative;
					margin-bottom: 0;
					padding: 35px $grid-gutter-width/2;
					@include media-breakpoint-up(xl, $grid-breakpoints-old) {
						padding: 35px $grid-gutter-width;
					}
					&:before {
						content: '';
						position: absolute;
						top: 0;
						left: $grid-gutter-width/2;
						right: $grid-gutter-width/2;
						border-bottom: 1px solid $color__background-hr;
						@include media-breakpoint-up(xl, $grid-breakpoints-old) {
							left: $grid-gutter-width;
							right: $grid-gutter-width;
						}
					}

					&.mprm-six {
						@include media-breakpoint-up(md) {
							flex: 0 0 50%;
							width: 50%;

							&:not(:nth-child(2)) {
								border-right: 1px solid $color__background-hr;
							}
						}
					}
					&.mprm-four {
						@include media-breakpoint-up(md) {
							flex: 0 0 33.33%;
							width: 33.33%;

							&:not(:nth-child(3)) {
								border-right: 1px solid $color__background-hr;
							}
						}
					}
					&.mprm-three {
						@include media-breakpoint-between(md, lg) {
							flex: 0 0 50%;
							width: 50%;

							&:not(:nth-child(2)) {
								border-right: 1px solid $color__background-hr;
							}
						}
						@include media-breakpoint-up(xl, $grid-breakpoints-old) {
							flex: 0 0 25%;
							width: 25%;

							&:not(:nth-child(4)) {
								border-right: 1px solid $color__background-hr;
							}
						}
					}
					&.mprm-two {
						@include media-breakpoint-between(md, lg) {
							flex: 0 0 50%;
							width: 50%;

							&:not(:nth-child(2)) {
								border-right: 1px solid $color__background-hr;
							}
						}
						@include media-breakpoint-up(xl, $grid-breakpoints-old) {
							flex: 0 0 16.66%;
							max-width: 16.66%;

							&:not(:nth-child(6)) {
								border-right: 1px solid $color__background-hr;
							}
						}
					}
				}
			}

			.mprm-header.with-image + .mprm-row,
			.mprm-taxonomy-title + .mprm-row,
			.mprm-row:first-child {
				> .mprm-columns {
					&:first-child {
						padding-top: 0;
						&:before {
							content: none;
						}
					}
				}

				> .mprm-six:nth-child(2),
				> .mprm-four:nth-child(-n + 3) {
					@include media-breakpoint-up(md) {
						padding-top: 0;
						&:before {
							content: none;
						}
					}
				}
				> .mprm-three:nth-child(2),
				> .mprm-two:nth-child(2) {
					@include media-breakpoint-between(md, lg) {
						padding-top: 0;
						&:before {
							content: none;
						}
					}
				}
				> .mprm-three:nth-child(-n + 4),
				> .mprm-two:nth-child(-n + 5) {
					@include media-breakpoint-up(xl, $grid-breakpoints-old) {
						padding-top: 0;
						&:before {
							content: none;
						}
					}
				}
			}
		}
		&.mprm-view-simple-list {
			.type-mp_menu_item {
				.mprm-flex-container-simple-view {
					&.mprm-after_title {
						.mprm-flex-item:first-child {
							margin-right: 10px;
						}
					}
					&.mprm-right {
						.mprm-flex-item.mprm-dots {
							display: block;
						}
					}
				}

			}
		}
	}

	&.mprm-shortcode-categories,
	&.mprm-widget-categories {
		margin: 0;

		&.mprm-view-grid,
		&.mprm-view-list {
			.mprm-menu-category .mprm-link .mprm-category-content .mprm-category-description {
				line-height: 1.5;
				@include font-size(.875);
			}
		}

		.tm_pb_tab & {
			margin-top: 11px;
		}

		.mprm-menu-category {

			&.mprm-effect-hover {

				&:hover {
					&:before {
						transform: scale(1.15);
					}
				}

				.mprm-effect-hover {
					display: none;
				}
			}
		}
		&.mprm-view-grid {
			.mprm-menu-category {
				.mprm-link {
					display: block;

					.mprm-category-content {
						padding: 0;
						min-height: 480px;
						display: flex;
						flex-direction: column;
						justify-content: center;
						background: rgba(0, 0, 0, .4);



						.mprm-title,
						.mprm-category-description {
							text-align: center;
							margin: 0;

							&:not(:empty) {
								padding: 20px;
							}
						}
						.mprm-title {
							& + .mprm-category-description {
								padding-top: 0;
							}
						}
						.mprm-category-description {
							padding-bottom: 20px;

							#tm_builder_outer_content .tm_pb_tab & {
								padding-bottom: 20px;
							}
						}
					}
				}
			}
		}
		&.mprm-view-list {
			&.mprm-columns-count-1 {
				.mprm-row {
					padding-bottom: 0;
					&:after {
						content: none;
					}

					&:nth-child(even) {
						.mprm-category-content {
							@include media-breakpoint-up(md) {
								order: -1;
							}
						}
					}
					> .mprm-menu-category {
						display: flex;
						flex-wrap: wrap;
						margin: 0;
						> * {
							flex: 0 0 100%;
							max-width: 100%;
							width: 100%;
							margin: 0;
							@include media-breakpoint-up(md) {
								flex: 0 0 50%;
								max-width: 50%;
								width: 50%;
							}
						}
						.mprm-columns {
							margin: 0;
						}
						.mprm-category-content {
							text-align: center;
							padding: 50px 25px;
							display: flex;
							flex-direction: column;
							justify-content: center;
							align-items: center;
							@include media-breakpoint-up(md) {
								padding: 25px;
							}
							@include media-breakpoint-up(lg) {
								min-height: 650px;
							}

							.tm_pb_row_fullwidth & {
								@include media-breakpoint-up(lg) {
									padding: 50px;
								}
							}
						}
						.mprm-category-image-wrap {
							position: relative;

							.mprm-link {
								@include media-breakpoint-up(md) {
									position: absolute;
									top: 0;
									left: 0;
									bottom: 0;
									right: 0;

									> img {
										object-fit: cover;
										object-position: center;
										width: 100%;
										height: 100%;

										.ie & {
											// Fallback to ie ( polyfill: object-fit-images - ofi.js )
											font-family: 'object-fit: cover; object-position: center';
										}

										#tm_builder_outer_content & {
											height: 100%;
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	&.mprm-widget-categories {
		.mprm-title {
			@include font-size(1.875);
		}
	}
}

.mprm-main-wrapper .mprm-taxonomy-items-list > .mp-menu-item {
	.mprm-side.mprm-left-side {
		margin-bottom: 0;
	}

	.mprm-content.mprm-seven {
		@media ( min-width: 769px ) {
			margin-left: 4%;
		}
	}
}

// Single style
.single {
	.mprm-main-wrapper.mp_menu_item {
		.content-wrapper {
			margin-top: 0;

			.mprm-content{
				.mprm-item-gallery {
					> a {
						margin: 0;
						width: 33.33%;
						img {
							width: 100%;
						}
						&:focus{
							outline: 0;
						}
					}
				}
			}

			.mprm-sidebar{
				@include font-size(.875);
				line-height: 1.7;

				.mprm-title {
					margin-bottom: 1em;
				}
				> * {
					margin-bottom: 60px;
					& + * {
						padding-top: 60px;
						border-top: 1px solid $color__background-hr;
					}
				}
				.mprm-ingredients .mprm-ingredients-delimiter {
					display: inline;
				}

				.mprm-related-items {
					.mprm-related-items-list {
						.mprm-related-item {
							display: flex;
							align-items: flex-start;
							@include grid-indent(5px);
							&:not(:last-child) {
								margin-bottom: 35px;
							}
							img {
								max-width: 120px;
							}
							.mprm-related-title {
								flex: 1 1 auto;
							}
						}
					}
				}
			}
		}

		.mprm {
			&-image-wrap,
			&-title,
			&-post-content,
			&-item-gallery{
				margin-bottom: 35px;
			}

			&-sidebar {
				position: relative;
				@include media-breakpoint-up(lg) {
					&:before {
						left: 0;
						position: absolute;
						width: 1px;
						height: calc( 100% - 60px );
						content: '';
						background: $color__background-hr;
						top: 0;
					}
				}
				@include media-breakpoint-up(xl, $grid-breakpoints-old) {
					padding-left: $grid-gutter-width * 1.5;
					&:before {
						left: 25px;
					}
				}
			}
		}
		.share-btns__list {
			margin-top: 55px;
			margin-bottom: 35px;
		}
		.comments-area {
			margin-top: 60px;
		}
	}
}

/* Gallery item pop-up */
.mprm-item-gallery a {
	display: block;
	position: relative;
	cursor: zoom-in;
	&:before {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		opacity: 0;
		transition: all 0.4s ease-out;
		content: '';
	}
	&:after {
		color: $color__white;
		@include linear-icon;
		display: block;
		position: absolute;
		top: 50%;
		left: 50%;
		content: '\e936';
		@include font-size(2.5);
		width: 2.5rem;
		height: 2.5rem;
		text-align: center;
		margin: -1.25rem 0 0 -1.25rem;
		transform: scale(0);
		transition: all 0.4s ease-out;
	}
	&:hover {
		&:before {
			opacity: 0.8;
		}
		&:after {
			transform: scale(1);
		}
	}
	&:focus {
		outline: 0;
	}
}

// FIX remove wp css native class 'hentry' mp-rm plugin.
.posts-list__item.mp_menu_item {
	.posts-list & {
		margin-bottom: 50px;
		@include media-breakpoint-up(lg) {
			margin-bottom: 63px;
		}
	}

	.posts-list--default & {
		margin-bottom: 50px;

		& + .posts-list__item.mp_menu_item {
			padding-top: 55px;
			border-top: 1px solid $color__background-hr;
		}
	}

	.posts-list--default.featured-image--small & {
		@include media-breakpoint-up(xl, $grid-breakpoints-old) {
			display: flex;
			align-items: flex-start;

			> .post-thumbnail,
			> .post-format-wrap {
				margin-right: 30px;
				flex: 0 0 418px;
				max-width: 418px;
				margin-top: 0;
				margin-bottom: 0;
			}
			> .post-list__item-content {
				flex: 0 1 100%;
			}
		}
	}

	.posts-list--default.featured-image--small.fullwidth & {
		@include media-breakpoint-up(lg) {
			display: flex;
			align-items: flex-start;

			> .post-thumbnail,
			> .post-format-wrap {
				margin-right: 30px;
				flex: 0 0 418px;
				max-width: 418px;
				margin-top: 0;
				margin-bottom: 0;
			}
			> .post-list__item-content {
				flex: 0 1 100%;
			}
		}
	}
}

// Buy button
.mprm_menu_item_buy_button {
	margin-top: 10px;

	.mprm-submit {
		&.mprm-inherit:not(.plain) {
			@include btn;
		}

		&.mprm-preloader-color {
			opacity: .5;
			pointer-events: none;
		}
	}

	.mprm-notice {
		&.mprm-notice-success {
			background: rgba($color__valid, .12);
		}
		&.mprm-notice-error {
			background: rgba($color__not-valid, .12);
		}

		&.mprm-notice-success,
		&.mprm-notice-error {
			padding: 5px 15px;
			border: none;
			@include font-size(.875);
			@include border-radius;
			font-style: italic;
			color: $color__dark;
		}
	}

}

/* mprm_cart_widget */
.widget_mprm_cart_widget {
	.mprm-cart-item {
		&.mprm_checkout a {
			@include btn;
		 }
	}
}

/* Checkout */
#mprm_checkout_cart {
	border: none;
	thead {
		th {
			background-color: transparent;
			text-align: center;
			text-transform: uppercase;
			@include font-size(.75);
			letter-spacing: .72px;
			border: none;
			padding-top: 30px;
			padding-bottom: 30px;
			&.mprm_cart_item_name {
				text-align: left;
				padding-left: 0;
			}
		}
	}
	tbody {
		tr {
			td {
				text-align: center;
				@include media-breakpoint-up(md) {
					padding-top: 15px;
					padding-bottom: 15px;
				}
				@include media-breakpoint-up(xl, $grid-breakpoints-old) {
					padding-top: 45px;
					padding-bottom: 45px;
				}
				&.mprm_cart_item_name {
					text-align: left;
				}
				&:first-child {
					border-left: none;
					padding-left: 0;
				}
				&:last-child {
					border-right: none;
				}

				&.mprm_cart_quantities {
					input[type="number"].mprm-item-quantity {
						text-align: center;
						padding-left: 5px;
						padding-right: 5px;
						@include media-breakpoint-up(lg) {
							min-width: 105px;
						}
					}
				}

				&.mprm_cart_item_price {
					@include media-breakpoint-up(md) {
						@include font-size(1.5);
					}
				}
			}
		}
	}
}

#mprm_purchase_form {
	fieldset {
		border-color: $color__border-table;
	}
	.mprm-table {
		tr {
			td {
				@include media-breakpoint-up(md) {
					padding: 25px 15px;
					&:first-child {
						text-align: right;
						width: 80%;
					}
				}
			}
			&:first-child {
				td {
					@include font-size(1.125);
				}
			}
			&.mprm-checkout-total  {
				td {
					@include font-size(1.5);

					span b {
						font-weight: inherit;
					}
				}
			}
		}
	}
}

#mprm-payment-mode-wrap {
	.mprm-gateway-option {
		font-size: 100%;
		font-weight: inherit;

		input {
			margin-right: 5px;
		}
	}
}

#mprm_checkout_wrap {
	label.mprm-label {
		@include font-size(.75);
		line-height: 2;
		padding-left: 10px;
		font-weight: inherit;
	}
	input[type="email"],
	input[type="text"] {
		width: 100%;
	}

	fieldset#mprm_purchase_submit #mprm_final_total_wrap {
		border: none;
		color: inherit;
		@include font-size(1.5);

		strong {
			font-weight: inherit;
		}
	}

	input {
		&.mprm-form-error {
			border-color: $color__not-valid;
		}
	}
}
#mprm_purchase_receipt,
#mprm_purchase_receipt_products,
#mprm_user_history {
	td, th {
		@include media-breakpoint-up(md) {
			padding: 25px 15px;
		}
	}
	td, th, strong {
		font-weight: inherit;
	}
}

#mprm_purchase_receipt_products,
#mprm_user_history {
	border: none;
	th{
		text-transform: uppercase;
		@include font-size(.75);
		letter-spacing: .72px;
		border: none;
	}
	td, th {
		&:not(:first-child) {
			text-align: center;
		}
	}
}

// Compatibility to power-builder
.mprm-container {
	.tm_pb_tab & {
		@include media-breakpoint-up(lg) {
			float: left;
			width: 50%;

			&:nth-child(odd) {
				padding-right: $grid-gutter-width / 2;
			}
			&:nth-child(even) {
				padding-left: $grid-gutter-width / 2;
			}
		}
		.mprm-row {
			padding-bottom: 0;
		}
	}

	&.mprm-shortcode-categories {
		.tm_pb_tab & {
			margin-top: 11px;
		}

		&.mprm-view-grid {
			.mprm-menu-category {
				.mprm-link {

					.mprm-category-content {

						.mprm-category-description {

							#tm_builder_outer_content .tm_pb_tab & {
								padding-bottom: 20px;
							}
						}
					}
				}
			}
		}
	}
}