/*
 * Casa Jardín - Homepage Redesign
 * Modern, fresh design with warm cream tones and eco-friendly aesthetics
 * Note: Header styles are now in header_style.css for global application
 */

/* ============================================
   MOBILE OVERFLOW FIX
   ============================================ */

.homepage-container {
	overflow-x: hidden;
	width: 100%;
	max-width: 100vw;
}

:root {
	--homepage-shell-max: 1320px;
	--homepage-banner-max: 1320px;
	--homepage-shell-gutter: clamp(20px, 2.8vw, 40px);
	--homepage-carousel-side-padding: clamp(18px, 3vw, 64px);
	--homepage-featured-card-min: 188px;
	--homepage-featured-card-max: 232px;
	--homepage-featured-title-size: 0.96rem;
	--homepage-featured-price-size: 1.04rem;
}

/* Fix Bootstrap row overflow on mobile */
@media (max-width: 768px) {
	.row {
		margin-left: 0;
		margin-right: 0;
		max-width: 100%;
	}

	.container,
	.container-fluid {
		overflow-x: hidden;
		max-width: 100vw;
		padding-left: 15px;
		padding-right: 15px;
	}

	body {
		overflow-x: hidden;
		max-width: 100vw;
	}

	html {
		overflow-x: hidden;
		max-width: 100vw;
	}
}

/* ============================================
   SECTION COLOR SYSTEM
   ============================================ */

.section-wrapper {
	margin: 0 !important;
	padding: clamp(16px, 2vw, 24px) 0;
	position: relative;
}

.banner-section {
	padding: 0;
	position: relative;
	overflow: hidden;
}

.banner-section::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(18, 51, 132, 0.08) 0%, rgba(18, 51, 132, 0) 100%),
		linear-gradient(90deg, rgba(255, 198, 68, 0.08) 0%, rgba(255, 198, 68, 0) 24%, rgba(255, 198, 68, 0) 76%, rgba(255, 198, 68, 0.08) 100%);
	pointer-events: none;
}

.section-bg-cream {
	background-color: var(--cream50);
}

.section-bg-mint {
	background-color: var(--cream100);
}

.section-label {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--neutral600);
	margin-bottom: 1rem;
}

.section-title {
	color: var(--neutral900);
	text-align: center;
	font-size: clamp(26px, 3vw, 32px);
	font-weight: 700;
	margin-bottom: 2rem;
}

/* ============================================
   BANNER SECTION REDESIGN
   ============================================ */

.swiper-container {
	overflow: hidden;
	margin-top: 2.5rem;
	transition: all 0.3s ease;
}

.banner-section .swiper-container {
	margin-top: 0;
	margin-bottom: 0;
}

@media (min-width: 1280px) {
	.banner-section .swiper-container {
		max-width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-banner-max));
		margin-left: auto;
		margin-right: auto;
		margin-top: clamp(20px, 2vw, 36px);
		margin-bottom: clamp(28px, 2.5vw, 44px);
		border-radius: clamp(20px, 1.8vw, 28px);
		box-shadow: 0 24px 60px rgba(18, 51, 132, 0.14);
	}
}

.swiper-pagination-bullet {
	background: rgba(255, 255, 255, 0.6) !important;
	width: 10px !important;
	height: 10px !important;
	transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
	background: white !important;
	width: 24px !important;
	border-radius: 5px !important;
}

/* ============================================
   PRODUCT SECTIONS REDESIGN
   ============================================ */

/* Section titles */
.new_arrivals_title {
	font-size: 24px;
	font-weight: 700;
	color: var(--neutral900) !important;
	text-align: center;
	margin-bottom: 2rem;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* Product cards - matching reference image */
.product_item {
	background: white;
	border-radius: 16px !important;
	padding: 20px;
	transition: all 0.3s ease;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	height: 100%;
	border: 1px solid rgba(0, 0, 0, 0.06);
}

.product_item:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-4px);
}

.product_image {
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 1rem;
	background: #fafafa;
	padding: 10px;
}

.product_image img {
	transition: transform 0.4s ease;
}

.product_item:hover .product_image img {
	transform: scale(1.05);
}

