/**
 * Rooke's Pet Products - Reactive Mega Menu Styles
 * Cleanly scoped to avoid conflicts with Divi 5 or existing child theme styles.
 */

/* ==========================================================================
   1. TOP NAVIGATION STRIP & CATEGORY MENU
   ========================================================================== */
.rookes-mega-nav {
	position: relative;
	width: 100%;
	font-family: var(--et_global_heading_font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.rookes-mega-top-menu {
	display: flex;
	justify-content: space-between;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

.rookes-mega-top-item {
	position: relative;
	list-style: none;
}

.rookes-mega-top-item--has-dropdown {
	position: static;
}

.rookes-mega-top-link {
	display: block;
	padding: 12px 14px 14px;
	font-size: 17px;
	font-weight: 600;
	color: #222222;
	text-decoration: none;
	white-space: nowrap;
	position: relative;
	transition: color 0.2s ease;
}

.rookes-mega-top-link:hover {
	color: #DC1F1D;
}

/* OFFERS highlight */
.rookes-mega-top-item--offers .rookes-mega-top-link {
	color: #DC1F1D;
	font-weight: 700;
}

/* Underline indicator for active/hovered top category */
.rookes-mega-top-item.is-current-active .rookes-mega-top-link::after,
.rookes-mega-top-item--has-dropdown:hover .rookes-mega-top-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 3px;
	background-color: #DC1F1D;
	border-radius: 2px 2px 0 0;
}

/* ==========================================================================
   2. MEGA MENU DROPDOWN CONTAINER
   ========================================================================== */
.rookes-mega-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	background: #ffffff;
	border: 1px solid #e2e2e2;
	border-top: 2px solid #DC1F1D;
	border-radius: 0 0 12px 12px;
	box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), 
	            visibility 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), 
	            transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
	pointer-events: none;
}

/* Invisible bridge so mouse hover is never accidentally dropped */
.rookes-mega-dropdown::before {
	content: '';
	position: absolute;
	top: -14px;
	left: 0;
	width: 100%;
	height: 14px;
}

/* Display on hover or JS active class */
.rookes-mega-top-item--has-dropdown:hover .rookes-mega-dropdown,
.rookes-mega-top-item--has-dropdown.is-open .rookes-mega-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.rookes-mega-dropdown__inner {
	display: grid;
	grid-template-columns: 270px 270px 1fr;
	min-height: 480px;
	max-height: 600px;
	background: #ffffff;
	border-radius: 0 0 12px 12px;
	overflow: hidden;
}

/* Common Header: View All > */
.rookes-mega-col__header {
	margin-bottom: 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid #f0f0f0;
}

.rookes-mega-view-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 15px;
	font-weight: 700;
	color: #222222;
	text-decoration: none;
	transition: color 0.15s ease;
}

.rookes-mega-view-all:hover {
	color: #DC1F1D;
	text-decoration: underline;
}

.rookes-arrow {
	font-weight: 800;
	font-size: 14px;
	display: inline-block;
	transition: transform 0.15s ease;
}

.rookes-mega-view-all:hover .rookes-arrow {
	transform: translateX(3px);
}

/* ==========================================================================
   3. COLUMN 1: CHILD 1 CATEGORIES
   ========================================================================== */
.rookes-mega-col--child1 {
	padding: 24px 18px 24px 28px;
	border-right: 1px solid #ebebeb;
	background: #ffffff;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #cccccc #f5f5f5;
}

.rookes-mega-child1-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.rookes-child1-item {
	list-style: none;
	border-radius: 4px;
	transition: all 0.15s ease;
}

