/**
 * FoxStudy Products Shortcode Styles
 * 
 * Styles for the [foxstudy_products] shortcode
 * Matching design from ui.html with grid and list view support
 * Includes modern styling for Essential Addons Advance Tabs
 * 
 * @package FoxStudy
 * @since 1.0.0
 */

/* ============================================================================
   CSS Variables
   ============================================================================ */
   :root {
	--foxstudy-primary: #f97316;
	--foxstudy-bg: #f8fafc;
	--foxstudy-card: #ffffff;
	--foxstudy-border: #e5e7eb;
	--foxstudy-muted: #6b7280;
	--foxstudy-text: #111827;
}

/* ============================================================================
   Container
   ============================================================================ */
.foxstudy-products-container {
	font-size: 16px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 16px;
	width: 100%;
	box-sizing: border-box;
}

/* ============================================================================
   Category Tabs - Clean Design
   ============================================================================ */
.foxstudy-tabs-search-row {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
}
.foxstudy-search-container{
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
}
/* Search Container */
.foxstudy-search-container {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

.foxstudy-search-input {
	padding: 6px 16px !important;
	border: 1px solid var(--foxstudy-border);
	border-radius: 6px;
	font-size: 14px;
	color: var(--foxstudy-text);
	background: #fff;
	min-width: 250px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.foxstudy-search-input:focus {
	outline: none;
	border-color: var(--foxstudy-primary);
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.foxstudy-search-btn {
	padding: 15px 20px;
	background: var(--foxstudy-primary);
	color: #fff;
	border: none;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
	white-space: nowrap;
}

.foxstudy-search-btn:hover {
	background: #ea580c;
}

.foxstudy-search-btn:active {
	transform: scale(0.98);
}

.foxstudy-category-tabs {
	display: flex;
	justify-content: center;
	gap: 18px;
	align-items: center;
	margin: 24px 0;
	border-bottom: 2px solid var(--foxstudy-border);
	flex-wrap: wrap;
}

.foxstudy-category-tab {
	padding: 25px 30px;
	border: none;
	background: transparent !important;
	color: var(--foxstudy-text);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	position: relative;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	border-radius: 0;
	gap: 8px;
}

.foxstudy-category-tab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.foxstudy-category-tab-icon img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.foxstudy-category-tab:hover {
	color: var(--foxstudy-text) !important;
	background: transparent !important;
	border-bottom: 3px solid var(--foxstudy-border) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.foxstudy-category-tab.active {
	background: #fff5ee !important;
	color: #f97316 !important;
	border-bottom: 3px solid #f97316 !important;
	border-radius: 0 !important;
	z-index: 1;
}

/* Products Info Bar */
.foxstudy-products-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 20px 0;
	padding: 0;
}

.foxstudy-info-left {
	font-size: 14px;
	color: var(--foxstudy-muted);
}

.foxstudy-products-count {
	font-weight: 600;
	color: var(--foxstudy-text);
}

.foxstudy-info-right {
	display: flex;
	align-items: center;
	gap: 8px;
}


/* Ensure all buttons have max border-radius of 10px */
.foxstudy-products-container button,
.foxstudy-products-container .button,
.foxstudy-products-container .btn,
.foxstudy-products-container a.button,
.foxstudy-products-container a.btn {
	border-radius: 6px !important;
	font-size: 0.6rem;
    padding: 0.4rem 0.6rem;
}

/* View Toggle - Clean Design */
.foxstudy-view-toggle {
	display: flex;
	background: #f4f5f6;
	padding: 4px;
	border-radius: 8px;
	gap: 4px;
}

.foxstudy-view-btn {
	border: none;
	background: #f4f5f6 !important;
	padding: 8px 12px;
	cursor: pointer;
	border-radius: 6px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: #000;
	font-size: 14px;
	font-weight: 600;
}

.foxstudy-view-btn svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.foxstudy-view-btn span {
	display: inline-block;
}

.foxstudy-view-btn.active {
	background: #d64c29 !important;
	color: #fff;
}

.foxstudy-view-btn:hover:not(.active) {
	background: #f4f5f6 !important;
	color: #000;
}

/* ============================================================================
   Loading State
   ============================================================================ */
.foxstudy-products-loading {
	text-align: center;
	padding: 40px;
	color: var(--foxstudy-muted);
}

/* ============================================================================
   Products Grid (Default View)
   ============================================================================ */
.foxstudy-products-grid-container {
	min-height: 200px;
}

.foxstudy-products-grid {
	display: grid;
	grid-template-columns: repeat(var(--columns, 4), 1fr);
	gap: 24px;
	width: 100%;
}

/* Responsive Grid */
@media (max-width: 992px) {
	.foxstudy-products-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.foxstudy-products-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.foxstudy-category-tabs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
		padding-bottom: 0;
	}

	.foxstudy-category-tab {
		flex-shrink: 0;
		padding: 18px 25px !important;
		font-size: 14px;
	}

	.foxstudy-products-info {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
}

@media (max-width: 480px) {
	.foxstudy-products-grid {
		grid-template-columns: 1fr;
	}

	.foxstudy-product-footer {
		flex-wrap: wrap;
	}

	.foxstudy-category-tab {
		padding: 8px 12px;
		font-size: 13px;
	}
}

/* ============================================================================
   Product Card (Grid View)
   ============================================================================ */
.foxstudy-product-card {
	background: var(--foxstudy-card);
	border: 1px solid var(--foxstudy-border);
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.foxstudy-product-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

/* Product Image */
.foxstudy-product-image {
	position: relative;
	height: 200px;
	overflow: hidden;
	background: #e5e7eb;
}

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

.foxstudy-product-card:hover .foxstudy-product-image img {
	transform: scale(1.05);
}

.foxstudy-product-image a {
	display: block;
	width: 100%;
	height: 100%;
}

/* Category Badge - White background, optional icon + label */
.foxstudy-product-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--foxstudy-text);
	border-radius: 20px;
	z-index: 2;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	transition: all 0.3s ease;
	background: #ffffff;
}

.foxstudy-product-badge-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.foxstudy-product-badge-icon img {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.foxstudy-product-card:hover .foxstudy-product-badge {
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Product Body */
.foxstudy-product-body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	min-height: 0;
}

.foxstudy-product-title {
	font-size: 17px;
	font-weight: 800;
	line-height: 1.3;
	margin-bottom: 8px;
	min-height: 44px;
}

.foxstudy-product-title a {
	color: var(--foxstudy-text);
	text-decoration: none !important;
	transition: color 0.2s ease;
}

.foxstudy-product-title a:hover {
	color: var(--foxstudy-primary);
}

.foxstudy-product-desc {
	font-size: 14px;
	color: var(--foxstudy-muted);
	line-height: 1.5;
	margin-bottom: 16px;
}

/* Product Meta */
 .foxstudy-product-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	font-size: 12px;
	color: var(--foxstudy-muted);
	margin-bottom: 12px;
	flex-wrap: nowrap;
	flex-grow: 0;
}

.foxstudy-product-meta .rating {
	font-weight: 600;
}

/* Star Rating Styles */
.foxstudy-rating-container {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--foxstudy-muted);
}

/* Extra course meta (teacher / duration) */
.foxstudy-course-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 12px;
	color: var(--foxstudy-muted);
}

