/* Related Products Carousel - Modern Responsive Design */

/* =========================================
   WRAPPER & CONTAINER STYLES
   ========================================= */

.tty-related-products-wrapper {
	padding: var(--tty-spacing-xl) 0;
	background: var(--tty-bg-primary);
	transition: var(--tty-transition-normal);
}

.tty-related-products-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
}

/* =========================================
   HEADER SECTION
   ========================================= */

.tty-related-products-header {
	margin-bottom: 40px;
	text-align: center;
}

.tty-related-header-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.tty-related-products-title {
	margin: 0;
	font-size: clamp(26px, 3.5vw, 38px);
  	font-weight: 700;
  	line-height: 1.2;
  	color: var(--tty-header-primary);
  	letter-spacing: -0.02em;
}

.tty-related-products-slogan {
	margin: 0;
}

/* =========================================
   CAROUSEL CONTAINER
   ========================================= */

.tty-related-carousel-wrapper {
	display: flex;
	align-items: center;
	gap: 20px;
	position: relative;
}

.tty-carousel-viewport {
	flex: 1;
	border-radius: var(--tty-radius-md);
	background: var(--tty-bg-primary);
}

.tty-carousel-slider {
	display: flex;
	gap: 20px;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

/* =========================================
   CAROUSEL NAVIGATION
   ========================================= */

.tty-carousel-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	min-width: 48px;
	border-radius: 50%;
	border: 2px solid var(--tty-border-light);
	background: var(--tty-bg-primary);
	color: var(--tty-text-primary);
	cursor: pointer;
	transition: var(--tty-transition-normal);
	z-index: 2;
	font-size: 20px;
}

.tty-carousel-nav:hover {
	border-color: var(--tty-primary);
	color: var(--tty-primary);
	background: rgba(0, 95, 95, 0.05);
	transform: scale(1.08);
}

.tty-carousel-nav:active {
	transform: scale(0.95);
}

.tty-carousel-nav i {
	font-size: 20px;
}

/* Dark theme */
[data-theme="dark"] .tty-carousel-nav {
	border-color: var(--tty-border-medium);
	background: var(--tty-bg-secondary);
	color: var(--tty-text-primary);
}

[data-theme="dark"] .tty-carousel-nav:hover {
	border-color: var(--tty-primary);
	background: rgba(0, 168, 150, 0.1);
}


/* =========================================
   CAROUSEL SLIDES
   ========================================= */

.tty-carousel-slide {
	flex: 0 0 calc(25% - 15px);
	min-width: 0;
	scroll-snap-align: start;
}

.tty-related-product-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: var(--tty-transition-normal);
}

.tty-related-product-card:hover {
	transform: translateY(-4px);
}

/* =========================================
   PRODUCT CARD IMAGE
   ========================================= */

.tty-rp-image-wrapper {
	position: relative;
	padding-top: 100%;
	background: var(--tty-bg-secondary);
	border-radius: 30px;
	overflow: hidden;
	flex-shrink: 0;
}

.tty-rp-image-link {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tty-rp-image-link img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.5s ease;
}

.tty-related-product-card:hover .tty-rp-image-link img {
	transform: scale(1.05);
}

.tty-rp-sale-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translateX(-50%);
	background: var(--tty-secondary);
	color: white;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.4px;
	white-space: nowrap;
	z-index: 2;
}

/* =========================================
   PRODUCT CARD INFO
   ========================================= */

.tty-rp-info {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 16px 4px 4px;
	gap: 8px;
}

.tty-rp-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.tty-rp-title a {
	color: var(--tty-text-primary);
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s ease;
}

.tty-rp-title a:hover {
	color: var(--tty-primary);
}

/* Categories */
.tty-rp-cats {
	display: flex;
	gap: 6px;
	flex-wrap: nowrap;
	overflow: hidden;
}

.tty-rp-cat {
	font-size: 11px;
	color: var(--tty-text-secondary);
	font-weight: 500;
	border-radius: 30px;
	background: rgba(0, 95, 95, 0.08);
	padding: 3px 10px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	flex-shrink: 1;
}

/* Price row */
.tty-rp-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: auto;
}

.tty-rp-price {
	font-size: 18px;
	font-weight: 700;
	color: var(--tty-primary);
}

.tty-rp-price .woocommerce-Price-amount {
	color: var(--tty-primary);
}

.tty-rp-variable-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	color: var(--tty-secondary);
	background: rgba(229, 146, 76, 0.1);
	padding: 3px 10px;
	border-radius: 12px;
	letter-spacing: 0.3px;
	white-space: nowrap;
}

/* CTA */
.tty-rp-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--tty-primary);
	padding: 10px 12px;
	border-radius: 15px;
	background: rgba(0, 95, 95, 0.05);
	text-decoration: none;
	transition: var(--tty-transition-fast);
}

.tty-related-product-card:hover .tty-rp-cta {
	background: rgba(0, 95, 95, 0.12);
	gap: 12px;
}

/* Dark theme */
[data-theme="dark"] .tty-rp-image-wrapper {
	background: var(--tty-bg-tertiary);
}

