/**
 * Frontend Styles for OTW Megamenu
 */

html {
	scrollbar-gutter: stable;
}

body.noscroll {
    overflow: hidden;
}

/* Megamenu Container */
.otw-megamenu {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 9999;
	pointer-events: none;
	visibility: hidden;
}

.otw-megamenu.is-open {
	pointer-events: auto;
	visibility: visible;
}

/* Megamenu Inner */
.otw-megamenu-inner {
	position: relative;
	max-height: 0;
	overflow: hidden;
	background: #f9f9f9;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	transition: max-height 1s cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateY(-10px);
	opacity: 0;
	transition: clip-path 1s cubic-bezier(0.4, 0, 0.2, 1),
				transform 1s cubic-bezier(0.4, 0, 0.2, 1),
	clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
}

.otw-megamenu.is-open .otw-megamenu-inner {
	max-height: 80vh;
	transform: translateY(0);
	opacity: 1;
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);

}

@media (max-width: 1024px) {
	.otw-megamenu.is-open .otw-megamenu-inner {
		overflow-y: auto;
	}
}

/* Container */
.otw-megamenu-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 30px 20px;
}

/* General Menu (After Content) */
.otw-megamenu-general-menu {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 2px solid #e0e0e0;
}

/* Remove separator when no tabs are present */
.otw-megamenu.no-tabs .otw-megamenu-general-menu {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.otw-megamenu.no-tabs .otw-megamenu-general-elementor-content {
	margin-bottom: 30px;
}

.otw-megamenu.no-tabs .otw-megamenu-general-elementor-content:last-child {
	margin-bottom: 0;
}

/* Device Visibility Classes */
@media (min-width: 1025px) {
	.otw-megamenu-general-menu.hide-on-desktop {
		display: none !important;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.otw-megamenu-general-menu.hide-on-tablet {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.otw-megamenu-general-menu.hide-on-mobile {
		display: none !important;
	}
}

.otw-megamenu-general-menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 15px 30px;
	justify-content: center;
}

.otw-megamenu-general-menu-item {
	margin: 0;
	padding: 0;
}

.otw-megamenu-general-menu-item a {
	display: inline-block;
	padding: 8px 16px;
	background:none;
	color: #333;
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
	transition: all 0.3s ease;
	border-radius: 4px;
	position: relative;
}

.otw-megamenu-general-menu-item a:hover {
	color: #000;
	background:none;
}

.otw-megamenu-general-menu-item a::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0%;
	width: 0;
	height: 1px;
	background: #333;
	transition: all 0.3s ease;
}

.otw-megamenu-general-menu-item a:hover::after {
	width: 100%;
}

/* Tabs */
.otw-megamenu-tabs {
	display: flex;
	gap: 10px;
	margin-bottom: 30px;
	border-bottom: 2px solid #e0e0e0;
	padding-bottom: 0;
}

.otw-megamenu-tabs .otw-megamenu-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 0;
	overflow: hidden;;
}

.otw-megamenu-tabs .otw-megamenu-tab:before {
    content: "";
    height: 1px;
    width: 100%;
    background-color: #666;
    position: absolute;
    bottom: 0px;
    left: 0;
    transform: translateX(-200%);
    transition: transform 300ms ease;
}

.otw-megamenu-tabs .otw-megamenu-tab:hover,
.otw-megamenu-tabs .otw-megamenu-tab:focus {
	color: #666;
	background: transparent;
}
.otw-megamenu-tabs .otw-megamenu-tab.active:before,
.otw-megamenu-tabs .otw-megamenu-tab:focus:before,
.otw-megamenu-tabs .otw-megamenu-tab:hover:before {
    transform: translateX(0);
}


/* Tab Content - Sliding Container */
.otw-megamenu-content {
	position: relative;
	overflow: hidden;
	width: 100%;
}