.foxstudy-course-row {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.foxstudy-course-language-row {
	align-items: center;
}

.foxstudy-course-label {
	font-weight: 600;
	color: var(--foxstudy-text);
}

.foxstudy-course-value {
	color: var(--foxstudy-muted);
}

.foxstudy-language-flag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #f3f4f6;
	margin-right: 4px;
	font-size: 12px;
}

.foxstudy-language-flag::before {
	content: '🌐';
}

.foxstudy-language-flag.flag-de::before {
	content: '🇩🇪';
}

.foxstudy-language-flag.flag-en::before {
	content: '🇬🇧';
}

.foxstudy-language-flag.flag-fr::before {
	content: '🇫🇷';
}

.foxstudy-language-flag.flag-it::before {
	content: '🇮🇹';
}

.foxstudy-language-flag.flag-es::before {
	content: '🇪🇸';
}

.foxstudy-language-flag.flag-multi::before {
	content: '🌍';
}

.foxstudy-star-rating {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.foxstudy-star-rating .star {
	font-size: 16px;
	color: #ddd;
	line-height: 1;
	display: inline-block;
	width: 11px;
	text-align: center;
}

.foxstudy-star-rating .star.star-filled {
	color: #dc2626;
}

.foxstudy-star-rating .star.star-half {
	position: relative;
	color: #ddd;
	overflow: hidden;
}

.foxstudy-star-rating .star.star-half::after {
	content: '★';
	position: absolute;
	left: 0;
	top: 0;
	width: 50%;
	overflow: hidden;
	color: #dc2626;
}

.foxstudy-star-rating .star.star-empty {
	color: #ddd;
}

.foxstudy-star-rating .rating-text {
	font-size: 12px;
	color: var(--foxstudy-muted);
	margin-left: 6px;
	font-weight: 500;
}

/* Product Rating Styles */
.foxstudy-product-rating {
	display: flex;
	align-items: center;
	gap: 4px;
}

.foxstudy-product-rating .star-rating {
	float: none;
	margin: 0;
	display: inline-block;
	width: 5.4em;
	height: 1em;
	line-height: 1;
	font-size: 1em;
	font-family: star;
	overflow: hidden;
	position: relative;
}

.foxstudy-product-rating .star-rating::before {
	content: "\73\73\73\73\73";
	color: #ddd;
	float: left;
	top: 0;
	left: 0;
	position: absolute;
	letter-spacing: 0.1em;
	word-spacing: 0.1em;
}

.foxstudy-product-rating .star-rating span {
	overflow: hidden;
	float: left;
	top: 0;
	left: 0;
	position: absolute;
	padding-top: 1.5em;
	color: #ffb900;
}

.foxstudy-product-rating .star-rating span::before {
	content: "\53\53\53\53\53";
	top: 0;
	position: absolute;
	left: 0;
	letter-spacing: 0.1em;
	word-spacing: 0.1em;
}

/* Ensure add to cart button is visible and styled */
.foxstudy-product-footer .add_to_cart_button,
.foxstudy-product-footer .button {
	display: inline-block;
	visibility: visible;
	opacity: 1;
}

/* Product Footer */
.foxstudy-product-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: nowrap;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--foxstudy-border);
}