.rookes-child1-link {
	display: block;
	padding: 8px 14px;
	font-size: 15px;
	font-weight: 500;
	color: #2b2b2b;
	text-decoration: none;
	border-radius: 4px;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

/* Hover & Active States */
.rookes-child1-item:hover .rookes-child1-link,
.rookes-child1-item.is-active .rookes-child1-link {
	background-color: #DC1F1D;
	color: #ffffff;
	font-weight: 600;
}

/* ==========================================================================
   4. COLUMN 2: CHILD 2 SUBCATEGORIES
   ========================================================================== */
.rookes-mega-col--child2 {
	padding: 24px 20px 24px 24px;
	border-right: 1px solid #ebebeb;
	background: #ffffff;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #cccccc #f5f5f5;
}

.rookes-child2-panel {
	display: none;
	animation: rookesFadeIn 0.2s ease-out;
}

.rookes-child2-panel.is-active {
	display: block;
}

.rookes-mega-child2-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.rookes-child2-item {
	list-style: none;
	border-radius: 4px;
}

.rookes-child2-link {
	display: block;
	padding: 8px 14px;
	font-size: 15px;
	font-weight: 500;
	color: #2b2b2b;
	text-decoration: none;
	border-radius: 4px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.rookes-child2-link:hover,
.rookes-child2-item.is-active .rookes-child2-link {
	background-color: #DC1F1D;
	color: #ffffff;
	font-weight: 600;
}

.rookes-mega-empty {
	font-size: 14px;
	color: #777777;
	font-style: italic;
	margin-top: 15px;
}

/* ==========================================================================
   5. COLUMN 3: OFFERS & TOP BRANDS
   ========================================================================== */
.rookes-mega-col--offers-brands {
	padding: 24px 28px 24px 28px;
	background: #ffffff;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #a8a8a8 #f1f1f1;
}

.rookes-mega-col--offers-brands::-webkit-scrollbar {
	width: 6px;
}
.rookes-mega-col--offers-brands::-webkit-scrollbar-track {
	background: #f5f5f5;
	border-radius: 4px;
}
.rookes-mega-col--offers-brands::-webkit-scrollbar-thumb {
	background: #b5b5b5;
	border-radius: 4px;
}

.rookes-offers-panel {
	display: none;
	animation: rookesFadeIn 0.2s ease-out;
}

.rookes-offers-panel.is-active {
	display: block;
}

/* Section Header */
.rookes-section-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 16px;
	padding-bottom: 6px;
}

.rookes-section-title {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0;
	line-height: 1.2;
}

/* Promo Cards Grid */
.rookes-cards-row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	margin-bottom: 20px;
}

.rookes-promo-card {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	background: linear-gradient(135deg, #DC1F1D 0%, #b81514 100%);
	color: #ffffff;
	border-radius: 8px;
	padding: 16px 14px;
	text-decoration: none;
	min-height: 150px;
	position: relative;
	box-shadow: 0 6px 16px rgba(220, 31, 29, 0.2);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	overflow: hidden;
}

.rookes-promo-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 22px rgba(220, 31, 29, 0.32);
	color: #ffffff;
}

.rookes-promo-card__top {
	z-index: 2;
}

.rookes-promo-card__title {
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1.2;
}

.rookes-promo-card__sub {
	font-size: 12px;
	opacity: 0.9;
	margin-top: 3px;
	line-height: 1.2;
}

.rookes-promo-card__badge-wrap {
	margin-top: 12px;
	z-index: 2;
}

.rookes-promo-card__badge {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.5px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rookes-promo-card__subbadge {
	font-size: 11px;
	font-weight: 700;
	background: rgba(0, 0, 0, 0.28);
	display: inline-block;
	padding: 3px 8px;
	border-radius: 3px;
	margin-top: 5px;
	text-transform: uppercase;
}

.rookes-promo-card__img {
	margin-top: 10px;
	align-self: flex-end;
	z-index: 2;
}

.rookes-promo-card__img img {
	max-height: 38px;
	max-width: 100px;
	object-fit: contain;
	filter: brightness(0) invert(1);
}

/* Text Promo Links */
.rookes-promo-links {
	list-style: none;
	margin: 0 0 24px 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rookes-promo-links li a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	font-weight: 600;
	color: #DC1F1D;
	text-decoration: none;
	line-height: 1.4;
	transition: color 0.15s ease;
}

.rookes-promo-links li a:hover {
	color: #8c0e0c;
	text-decoration: underline;
}

.rookes-promo-links__view-all a {
	font-weight: 700;
	margin-top: 4px;
}

/* Brands Section */
.rookes-brands-section {
	padding-top: 16px;
	border-top: 1px solid #f0f0f0;
}

.rookes-brands-title {
	font-size: 20px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 14px 0;
}

.rookes-brands-row {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.rookes-brand-item {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 70px;
	height: 48px;
	padding: 6px 14px;
	background: #ffffff;
	border: 1px solid #ebebeb;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.rookes-brand-item:hover {
	border-color: #DC1F1D;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.rookes-brand-item img {
	max-height: 32px;
	max-width: 80px;
	object-fit: contain;
	display: block;
}

.rookes-brand-text-logo {
	font-size: 20px;
	font-weight: 800;
	color: #222222;
	font-family: Georgia, serif;
	letter-spacing: -0.5px;
}

.rookes-brand-name {
	font-size: 13px;
	font-weight: 600;
	color: #444444;
}

/* ==========================================================================
   6. ANIMATIONS & RESPONSIVE BEHAVIOR
   ========================================================================== */
@keyframes rookesFadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Hide custom mega nav on mobile / small screens so mobile menu remains untouched */
@media screen and (max-width: 1024px) {
	.rookes-mega-nav {
		display: none;
	}
}