.otw-megamenu-content-inner {
	display: flex;
	transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.otw-megamenu-tab-content {
	flex: 0 0 100%;
	width: 100%;
	opacity: 1;
	transition: opacity 0.3s ease;
}

/* Inactive tabs have reduced opacity during transition */
.otw-megamenu-content-inner.transitioning .otw-megamenu-tab-content:not(.active) {
	opacity: 0.3;
}

/* Carousel - Desktop */
.otw-megamenu-carousel {
	margin-bottom: 30px;
}

@media (min-width: 1025px) {
	.otw-megamenu-tabs {
		justify-content: center;;
	}
	.otw-megamenu-carousel {
		/* Slick carousel will initialize here */
	}
	/* Ensure Slick slides align to the tallest item */
	.otw-megamenu-carousel.slick-initialized .slick-track {
		display: flex !important;
		align-items: stretch;
	}
	.otw-megamenu-carousel.slick-initialized .otw-megamenu-item.slick-slide {
		display: flex;
		height: auto;
	}
	.otw-megamenu-carousel.slick-initialized .otw-megamenu-item-link {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		height: 100%;
		width: 100%;
	}
	
}



/* Carousel - Mobile (Vertical Scroll) */
@media (max-width: 1024px) {
	.otw-megamenu-carousel {
		display: flex;
		flex-direction: column;
		gap: 15px;
		/* max-height: 400px;
		overflow-y: auto; */
		-webkit-overflow-scrolling: touch;
	}
	
	.otw-megamenu-item-link {
		display: flex;
		gap: 1rem;
	}
	.otw-megamenu-item-image {
		max-width: 62px;
		margin: 0;
	}

	.otw-megamenu-tabs .otw-megamenu-tab {
		padding: 8px 12px;
	}

	.otw-megamenu-tab-content:not(.active) {
		height: 0;
	}
}

/* Carousel Item */
.otw-megamenu-item {
	padding: 10px;
}

.otw-megamenu-item-link {
	display: block;
	text-decoration: none;
	color: inherit;
	transition: transform 0.3s ease;
}

.otw-megamenu-item-link:hover {
	transform: translateY(-5px);
}

.otw-megamenu-item-image {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 8px;
	background: #f5f5f5;
	margin-bottom: 15px;
}

.otw-megamenu-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.otw-megamenu-item-link:hover .otw-megamenu-item-image img {
	transform: scale(1.05);
}

.otw-megamenu-item-content {
	text-align: center;
}

.otw-megamenu-item-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 5px 0;
	color: #333;
}

.otw-megamenu-item-subtitle {
	font-size: 14px;
	color: #666;
	margin: 0;
}

@media (max-width: 1024px) {
	.otw-megamenu-item {
		padding: 0;
	}

	.otw-megamenu-item-content {
		text-align: start;
		line-height: 1.1;
	}

	.otw-megamenu-item-title {
		font-size: 14px;
	}

	.otw-megamenu-item-subtitle {
		font-size: 12px;
	}
	
}

/* WordPress Menu Links */
.otw-megamenu-links {
	margin-bottom: 30px;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

.otw-megamenu-links-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
}

.otw-megamenu-links-list li {
	margin: 0;
	padding: 0;
}

.otw-megamenu-links-list a {
	display: block;
	padding: 8px 12px;
	color: #333;
	text-decoration: none;
	transition: all 0.2s ease;
	border-radius: 4px;
}

.otw-megamenu-links-list a:hover {
	background: #fff;
	color: #000;
	padding-left: 16px;
}

/* Menu Orientation - Horizontal (Default) */
.otw-megamenu-links.orientation-desktop-horizontal .otw-megamenu-links-list,
.otw-megamenu-general-menu.orientation-desktop-horizontal .otw-megamenu-general-menu-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Menu Orientation - Vertical */
.otw-megamenu-links.orientation-desktop-vertical .otw-megamenu-links-list,
.otw-megamenu-general-menu.orientation-desktop-vertical .otw-megamenu-general-menu-list {
	display: flex;
	flex-direction: column;
}

/* Laptop Orientation (1025px - 1366px) */
@media (min-width: 1025px) and (max-width: 1366px) {
	.otw-megamenu-links.orientation-laptop-horizontal .otw-megamenu-links-list,
	.otw-megamenu-general-menu.orientation-laptop-horizontal .otw-megamenu-general-menu-list {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	}

	.otw-megamenu-links.orientation-laptop-vertical .otw-megamenu-links-list,
	.otw-megamenu-general-menu.orientation-laptop-vertical .otw-megamenu-general-menu-list {
		display: flex;
		flex-direction: column;
	}
}

/* Tablet Orientation (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
	.otw-megamenu-links.orientation-tablet-horizontal .otw-megamenu-links-list,
	.otw-megamenu-general-menu.orientation-tablet-horizontal .otw-megamenu-general-menu-list {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.otw-megamenu-links.orientation-tablet-vertical .otw-megamenu-links-list,
	.otw-megamenu-general-menu.orientation-tablet-vertical .otw-megamenu-general-menu-list {
		display: flex;
		flex-direction: column;
	}
}

/* Mobile Orientation (max 767px) */
@media (max-width: 767px) {
	.otw-megamenu-links.orientation-mobile-horizontal .otw-megamenu-links-list,
	.otw-megamenu-general-menu.orientation-mobile-horizontal .otw-megamenu-general-menu-list {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	}

	.otw-megamenu-links.orientation-mobile-vertical .otw-megamenu-links-list,
	.otw-megamenu-general-menu.orientation-mobile-vertical .otw-megamenu-general-menu-list {
		display: flex;
		flex-direction: column;
	}
}

/* Elementor Content */
.otw-megamenu-elementor-content {
	margin-bottom: 30px;
}

.otw-megamenu-general-elementor-content {
	margin-bottom: 30px;
}

/* Shop All Link */
.otw-megamenu-shop-all {
	text-align: center;
	padding-top: 20px;
}

.otw-megamenu-shop-all-link {
	position: relative;
	display: inline-block;
    padding: 12px 32px;
    background: transparent;
    color: black;
    text-decoration: none;
    font-weight: normal;
    font-size: 16px;
    transition: all 0.3s ease;
    border-radius: 0;
}