.foxstudy-product-price {
	font-size: 1rem;
	font-weight: 800;
	color: var(--foxstudy-text);
	flex-shrink: 0;
}

.foxstudy-product-price .woocommerce-Price-amount {
	font-size: 0.8rem !important;
	font-weight: inherit;
}

/* Add to Cart Button */
.foxstudy-product-footer .button,
.foxstudy-product-footer .btn,
.foxstudy-view-product-btn,
.foxstudy-product-footer .add_to_cart_button {
	background: var(--foxstudy-primary);
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 8px 10px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	transition: background 0.2s ease;
}

.foxstudy-product-footer .button:hover,
.foxstudy-product-footer .btn:hover,
.foxstudy-view-product-btn:hover,
.foxstudy-search-btn:hover,
.foxstudy-pagination-btn:hover{
	background: #1E1810 !important;
	color: #fff;
}

/* ============================================================================
   Product Card (List View)
   ============================================================================ */
.foxstudy-products-grid.foxstudy-products-list {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.foxstudy-product-card-list {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 24px;
}

.foxstudy-product-card-list .foxstudy-product-image {
	width: 300px;
	min-width: 300px;
	height: 200px;
	flex-shrink: 0;
}

.foxstudy-product-card-list .foxstudy-product-body {
	flex: 1;
	padding: 16px;
	display: flex;
	flex-direction: column;
}

.foxstudy-product-card-list .foxstudy-product-title {
	min-height: auto;
}

.foxstudy-product-card-list .foxstudy-product-footer {
	margin-top: auto;
}

/* Responsive List View */
@media (max-width: 768px) {
	.foxstudy-product-card-list {
		flex-direction: column;
	}

	.foxstudy-product-card-list .foxstudy-product-image {
		width: 100%;
		min-width: 100%;
	}
}

/* ============================================================================
   Pagination
   ============================================================================ */
.foxstudy-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 32px;
	flex-wrap: wrap;
}

.foxstudy-pagination-btn {
	background: var(--foxstudy-card);
	border: 1px solid var(--foxstudy-border);
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 600;
	color: var(--foxstudy-text);
	cursor: pointer;
	transition: all 0.2s ease;
	min-width: 40px;
}