.product_name div a {
	color: var(--neutral900);
	font-weight: 500;
	font-size: 14px;
	transition: color 0.3s ease;
	display: block;
	margin-bottom: 8px;
}

.product_name div a:hover {
	color: var(--brand-primary-light);
}

.product_price {
	color: var(--neutral900);
	font-weight: 600;
	font-size: 16px;
}

/* Add to cart button */
.product_cart_button {
	background: var(--sage200);
	color: var(--neutral900);
	border-radius: 8px;
	font-weight: 600;
	transition: all 0.3s ease;
	font-size: 14px;
}

.product_cart_button:hover {
	background: var(--sage300);
	transform: scale(1.02);
}

/* Swiper containers */
.swiper-container-destacados-unique,
.swiper-container-comprados-unique {
	padding-bottom: 2rem;
	overflow: hidden !important;
}

.swiper-slide {
	height: auto;
	overflow: visible;
	padding: 0 !important;
}

/* Productos Destacados section - white background with product cards */
.swiper-container-destacados-unique .product_item {
	background: var(--cream50) !important;
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.swiper-container-destacados-unique .product-card {
	background: var(--white) !important;
	border: 1px solid rgba(0, 0, 0, 0.15) !important;
	border-radius: 16px !important;
	padding: 12px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
}

.swiper-container-destacados-unique .product-card:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-4px);
}

/* Los Más Comprados section - white background with cream product cards */
.swiper-container-comprados-unique .product_item {
	background: var(--cream50) !important;
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.swiper-container-comprados-unique .product-card {
	background: var(--white) !important;
	border: 1px solid rgba(0, 0, 0, 0.15) !important;
	border-radius: 16px !important;
	padding: 12px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
}

.swiper-container-comprados-unique .product-card:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-4px);
}

/* ============================================
   CATEGORY ICONS SECTION
   ============================================ */

#categories-mobile {
	background: transparent;
	padding: 0.5rem 0;
}

.category-link {
	background: white;
	border-radius: 12px;
	padding: 1.5rem 1rem;
	margin: 0.5rem;
	transition: all 0.3s ease;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	border: 1px solid rgba(0, 0, 0, 0.06);
	text-decoration: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 150px;
}

.category-link:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-4px);
}

.category-img {
	width: 80px;
	height: 80px;
	object-fit: contain;
	margin-bottom: 1rem;
	border-radius: 8px;
}

.category-text {
	font-size: 13px;
	font-weight: 600;
	color: var(--neutral800);
	text-align: center;
	margin: 0;
	line-height: 1.3;
}

.btn-categories {
	width: 80px;
	height: 80px;
	background: var(--sage100);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	transition: all 0.3s ease;
}

.btn-categories:hover {
	background: var(--sage200);
	transform: scale(1.05);
}

.btn-categories i {
	color: var(--brand-primary);
}

/* ============================================
   FEATURED PRODUCTS / DESTACADOS
   ============================================ */

.destacados-section {
	padding: clamp(2.5rem, 3.5vw, 4rem) 0;
}

.mas-comprados-section,
.categories-section {
	padding: clamp(2.5rem, 3.5vw, 4rem) 0;
}

.destacados-section .container,
.mas-comprados-section .container {
	padding: 0;
}

.categories-section .row {
	padding: clamp(8px, 2vw, 16px);
}

.homepage-container .row.mb-4.justify-content-center {
	margin-left: 0;
	margin-right: 0;
}

#placeholder-wrapper-colecciones-tiendas-oficiales,
#placeholder-wrapper-colecciones-tiendas-oficiales > section {
	margin: 0;
	padding: 0;
}

/* ============================================
   CALL TO ACTION / NEWSLETTER
   ============================================ */

