// 1 - HELPERS
@import '1-helpers/mixins';
@import '1-helpers/functions';
@import '1-helpers/variables';


.rtl {

	// tables
	th, td {
		text-align: right;
	}

	// menu
	// [class*="header-menu"] {
	// 	&[data-type="type-1"] > ul > li {
	// 		&:first-child > a {
	// 			padding-right: 0;
	// 			padding-left: calc(var(--menuItemsSpacing) / 2);
	// 		}

	// 		&:last-child > a {
	// 			padding-left: 0;
	// 			padding-right: calc(var(--menuItemsSpacing) / 2);
	// 		}
	// 	}
	// }

	.menu > [data-submenu='right'] > .sub-menu {
		left: initial;
		right: calc(var(--menuItemsSpacing) / 2 - 20px);
	}

	.menu > [data-submenu='left'] > .sub-menu {
		right: initial;
		left: calc(var(--menuItemsSpacing) / 2 - 20px);
	}

	.child-indicator {
		// margin: 0 5px 0 0;
	}

	// menu type 1
	// [data-menu*="type-1"] > ul > li {
		
	// 	&:first-child > a {
	// 		padding-left: calc(var(--menu-items-spacing, 25px) / 2);
	// 	}

	// 	&:last-child > a {
	// 		padding-right: calc(var(--menu-items-spacing, 25px) / 2);
	// 	}
	// }


	// mobile menu
	.mobile-menu[data-type*="type-1"] ul [class*="children"] > ul {
		li a:before {
			left: initial;
			right: -30px;
		}
	}

	.mobile-menu[data-type*="type-2"] ul [class*="children"] > ul {
		li a:before {
			left: initial;
			right: -20px;
		}
	}


	// advanced menu
	.menu > [class*='ct-mega-menu'] {
		> .sub-menu > li {
			&:first-child {
				border-right: none;
			}

			&:not(:last-child) {
				border-left: var(--dropdown-columns-divider);
			}
		}
	}

	// entry button
	.entry-button svg {
		// margin-left: initial;
		// margin-right: 10px;
		transform: rotate(180deg);
	}

	// trending block
	.ct-trending-block {

		.ct-arrow-left:before {
			transform: rotate(135deg)
		}

		.ct-arrow-right:before {
			transform: rotate(-45deg);
		}
	}


	// search form
	.search-form button {
		right: initial;
		left: 0;
	}

	.ct-search-results {
		.ct-image-container {
			margin-right: initial;
			margin-left: var(--image-spacing);
		}
	}


	// close button
	.close-button {
		right: initial;
		left: -10px;
	}

	// posts nav
	.post-navigation {

		.nav-item-prev {
			figure {
				margin-left: var(--thumb-margin, 25px);
				margin-right: initial;
			}

			svg {
				transform: rotate(-180deg);
			}
		}

		.nav-item-next {
			text-align: left;

			figure {
				margin-left: initial;
				margin-right: var(--thumb-margin, 25px);
			}

			svg {
				transform: rotate(-180deg);
			}
		}
	}

	// quote widget
	.ct-quote-widget:before {
		left: initial;
		right: 35px;
		transform: rotate(0deg);
	}

	// comments
	.ct-comment-meta figure {
		left: initial;
		right: 0;
	}
	// .ct-comments {
	// 	li:not(.pingback) {
	// 		@include media-breakpoint-up (md) {
	// 			.ct-comment-content,
	// 			.ct-comment-info section {
	// 				padding-left: initial;
	// 				padding-right: 70px;
	// 			}
	// 		}
	// 	}
	// }

	// .ct-comment-info figure {
	// 	@include media-breakpoint-down(sm) {
	// 		margin-right: initial;
	// 		margin-left: 15px;
	// 	}

	// 	@include media-breakpoint-up(md) {
	// 		left: initial;
	// 		right: 0;
	// 	}
	// }

	// .comment-reply-link {
	// 	@include media-breakpoint-down(sm) {
	// 		margin-left: initial;
	// 		margin-right: auto;
	// 	}

	// 	@include media-breakpoint-up(md) {
	// 		margin-left: initial;
	// 		margin-right: 20px;
	// 	}
	// }

	// .ct-comment-list .comment-respond {
	// 	@include media-breakpoint-up(md) {
	// 		padding-left: initial;
	// 		padding-right: 70px;
	// 	}
	// }
	
	.comment-form {
		--labels-offset: -20px;
	}

	// checkbox & radiobox
	input[type="radio"],
	input[type="checkbox"] {
		margin: 0 0 0 0.5em;
	}

	.woocommerce-shipping-totals input[type="radio"] {
		margin: 0 0.7em 0 0;
	}

	// select
	select {
		padding: var(--has-classic-forms, var(--form-field-padding, 0 12px));
		padding-left: 25px;
		background-position: left 10px top 50%, 0 0;
	}

	.select2-container .select2-selection--single .select2-selection__rendered {
		padding: var(--has-classic-forms, var(--form-field-padding, 0 12px));
	}

	.select2-results__options {
		margin: 0;
	}


	// drop cap
	.has-drop-cap:not(:focus):first-letter {
		margin: 0.1em 0 0.05em .12em;
	}
	

	// entry meta
	.entry-meta {

		li {
			margin-right: initial;
			margin-left: var(--itemsSpacing);

			&:after {
				margin-left: initial;
				margin-right: var(--itemsSpacing);
			}

			> span {
				margin-right: initial;
				margin-left: 5px;
			}
		}

		[class*="ct-image-container"] {
			margin-left: 10px;
			margin-right: initial;
		}

		svg {
			mrgin-right: initial;
			margin-left: 7px;
		}
	}


	// entry tags
	.entry-tags a:not(:last-child) {
		margin-right: initial;
		margin-left: 10px;
	}

	// post edit link
	.post-edit-link:before {
		margin-right: initial;
		margin-left: 5px;
	}

	// breadcrumbs
	.ct-breadcrumbs {
		svg.separator {
			transform: rotate(180deg);
		}
	}

	// contact info
	.ct-contact-info ul li {
		margin-right: 0;

		&:not(:last-child) {
			margin-left: var(--items-spacing, 15px);
		}
	}

	// footer
	.ct-footer {
		[data-divider="columns"] {
			@include media-breakpoint-up (lg) {
				> *:not(:last-child):after {
					right: initial;
					left: calc(var(--itemsGap) / 2 * -1);
				}
			}
		}
	}

	// pagination
	.ct-pagination {
		.next svg {
			margin-left: initial;
			margin-right: 8px;
			transform: rotate(180deg);
		}

		.prev svg {
			margin-right: initial;
			margin-left: 8px;
			transform: rotate(180deg);
		}
	}

	.ct-pagination[data-type="next_prev"] .next {
		float: left;
	}

	// sidebar
	@include media-breakpoint-up (lg) {
		[data-sidebar="right"] {
			[data-type="type-3"],
			[data-type="type-4"] {
				padding-left: initial;
				padding-right: var(--sidebar-inner-spacing, 35px);

				&:after {
					left: initial;
					right: 0;
				}
			}

			[data-type="type-4"] {
				&:after {
					right: 0;
					left: calc(-50vw + (5000% / var(--sidebar-width-no-unit, 27)));
				}
			}
		}

		[data-sidebar="left"] {
			[data-type="type-3"],
			[data-type="type-4"] {
				padding-right: initial;
				padding-left: var(--sidebar-inner-spacing, 35px);

				&:after {
					right: initial;
					left: 0;
				}
			}

			[data-type="type-4"] {
				&:after {
					left: 0;
					right: calc(-50vw + (5000% / var(--sidebar-width-no-unit, 27)));
				}
			}
		}
	}


	// offcanvas panel
	.ct-panel-actions {
		.close-button {
			margin-left: initial;
			margin-right: auto;
		}
	}


	// WooCommerce

	// slider
	[data-products="type-2"] .ct-woo-card-actions .price:after {
		right: initial;
		left: 0;
	}

	.products .ct-woo-card-extra {
		right: initial;
		left: 15px;
	}

	.flexy-items,
	.flexy-pills [data-flexy] {
		direction: ltr;
	}

	@include media-breakpoint-up (md) {
		.thumbs-left {
			
			.woocommerce-product-gallery {
				.flexy {
					margin-left: initial;
					margin-right: calc(var(--thumbs-width) + var(--thumbs-spacing, 15px));
				}

				.flexy-pills {
					left: initial;
					right: 0;

					ol {
						margin-right: 0;
						padding-right: 0;
					}
				}
			}
		}
	}

	.ct-default-gallery, 
	.ct-stacked-gallery {
		.entry-summary {
			@include media-breakpoint-up (lg) {
				padding-left: initial;
				padding-right: 40px;
			}
		}
	}

	.product[class*="top-gallery"] {
		.entry-summary section:last-child {
			@include media-breakpoint-up (lg) {
				border-left: 0;
				border-right: 1px solid var(--border-color);
			}
		}
	}

	[class*="add_to_cart_button"].loading:after {
		margin-left: initial;
		margin-right: 10px;
	}

	// cart actions
	.quantity[data-type="type-1"] {
		input[type="number"] {
			--form-field-border-width: 1px 1px 1px 0;
			padding: 0 5px 0 calc(25% + 3px);
		}

		.ct-increase,
		.ct-decrease {
			right: initial;
			left: 0;
		}

		.ct-increase {
			border-radius: var(--form-field-border-radius, 3px) 0 0 0;
		}

		.ct-decrease {
			border-radius: 0 0 0 var(--form-field-border-radius, 3px);
		}
	}

	.quantity[data-type="type-2"] {
		.ct-increase {
			right: initial;
			left: 9%;
		}

		.ct-decrease {
			left: initial;
			right: 9%;
		}
	}

	// rating
	.woocommerce-product-rating .woocommerce-review-link {
		margin-left: initial;
		margin-right: 10px;
	}

	.comment-form-rating .stars a {
		margin-left: initial;
		margin-right: 8px;
	}

	// reviews
	.woocommerce-Reviews {
		.avatar {
			left: initial;
			right: 0;
		}

		.star-rating {
			@include media-breakpoint-up (sm) {
				float: left;
			}
		}

		.comment-text {
			padding-left: initial;
			padding-right: 70px;
		}
	}

	// sale price
	.sale-price del {
		margin: 0 5px 0 0;
	}

	// zoom icon
	.woocommerce-product-gallery__trigger {
		right: initial;
		left: 20px;
	}


	// cart page
	.woocommerce-cart-form__contents .coupon input {
		@include media-breakpoint-up (md) {
			margin-right: initial;
			margin-left: 20px;
		}
	}

	// checkout page
	ul.order_details li {
		@include media-breakpoint-up (md) {
			&:nth-child(odd) {
				border-left: 1px solid var(--border-color);
				border-right: initial;
			}
		}
	}

	// shop table
	@include media-breakpoint-up (md) {
		.form-row-first {
			float: right;
		}

		.form-row-last {
			float: left;
		}
	}

	table.shop_table {
		
		th, td {
			padding-left: 0.7em;

			&:first-child {
				padding-right: 0;
			}

			&:last-child {
				padding-left: 0;
			}
		}

		@include media-breakpoint-down (md) {
			[class*="product-name"] {
				padding-left: 0;
				padding-right: 0.7em;
			}
		}

		.product-mobile-actions .remove {
			margin-left: initial;
			margin-right: auto;
			padding-left: initial;
			padding-right: 10px;
		}
	}

	// responsive table
	table.shop_table_responsive {
		tbody td:before {
			float: right;
		}
	}

	.cart .product-remove,
	.cart_totals table td,
	.ct-order-review table.shop_table tfoot td,
	.ct-order-review table.shop_table .product-total {
		text-align: left;
	}

	// messages
	.woocommerce-info,
	.woocommerce-error,
	.woocommerce-message {
		padding: 18px 52px 18px 15px;

		&:before {
			left: initial;
			right: 20px;
		}

		.button {
			float: left;
		}
	}


	.woocommerce-info .showcoupon {
		float: left;
	}

	.woocommerce-MyAccount-navigation ul li a:before {
		margin-right: initial;
		margin-left: 15px;
	}

	// header cart
	.ct-cart-content {
		@include media-breakpoint-up (sm) {
			&[data-placement='left'] {
				left: initial;
			}

			&[data-placement='right'] {
				right: initial;
			}
		}
	}

	.woocommerce-mini-cart .remove {
		right: initial;
		left: 0;
	}

	.product_list_widget .product-title {
		padding-right: 0;
		padding-left: 15px;
	}

	[data-items-count]:before {
		right: initial;
		left: -9px;
	}

	// header items label position
	[data-label="left"] .ct-label {
		margin-right: initial;
		margin-left: 0.7em;
	}

	[data-label="right"] .ct-label {
		margin-left: initial;
		margin-right: 0.7em;
	}

	[style*="counter"] .ct-icon-container:before {
		right: initial;
		left: -9px;
	}

	.ct-social-box .ct-label:not([hidden]) {
		margin-left: initial;
		margin-right: 0.7em;
	}


	// floating cart
	.ct-floating-bar {
		.ct-image-container {
			margin-right: initial;

			@include media-breakpoint-down (sm) {
				margin-left: 10px;
			}

			@include media-breakpoint-up (md) {
				margin-left: 15px;
			}
		}

		.price {
			@include media-breakpoint-up (md) {
				margin-right: initial;
				margin-left: 15px;
			}
		}

		.stock {
			margin-right: initial;
			margin-left: 15px;

			&:before {
				margin-right: initial;
				margin-left: 10px;
			}
		}

		.quantity {
			margin-right: initial;
			margin-left: 10px;
		}
	}

	// sale & stock badges
	.onsale,
	.out-of-stock-badge {
		right: var(--badge-left, 15px);
		left: initial;
	}

	// quick view
	.ct-quick-view-card {

		.entry-summary {
			@include media-breakpoint-up (md) {
				left: 0;
				right: 50%;
			}
		}

		.product_title {
			padding-right: initial;
			padding-left: 40px;
		}

		.ct-close-button {
			left: var(--right, -10px);
			right: initial;
		}
	}

	// filter trigger
	.ct-filter-trigger {
		margin-right: initial;
		margin-left: 1.2em;

		svg {
			margin-right: initial;
			margin-left: 8px;
		}
	}


	// product review extension
	.ct-product-actions .ct-button:not(:last-child) {
		margin-right: initial;
		margin-left: 25px;
	}


	// widgets
	.widget_product_categories li .count {
		float: left;
	}
}