.foxstudy-pagination-btn:hover {
	color: #fff;
	border-color: var(--foxstudy-primary);
}

.foxstudy-pagination-btn.active {
	background: #dc4329;
	color: #fff;
	border-color: var(--foxstudy-primary);
}

/* ============================================================================
   Empty State
   ============================================================================ */
.foxstudy-no-products {
	text-align: center;
	padding: 40px;
	color: var(--foxstudy-muted);
	font-size: 16px;
}

/* ============================================================================
   WooCommerce Integration
   ============================================================================ */
.foxstudy-product-footer .added_to_cart {
	display: none;
}

/* Ensure WooCommerce buttons are styled correctly */
.foxstudy-product-footer .add_to_cart_button:hover {
	background: #ea580c;
	color: #fff;
}

.foxstudy-product-footer .add_to_cart_button.loading {
	opacity: 0.7;
	cursor: not-allowed;
}

/* Hide rating input from course review plugin */
.wdm-crr-star-input,
.rating.rating-loading,
input[class*="rating"] {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	position: absolute !important;
	left: -9999px !important;
}

/* ============================================================================
   Essential Addons Advance Tabs Styling
   ============================================================================ */

/* Main tabs container */
.eael-advance-tabs {
	position: relative;
	margin-bottom: 32px;
}

/* Tabs navigation */
.eael-tabs-nav {
	border-bottom: 2px solid var(--foxstudy-border);
	margin-bottom: 24px;
}

.eael-tabs-nav ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 8px;
	flex-wrap: wrap;
}

/* Individual tab item */
.eael-tab-nav-item {
	position: relative;
	padding: 14px 24px;
	cursor: pointer;
	border: none;
	background: transparent;
	transition: all 0.3s ease;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 600;
	color: var(--foxstudy-muted);
	text-decoration: none;
}

.eael-tab-nav-item:hover {
	color: var(--foxstudy-primary);
	background: rgba(249, 115, 22, 0.05);
}

/* Active tab */
.eael-tab-nav-item.active {
	color: var(--foxstudy-primary);
	border-bottom-color: var(--foxstudy-primary);
	background: rgba(249, 115, 22, 0.05);
}

/* Tab icons */
.eael-tab-nav-item i,
.eael-tab-nav-item svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
	transition: transform 0.3s ease;
}

.eael-tab-nav-item:hover i,
.eael-tab-nav-item:hover svg,
.eael-tab-nav-item.active i,
.eael-tab-nav-item.active svg {
	transform: scale(1.1);
}

.eael-tab-nav-item svg {
	display: inline-block;
	vertical-align: middle;
}

/* Tab title */
.eael-tab-title {
	display: inline-block;
}

/* Tab content area */
.eael-tabs-content {
	position: relative;
	min-height: 200px;
}

.eael-tab-content-item {
	display: none;
	animation: fadeIn 0.4s ease-in-out;
}

.eael-tab-content-item.active {
	display: block;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Inactive tab content (hidden) */
.eael-tab-content-item.inactive {
	display: none;
}

/* Responsive tabs */
@media (max-width: 768px) {
	.eael-tabs-nav ul {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
		padding-bottom: 8px;
	}

	.eael-tab-nav-item {
		padding: 12px 18px;
		font-size: 14px;
		white-space: nowrap;
		flex-shrink: 0;
	}

	.eael-tab-nav-item i,
	.eael-tab-nav-item svg {
		width: 18px;
		height: 18px;
	}
}

/* Horizontal tabs specific */
.eael-tabs-horizontal .eael-tabs-nav ul {
	flex-direction: row;
}

/* Tab inline icon layout */
.eael-tab-inline-icon .eael-tab-nav-item {
	flex-direction: row;
	align-items: center;
}

.eael-tab-inline-icon .eael-tab-title.title-after-icon {
	margin-left: 8px;
}

/* Smooth transitions */
.eael-tab-nav-item,
.eael-tab-content-item {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.eael-tab-nav-item:focus {
	outline: 2px solid var(--foxstudy-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Tab hover effect enhancement */
.eael-tab-nav-item:not(.active):hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Active tab enhancement */
.eael-tab-nav-item.active {
	box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
}