.newsletter_section {
	background: linear-gradient(135deg, var(--brand-primary-light) 0%, var(--brand-primary) 100%);
	border-radius: 24px;
	padding: 3rem;
	margin: 3rem 0;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.newsletter_title {
	color: white;
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 1rem;
}

.newsletter_input {
	border-radius: 50px;
	border: none;
	padding: 14px 24px;
	font-size: 15px;
}

.newsletter_button {
	border-radius: 50px !important;
	background: var(--accent500) !important;
	border: none;
	padding: 14px 32px !important;
	font-weight: 600;
	transition: all 0.3s ease;
}

.newsletter_button:hover {
	background: var(--accent600) !important;
	transform: scale(1.05);
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

#scrollTopButton {
	background: white !important;
	color: var(--neutral800) !important;
	border-radius: 50px;
	padding: 12px 24px;
	font-weight: 600;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	transition: all 0.3s ease;
	cursor: pointer;
}

#scrollTopButton:hover {
	background: var(--sage200) !important;
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

/* ============================================
   CONTAINER & SPACING
   ============================================ */


.homepage-container .container {
	width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-shell-max));
	max-width: var(--homepage-shell-max);
	padding-left: clamp(12px, 1.6vw, 20px);
	padding-right: clamp(12px, 1.6vw, 20px);
}

/* Increase max-width for big screens */
@media (min-width: 1280px) {
	:root {
		--homepage-shell-max: 1460px;
		--homepage-banner-max: 1420px;
		--homepage-featured-card-min: 208px;
		--homepage-featured-card-max: 256px;
		--homepage-featured-title-size: 1rem;
		--homepage-featured-price-size: 1.08rem;
	}
}

@media (min-width: 1400px) {
	:root {
		--homepage-shell-max: 1540px;
		--homepage-banner-max: 1480px;
		--homepage-featured-card-min: 220px;
		--homepage-featured-card-max: 270px;
		--homepage-featured-title-size: 1.04rem;
		--homepage-featured-price-size: 1.12rem;
	}
}

@media (min-width: 1600px) {
	:root {
		--homepage-shell-max: 1640px;
		--homepage-banner-max: 1620px;
	}
}

@media (min-width: 1920px) {
	:root {
		--homepage-shell-max: 1760px;
		--homepage-banner-max: 1760px;
		--homepage-shell-gutter: clamp(28px, 2.4vw, 56px);
		--homepage-carousel-side-padding: clamp(28px, 2.8vw, 88px);
		--homepage-featured-card-min: 236px;
		--homepage-featured-card-max: 288px;
		--homepage-featured-title-size: 1.08rem;
		--homepage-featured-price-size: 1.16rem;
	}
}

@media (min-width: 2560px) {
	:root {
		--homepage-shell-max: 1880px;
		--homepage-banner-max: 1880px;
		--homepage-shell-gutter: clamp(32px, 2vw, 72px);
		--homepage-carousel-side-padding: clamp(32px, 2.6vw, 104px);
	}
}

.homepage-container .destacados-section .container,
.homepage-container .mas-comprados-section .container,
.homepage-container .categories-section .container {
	max-width: none;
}

.homepage-container .destacados-carousel-wrapper,
.homepage-container .comprados-carousel-wrapper {
	padding: 0 var(--homepage-carousel-side-padding);
}

.homepage-container .swiper-container-destacados-unique,
.homepage-container .swiper-container-comprados-unique {
	padding-left: 0;
	padding-right: 0;
	padding-bottom: 2.5rem;
}

.homepage-container .swiper-container-destacados-unique .swiper-wrapper,
.homepage-container .swiper-container-comprados-unique .swiper-wrapper {
	align-items: stretch;
}

.homepage-container .swiper-container-destacados-unique .swiper-slide,
.homepage-container .swiper-container-comprados-unique .swiper-slide {
	height: auto;
}

.homepage-container .product-card--homepage {
	width: 100%;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	max-width: var(--homepage-featured-card-max);
	margin: 0 auto;
}

.homepage-container .product-card__image-container--homepage {
	width: 100%;
	max-width: none;
	min-width: 0;
	aspect-ratio: 1.45 / 1;
	height: auto;
	margin: 0 auto;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	box-sizing: border-box;
}

.homepage-container .product-card__image {
	width: auto !important;
	height: auto !important;
	max-width: calc(100% - 2px);
	max-height: calc(100% - 2px);
	margin: 0 !important;
	display: block;
	object-fit: contain;
	object-position: center center;
	flex: 0 1 auto;
}

.homepage-container .product-card__content {
	padding: 12px 2px 2px;
	gap: 8px;
}