.otw-megamenu-shop-all-link:after {
    content: "";
    background: black;
    height: 1px;
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
}
.otw-megamenu-shop-all-link:focus,
.otw-megamenu-shop-all-link:hover {
	color: black;
	background: transparent;
	transform: translateY(-2px);

}

/* Overlay */
.otw-megamenu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0);
	transition: background 0.4s ease;
	pointer-events: none;
	z-index: -1;
}

.otw-megamenu.is-open .otw-megamenu-overlay {
	/* background: rgba(0, 0, 0, 0.5); */
	pointer-events: auto;
}

/* Slick Carousel Customization */
.otw-megamenu-carousel.slick-initialized {
	padding: 0 40px;
}

.otw-megamenu-carousel .slick-prev,
.otw-megamenu-carousel .slick-next {
	width: 40px;
	height: 40px;
	background: #fff;
	border-radius: 50%;
	border: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
	z-index: 10;
	font-size: 0;
    padding: 0;
}

.otw-megamenu-carousel .slick-prev:before,
.otw-megamenu-carousel .slick-next:before {
	color: #333;
    font-size: 20px;
    opacity: 1;
    font-family: inherit;
    width: var(--size);
    height: var(--size);
    display: flex
;
    align-items: center;
    justify-content: center;
}

.otw-megamenu-carousel .slick-prev {
	left: 0;
}

.otw-megamenu-carousel .slick-next {
	right: 0;
}

.otw-megamenu-carousel .slick-prev:hover,
.otw-megamenu-carousel .slick-next:hover {
	background: #f5f5f5;
}

.otw-megamenu-carousel .slick-dots {
	bottom: -30px;
	left: 0;
    right: 0;
}

.otw-megamenu-carousel .slick-dots button {
    background: none;
}

.otw-megamenu-carousel .slick-dots li button:before {
	font-size: 10px;
	color: #ccc;
}

.otw-megamenu-carousel .slick-dots li.slick-active button:before {
	color: #333;
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
	.otw-megamenu-container {
		padding: 20px 15px;
	}

	.otw-megamenu-general-menu {
		margin-top: 10px;
		margin-bottom: 20px;
		padding-top: 15px;
		padding-bottom: 15px;
	}

	.otw-megamenu-general-menu-list {
		gap: 10px 15px;
		justify-content: flex-start;
		flex-direction: column;
	}

	.otw-megamenu-general-menu-item a {
		font-size: 14px;
		padding: 6px 12px;
	}

	.otw-megamenu-tabs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		margin-bottom: 20px;
		flex-wrap: nowrap;
		scrollbar-width: none;
	}

	.otw-megamenu-tabs::-webkit-scrollbar {
		display: none;
	}

	.otw-megamenu-tab {
		flex-shrink: 0;
		padding: 10px 20px;
		font-size: 14px;
	}

	.otw-megamenu-item-link {
		display: flex;
		gap: 1rem;
	}

	.otw-megamenu-item-image {
		max-width: 62px;
		margin: 0;
	}

	.otw-megamenu-links-list {
		grid-template-columns: 1fr;
	}
}

/* Accessibility */
.otw-megamenu-tab:focus {
	outline: 2px solid #4a90e2;
	outline-offset: 2px;
}

.otw-megamenu-item-link:focus {
	outline: 2px solid #4a90e2;
	outline-offset: 2px;
}

/* Smooth Scrolling */
.otw-megamenu-carousel {
	scroll-behavior: smooth;
}

/* ============================================
   RTL Support
   ============================================ */

/* RTL mode is handled via dir="rtl" HTML attribute on megamenu container */
/* The dir attribute automatically handles text direction and layout */

/* Override content inner flex direction in RTL to maintain proper sliding */
/* [dir="rtl"] .otw-megamenu-content-inner {
	flex-direction: row-reverse;
} */

/* Additional RTL-specific adjustments */
[dir="rtl"] .otw-megamenu-links-list a:hover {
	padding-left: 12px;
	padding-right: 16px;
}

/* Fix Slick carousel padding in RTL */
[dir="rtl"] .otw-megamenu-carousel.slick-initialized {
	padding: 0 50px;
}

/* Slick arrows in RTL are automatically handled by Slick's rtl: true option */
/* But we need to maintain our custom styling */
[dir="rtl"] .otw-megamenu-carousel .slick-prev,
[dir="rtl"] .otw-megamenu-carousel .slick-next {
	width: 40px;
	height: 40px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	z-index: 10;
}

[dir="rtl"] .otw-megamenu-carousel .slick-next {
    right: auto;
    left: 8px;
}

[dir="rtl"] .otw-megamenu-carousel .slick-prev {
    left: auto;
    right: 8px;
}

/* RTL Slick carousel fixes */
[dir="rtl"] .otw-megamenu-carousel.slick-initialized .slick-list {
	direction: rtl;
}

[dir="rtl"] .otw-megamenu-carousel.slick-initialized .slick-track {
	direction: rtl;
}

[dir="rtl"] .otw-megamenu-carousel.slick-initialized .otw-megamenu-item {
	direction: rtl;
}