[data-theme="dark"] .tty-rp-title a {
	color: var(--tty-text-primary);
}

[data-theme="dark"] .tty-rp-cat {
	background: rgba(0, 168, 150, 0.1);
}

[data-theme="dark"] .tty-rp-variable-badge {
	background: rgba(229, 146, 76, 0.15);
}

[data-theme="dark"] .tty-rp-cta {
	background: rgba(0, 168, 150, 0.1);
	color: var(--tty-primary-light);
}

[data-theme="dark"] .tty-related-product-card:hover .tty-rp-cta {
	background: rgba(0, 168, 150, 0.2);
}

/* =========================================
   PROGRESS DOTS (MOBILE)
   ========================================= */

.tty-carousel-progress-dots {
	display: none;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
}

.tty-carousel-progress-dots.active {
	display: flex;
}

.tty-progress-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tty-border-light);
	cursor: pointer;
	transition: var(--tty-transition-fast);
	border: 2px solid transparent;
}

.tty-progress-dot.active {
	background: var(--tty-primary);
	width: 24px;
	border-radius: 4px;
}

.tty-progress-dot:hover {
	background: var(--tty-primary-light);
}

[data-theme="dark"] .tty-progress-dot {
	background: var(--tty-border-medium);
}

[data-theme="dark"] .tty-progress-dot.active {
	background: var(--tty-primary);
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Desktop: 4 items per row */
@media (min-width: 1025px) {
	.tty-carousel-slide {
		flex: 0 0 calc(25% - 15px);
	}

	.tty-carousel-nav {
		display: flex;
	}

	.tty-carousel-nav-prev {
		margin-right: -60px;
		z-index: 5;
	}

	.tty-carousel-nav-next {
		margin-left: -60px;
		z-index: 5;
	}
}

/* Tablet: 2 items per row */
@media (max-width: 1024px) {
	.tty-carousel-slide {
		flex: 0 0 calc(50% - 10px);
	}

	.tty-carousel-nav {
		display: flex;
		width: 40px;
		height: 40px;
	}

	.tty-carousel-nav i {
		font-size: 16px;
	}

	.tty-carousel-nav-prev {
		margin-right: -50px;
	}

	.tty-carousel-nav-next {
		margin-left: -50px;
	}

	.tty-related-products-title {
		font-size: clamp(24px, 3vw, 32px);
	}
}

@media (max-width: 768px) {
	.tty-related-carousel-wrapper {
		gap: 12px;
		overflow: visible;
	}

	.tty-carousel-viewport {
		border-radius: 0;
		overflow: visible;
		width: calc(100vw - 40px);
		margin: 0 -12px;
		padding: 0 12px;
	}

	/* Show peek of next card — ~65% width leaves ~30% visible as hint */
	.tty-carousel-slide {
		flex: 0 0 65%;
		min-width: 0;
	}

	.tty-carousel-slider {
		gap: 16px;
		scroll-behavior: smooth;
		-webkit-overflow-scrolling: touch;
	}

	.tty-carousel-progress-dots.active {
		display: flex;
	}

	.tty-related-products-header {
		margin-bottom: 24px;
	}

	.tty-related-products-title {
		font-size: 24px;
	}

	.tty-related-products-slogan {
		font-size: 14px;
	}

	/* Card info compact on mobile */
	.tty-rp-info {
		padding: 12px 4px 4px;
		gap: 6px;
	}

	.tty-rp-title {
		font-size: 14px;
	}

	.tty-rp-price {
		font-size: 16px;
	}

	.tty-rp-cta {
		font-size: 12px;
		padding: 8px 10px;
	}
}

/* Extra small mobile */
@media (max-width: 480px) {
	.tty-related-products-container {
		padding: 0 12px;
	}

	.tty-carousel-viewport {
		padding: 0;
	}

	/* Slightly wider on very small screens — still shows peek */
	.tty-carousel-slide {
		flex: 0 0 72%;
	}

	.tty-related-header-content {
		gap: 8px;
	}

	.tty-related-products-title {
		font-size: 20px;
	}

	.tty-related-products-slogan {
		font-size: 13px;
	}
}

/* =========================================
   SINGLE ITEM — no carousel needed
   ========================================= */

.tty-related--single .tty-related-carousel-wrapper {
	justify-content: center;
}

.tty-related--single .tty-carousel-nav {
	display: none !important;
}

.tty-related--single .tty-carousel-progress-dots {
	display: none !important;
}

.tty-related--single .tty-carousel-slide {
	flex: 0 0 280px;
}

@media (max-width: 768px) {
	.tty-related--single .tty-carousel-viewport {
		overflow: hidden;
		width: auto;
		margin: 0;
		padding: 0;
	}

	.tty-related--single .tty-carousel-slide {
		flex: 0 0 260px;
	}
}

/* =========================================
   UTILITIES & HELPERS
   ========================================= */

.tty-carousel-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* Print styles */
@media print {
	.tty-carousel-nav,
	.tty-carousel-progress-dots {
		display: none !important;
	}

	.tty-carousel-slider {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 20px;
	}

	.tty-carousel-slide {
		flex: none;
	}
}