.homepage-container .product-card__title {
	font-size: var(--homepage-featured-title-size);
	line-height: 1.3;
	min-height: 2.6em;
	max-height: 2.6em;
	-webkit-line-clamp: 2;
	margin-bottom: 0;
}

.homepage-container .product-card__price {
	font-size: var(--homepage-featured-price-size);
}

.homepage-container .product-card__view-btn {
	width: 36px;
	height: 36px;
}

.homepage-container #categories-mobile {
	width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-shell-max));
	margin: 0 auto;
	padding-left: clamp(12px, 1.6vw, 20px);
	padding-right: clamp(12px, 1.6vw, 20px);
}

.homepage-container .category-link {
	max-width: none;
	min-height: 100%;
}

/* Add spacing between sections */
section {
	margin: 0.25rem 0;
}

/* Reduce title row margins */
.section-wrapper .row.mb-4 {
	margin-bottom: 1rem !important;
}

/* ============================================
   ADDITIONAL STYLING REFINEMENTS
   ============================================ */

/* Ensure all product cards have consistent rounded corners */
.product_item,
.swiper-slide .product_item,
.product-card {
	border-radius: 16px !important;
	overflow: hidden;
}

/* Better image container styling */
.product_image,
.product-image {
	border-radius: 12px !important;
	overflow: hidden;
}

/* Remove any conflicting backgrounds that hide rounded corners */
.swiper-container-destacados-unique,
.swiper-container-comprados-unique {
	background: transparent !important;
}

.swiper-wrapper {
	background: transparent !important;
}

.swiper-slide {
	background: transparent !important;
	padding: 0 !important;
	overflow: visible;
}

/* Ensure product items have proper spacing and visibility */
.swiper-container-destacados-unique .swiper-slide,
.swiper-container-comprados-unique .swiper-slide {
	background: transparent !important;
}

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


@media (max-width: 768px) {
	.swiper-container {
		border-radius: 0;
		width: 100%;
	}

	.product_item {
		border-radius: 12px;
		padding: 16px;
	}

	.new_arrivals_title {
		font-size: 24px;
	}

	.categories_icons {
		border-radius: 16px;
		padding: 2rem 1rem;
	}

	.newsletter_section {
		border-radius: 16px;
		padding: 2rem 1.5rem;
	}

	.newsletter_title {
		font-size: 22px;
	}
}

@media (min-width: 1024px) {
	.homepage-container .product-card--homepage {
		max-width: none;
	}
}

@media (min-width: 1280px) {
	.homepage-container .destacados-section .section-title,
	.homepage-container .mas-comprados-section .section-title,
	.homepage-container .categories-section .section-title {
		margin-bottom: 2.5rem;
	}

	.homepage-container .product-card--homepage {
		padding: 12px;
	}

	.homepage-container .new_arrivals_title {
		font-size: 28px;
	}

	.homepage-container .banner-section .swiper-container {
		margin-top: 28px;
		margin-bottom: 36px;
	}

	.homepage-container .destacados-carousel-wrapper,
	.homepage-container .comprados-carousel-wrapper {
		padding-left: 72px;
		padding-right: 72px;
	}
}

@media (min-width: 1920px) {
	.homepage-container .banner-section .swiper-container {
		max-width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-banner-max));
		border-radius: 30px;
	}

	.homepage-container .container,
	.homepage-container #categories-mobile {
		width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-shell-max));
		max-width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-shell-max));
	}
}

@media (min-width: 2560px) {
	.homepage-container .banner-section .swiper-container {
		max-width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-banner-max));
	}

	.homepage-container .container,
	.homepage-container #categories-mobile {
		width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-shell-max));
		max-width: min(calc(100vw - (var(--homepage-shell-gutter) * 2)), var(--homepage-shell-max));
	}
}

@media (max-width: 480px) {
	.new_arrivals_title {
		font-size: 20px;
	}

	.product_item {
		padding: 12px;
	}

	.swiper-container {
		width: 100%;
		margin-top: 1.5rem;
	}
}

/* ============================================
   SMOOTH ANIMATIONS
   ============================================ */

* {
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade in animation for sections */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.animated-section {
	animation: fadeInUp 0.6s ease-out;
}
