/**
 * Ecocartify Responsive Stylesheet
 *
 * Smooth mobile shopping, mobile drawer, touch targets,
 * adaptive product grids, and responsive cart/checkout.
 */

/* ==========================================================================
   Desktop Large & Laptops (<= 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
	.ecocartify-product-grid.columns-5 {
		grid-template-columns: repeat(4, 1fr);
	}
	
	.hero-title {
		font-size: 28px;
	}

	.top-selling-grid {
		gap: 16px !important;
	}
}

/* ==========================================================================
   Tablets & Medium Screens (<= 992px)
   ========================================================================== */
@media (max-width: 992px) {
	.ecocartify-hero-grid {
		grid-template-columns: 1fr !important;
	}

	.hero-main-banner {
		height: 320px !important;
		max-height: 320px !important;
	}

	.hero-side-banner {
		height: auto !important;
		max-height: none !important;
	}

	.side-banner-card {
		padding: 24px;
	}

	.ecocartify-product-grid.columns-5,
	.ecocartify-product-grid.columns-4 {
		grid-template-columns: repeat(3, 1fr);
	}

	.top-selling-grid {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 16px !important;
	}

	.trust-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.brands-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.ecocartify-footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: 24px;
	}

	.ecocartify-single-product-container .product {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.ecocartify-shop-layout {
		flex-direction: column;
	}

	.ecocartify-shop-sidebar {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		width: 300px;
		height: 100%;
		background: #ffffff;
		z-index: 10000;
		padding: 20px;
		box-shadow: var(--ec-shadow-lg);
		overflow-y: auto;
	}

	.ecocartify-shop-sidebar.is-open {
		display: block;
	}

	.sidebar-header-mobile {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 20px;
		padding-bottom: 10px;
		border-bottom: 1px solid var(--ec-border);
	}

	.ecocartify-mobile-filter-trigger {
		display: inline-flex;
	}
}

/* ==========================================================================
   Mobile Devices & Small Screens (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
	/* Mobile Header: Strict 1-row top line (Toggle + Logo + Actions) */
	.ecocartify-main-header {
		padding: 8px 0 10px;
	}

	.ecocartify-header-row {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		row-gap: 8px;
		column-gap: 4px;
	}

	.ecocartify-mobile-toggle-wrap {
		order: 1;
		flex: 0 0 auto;
		display: flex;
		align-items: center;
	}

	.ecocartify-mobile-nav-toggle {
		background: transparent;
		border: none;
		padding: 4px 6px;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 20px;
		color: var(--ec-dark);
		line-height: 1;
	}

	.ecocartify-logo-area {
		order: 2;
		flex: 1 1 auto;
		min-width: 0; /* Prevents overflow pushing items to new line */
		max-width: calc(100% - 150px);
		display: flex;
		align-items: center;
		padding-left: 2px;
	}

	.ecocartify-text-logo,
	.custom-logo-link {
		display: flex;
		align-items: center;
		gap: 6px;
		min-width: 0;
		max-width: 100%;
		text-decoration: none;
	}

	.logo-leaf {
		font-size: 20px;
		line-height: 1;
		flex-shrink: 0;
	}

	.logo-leaf svg {
		width: 20px;
		height: 20px;
	}

	.logo-text {
		min-width: 0;
		overflow: hidden;
		display: block;
	}

	.logo-main {
		font-size: 15px !important;
		font-weight: 800;
		color: var(--ec-dark);
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		line-height: 1.2;
		display: block;
	}

	.logo-tagline {
		display: none !important;
	}

	.ecocartify-logo-area img.custom-logo {
		max-height: 28px !important;
		max-width: 110px !important;
		width: auto;
		height: auto;
		object-fit: contain;
	}

	.ecocartify-header-actions {
		order: 3;
		flex: 0 0 auto;
		margin-left: auto;
		display: flex;
		align-items: center;
		gap: 8px;
	}

	.ecocartify-header-actions .ecocartify-header-action-btn {
		padding: 2px 4px;
	}

	.ecocartify-header-actions .action-icon {
		font-size: 19px;
		margin-bottom: 0;
		line-height: 1;
		color: #374151;
	}

	.ecocartify-header-actions .action-icon svg {
		width: 19px;
		height: 19px;
	}

	.ecocartify-header-actions .action-label {
		display: none !important;
	}

	.action-track, .action-wishlist {
		display: none !important;
	}

	.ecocartify-cart-count {
		top: -6px;
		right: -7px;
		min-width: 15px;
		height: 15px;
		line-height: 15px;
		font-size: 9px;
		padding: 0 2px;
	}

	.ecocartify-search-area {
		order: 4;
		flex: 0 0 100%;
		width: 100%;
		max-width: 100%;
		margin-top: 2px;
	}

	.search-input-group .search-field {
		height: 38px;
		padding: 8px 14px;
		font-size: 13px;
	}

	.search-input-group .search-submit {
		padding: 8px 12px;
		font-size: 14px;
	}

	/* Hero Slider on Mobile: Strictly Horizontal Carousel, Single Box */
	.ecocartify-hero-grid {
		grid-template-columns: 1fr !important;
	}

	.hero-main-banner {
		height: clamp(165px, 48vw, 210px) !important;
		max-height: 210px !important;
		min-width: 0 !important;
		width: 100% !important;
		overflow: hidden !important;
		border-radius: 10px !important;
		box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
	}

	.hero-slider-container {
		height: 100% !important;
		width: 100% !important;
		overflow: hidden !important;
		border-radius: 10px !important;
	}

	.hero-slider-track {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		height: 100% !important;
		width: 100% !important;
	}

	.hero-slide {
		height: 100% !important;
		min-width: 100% !important;
		max-width: 100% !important;
		width: 100% !important;
		flex: 0 0 100% !important;
		flex-shrink: 0 !important;
		padding: 12px 14px !important;
		flex-direction: row !important;
		align-items: center !important;
		justify-content: space-between !important;
		box-sizing: border-box !important;
		border-radius: 10px !important;
		background-size: cover !important;
		background-position: center !important;
	}

	.hero-banner-content {
		max-width: calc(100% - 60px) !important;
	}

	.hero-title {
		font-size: 15px !important;
		line-height: 1.25 !important;
		margin-bottom: 4px !important;
	}

	.hero-subtitle {
		font-size: 10.5px !important;
		line-height: 1.3 !important;
		margin-bottom: 8px !important;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.hero-primary-btn,
	.hero-outline-btn {
		padding: 5px 12px !important;
		font-size: 10.5px !important;
	}

	.hero-deal-pill {
		width: 50px !important;
		height: 50px !important;
		flex-shrink: 0 !important;
	}

	.hero-deal-pill .deal-pct {
		font-size: 14px !important;
	}

	.hero-deal-pill .deal-save,
	.hero-deal-pill .deal-off {
		font-size: 7.5px !important;
	}

	.hero-side-banner {
		display: none !important;
	}

	/* Force Strict 2-Column Product Grid on Mobile (ডাবল ডাবল শো করবে) */
	.ecocartify-product-grid.columns-5,
	.ecocartify-product-grid.columns-4,
	.ecocartify-product-grid.columns-3,
	.ecocartify-product-grid.columns-2,
	.ecocartify-product-grid,
	.top-selling-grid,
	ul.products,
	.woocommerce ul.products,
	.woocommerce-page ul.products,
	.woocommerce ul.products[class*="columns-"],
	.woocommerce-page ul.products[class*="columns-"],
	.elementor-widget-ecocartify_product_grid .ecocartify-product-grid {
		display: grid !important;
		grid-template-columns: repeat(var(--ec-cols-mobile, 2), minmax(0, 1fr)) !important;
		gap: 10px !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		list-style: none !important;
		float: none !important;
		clear: both !important;
	}

	.ecocartify-product-card,
	ul.products li.product,
	.woocommerce ul.products li.product,
	.woocommerce-page ul.products li.product,
	.woocommerce ul.products[class*="columns-"] li.product {
		display: flex !important;
		flex-direction: column !important;
		justify-content: space-between !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin: 0 !important;
		padding: 10px 8px !important;
		float: none !important;
		clear: none !important;
		box-sizing: border-box !important;
	}

	.product-card-thumb-wrap {
		width: 100%;
		aspect-ratio: 1 / 1;
		margin-bottom: 8px;
	}

	.ecocartify-badge {
		font-size: 9px;
		padding: 2px 5px;
	}

	.product-card-title {
		font-size: 12.5px;
		min-height: 32px;
		line-height: 1.3;
		margin-bottom: 6px;
	}

	.product-card-price {
		font-size: 13.5px;
		margin-bottom: 8px;
	}

	.product-card-actions {
		display: flex !important;
		flex-direction: column !important;
		gap: 6px !important;
		width: 100% !important;
	}

	.ecocartify-add-to-cart-btn,
	.ecocartify-buy-now-btn {
		width: 100% !important;
		padding: 7px 8px !important;
		font-size: 11.5px !important;
		border-radius: 4px !important;
		justify-content: center !important;
		text-align: center !important;
	}

	.ecocartify-add-to-cart-btn svg {
		width: 13px;
		height: 13px;
	}

	.top-selling-grid .ecocartify-product-card {
		flex-direction: column !important;
		align-items: stretch !important;
		padding: 10px 8px !important;
	}

	.top-selling-grid .product-card-thumb-wrap {
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 1 / 1 !important;
	}

	.top-selling-grid .product-card-actions {
		display: flex !important;
		flex-direction: column !important;
		width: 100% !important;
	/* Mobile Categories Single Row (Strictly 3 Items Visible with Smooth Scroll) */
	.categories-carousel-wrap {
		display: flex !important;
		flex-direction: row !important;
		align-items: center !important;
		justify-content: space-between !important;
		gap: 6px !important;
		padding: 0 2px !important;
		width: 100% !important;
	}

	.category-nav-arrow {
		flex: 0 0 32px !important;
		width: 32px !important;
		height: 32px !important;
		min-width: 32px !important;
		font-size: 18px !important;
		border-radius: 50% !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		position: static !important;
		transform: none !important;
		margin: 0 !important;
	}

	.category-arrow-prev {
		order: 1 !important;
	}

	.categories-carousel-track {
		order: 2 !important;
		flex: 1 1 auto !important;
		min-width: 0 !important;
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		gap: 10px !important;
		padding: 6px 2px 10px !important;
		overflow-x: auto !important;
		overflow-y: hidden !important;
		scrollbar-width: none !important;
		-webkit-overflow-scrolling: touch !important;
	}

	.category-arrow-next {
		order: 3 !important;
	}

	.category-card-item {
		flex: 0 0 calc((100% - 20px) / 3) !important;
		min-width: calc((100% - 20px) / 3) !important;
		max-width: calc((100% - 20px) / 3) !important;
		box-sizing: border-box !important;
	}

	.category-card-box {
		width: 82px !important;
		height: 82px !important;
		border-radius: 14px !important;
		margin-bottom: 6px !important;
	}

	.category-card-title {
		font-size: 11.5px !important;
		font-weight: 700 !important;
	}

	.cart-drawer-panel {
		max-width: 100%;
	}

	.floating-cart-btn {
		padding: 8px 10px;
	}

	.floating-cart-count {
		font-size: 9px;
	}

	.floating-cart-total {
		font-size: 11px;
	}

	.floating-whatsapp-btn {
		width: 44px;
		height: 44px;
		font-size: 22px;
		bottom: 16px;
		right: 16px;
	}

	.ecocartify-back-to-top {
		width: 38px;
		height: 38px;
		font-size: 18px;
		bottom: 68px;
		right: 18px;
	}

	#customer_details {
		grid-template-columns: 1fr;
	}

	.footer-bottom-flex {
		flex-direction: column;
		text-align: center;
		gap: 8px;
	}
}

/* ==========================================================================
   Mobile Drawer Styling
   ========================================================================== */
.ecocartify-mobile-drawer {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10001;
	visibility: hidden;
	transition: visibility 0.3s ease;
}

.ecocartify-mobile-drawer.is-open {
	visibility: visible;
}

.mobile-drawer-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ecocartify-mobile-drawer.is-open .mobile-drawer-overlay {
	opacity: 1;
}

.mobile-drawer-inner {
	position: absolute;
	top: 0;
	left: 0;
	width: 85%;
	max-width: 320px;
	height: 100%;
	background: #ffffff;
	box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
	transform: translateX(-100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	flex-direction: column;
	z-index: 2;
}

.ecocartify-mobile-drawer.is-open .mobile-drawer-inner {
	transform: translateX(0);
}

.mobile-drawer-top-action {
	display: flex;
	justify-content: flex-end;
	padding: 10px 14px 4px;
}

.mobile-drawer-close {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #4b5563;
}

.mobile-drawer-close svg {
	width: 22px;
	height: 22px;
}

/* User Greeting Banner (Matching Reference Image) */
.drawer-user-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #f27922;
	border-radius: 10px;
	margin: 0 14px 14px;
	padding: 12px 16px;
	text-decoration: none;
	color: #ffffff !important;
	box-shadow: 0 2px 8px rgba(242, 121, 34, 0.25);
}

.drawer-user-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #9ca3af;
	flex-shrink: 0;
}

.drawer-user-avatar svg {
	width: 22px;
	height: 22px;
	color: #cbd5e1;
}

.drawer-user-info {
	display: flex;
	flex-direction: column;
}

.drawer-user-greeting {
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.2;
}

.drawer-user-action {
	font-size: 12.5px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.9);
	line-height: 1.2;
}

/* White Rounded Category & Links Cards */
.drawer-card-box {
	background: #ffffff;
	border-radius: 12px;
	margin: 0 14px 16px;
	border: 1px solid #edf2f7;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
	overflow: hidden;
}

.drawer-cat-list,
.drawer-quick-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.drawer-cat-item {
	border-bottom: 1px solid #f3f4f6;
}

.drawer-cat-item:last-child {
	border-bottom: none;
}

.drawer-cat-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 11px 16px;
	font-size: 13.5px;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	transition: background 0.15s ease;
}

.drawer-cat-link:hover,
.drawer-cat-link:active {
	background: #fff7ed;
	color: #d96b17;
}

.drawer-arrow {
	font-size: 16px;
	color: #9ca3af;
	font-weight: 400;
}

/* Quick Links Header */
.drawer-section-heading {
	padding: 0 14px;
	margin-bottom: 8px;
}

.drawer-heading-title {
	font-size: 14.5px;
	font-weight: 700;
	color: #1f2937;
	margin: 0 0 4px;
}

.drawer-heading-underline {
	width: 28px;
	height: 3px;
	background: #f27922;
	border-radius: 2px;
}

.drawer-quick-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 16px;
	font-size: 13.5px;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	border-bottom: 1px solid #f3f4f6;
	transition: background 0.15s ease;
}

.drawer-quick-list li:last-child .drawer-quick-link {
	border-bottom: none;
}

.drawer-quick-link:hover {
	background: #fff7ed;
	color: #d96b17;
}

.drawer-quick-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #4b5563;
}

.drawer-quick-icon svg {
	width: 17px;
	height: 17px;
}

/* Mobile Bottom Fixed Navigation Bar (Matching Reference Image) */
@media (max-width: 768px) {
	body {
		padding-bottom: 56px !important;
	}

	.ecocartify-mobile-bottom-nav {
		display: grid !important;
		grid-template-columns: repeat(5, 1fr) !important;
		position: fixed !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		height: 56px !important;
		background: #d96b17 !important;
		z-index: 99999 !important;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15) !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	.mobile-nav-item {
		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 2px !important;
		color: rgba(255, 255, 255, 0.9) !important;
		text-decoration: none !important;
		background: transparent !important;
		border: none !important;
		cursor: pointer !important;
		padding: 4px 0 !important;
	}

	.mobile-nav-item.is-active,
	.mobile-nav-item:hover {
		color: #ffffff !important;
	}

	.mobile-nav-icon {
		position: relative !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		line-height: 1 !important;
	}

	.mobile-nav-icon svg {
		width: 20px !important;
		height: 20px !important;
		color: inherit !important;
	}

	.mobile-nav-label {
		font-size: 9px !important;
		font-weight: 700 !important;
		letter-spacing: 0.5px !important;
		color: inherit !important;
		text-transform: uppercase !important;
		line-height: 1 !important;
	}

	.mobile-nav-item .ecocartify-cart-count {
		position: absolute !important;
		top: -6px !important;
		right: -8px !important;
		background: #ffffff !important;
		color: #d96b17 !important;
		font-size: 9px !important;
		font-weight: 800 !important;
		min-width: 15px !important;
		height: 15px !important;
		line-height: 15px !important;
		border-radius: 50% !important;
		padding: 0 2px !important;
	}

	/* Floating Chat Position on Mobile above Bottom Nav */
	.ecocartify-floating-chat-widget {
		bottom: 70px !important;
	}

	.floating-whatsapp-btn {
		background: #f27922 !important;
		box-shadow: 0 4px 14px rgba(242, 121, 34, 0.4) !important;
	}

	.floating-whatsapp-btn svg {
		color: #ffffff !important;
	}
}

/* ==========================================================================
   Small Mobile Screens (<= 480px & <= 360px)
   ========================================================================== */
@media (max-width: 480px) {
	.trust-grid {
		grid-template-columns: 1fr;
	}

	.ecocartify-footer-grid {
		grid-template-columns: 1fr;
	}

	/* Maintain strict 2-column products */
	.ecocartify-product-grid.columns-5,
	.ecocartify-product-grid.columns-4,
	.ecocartify-product-grid.columns-3,
	.ecocartify-product-grid.columns-2,
	.ecocartify-product-grid,
	.top-selling-grid,
	ul.products,
	.woocommerce ul.products,
	.woocommerce-page ul.products,
	.woocommerce ul.products[class*="columns-"],
	.woocommerce-page ul.products[class*="columns-"],
	.elementor-widget-ecocartify_product_grid .ecocartify-product-grid {
		display: grid !important;
		grid-template-columns: repeat(var(--ec-cols-mobile, 2), minmax(0, 1fr)) !important;
		gap: 8px !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		list-style: none !important;
		float: none !important;
		clear: both !important;
	}

	.ecocartify-product-card,
	ul.products li.product,
	.woocommerce ul.products li.product,
	.woocommerce-page ul.products li.product,
	.woocommerce ul.products[class*="columns-"] li.product {
		display: flex !important;
		flex-direction: column !important;
		justify-content: space-between !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin: 0 !important;
		padding: 8px 6px !important;
		float: none !important;
		clear: none !important;
		box-sizing: border-box !important;
	}

	.product-card-title {
		font-size: 12px;
		min-height: 30px;
	}

	.product-card-price {
		font-size: 13px;
	}

	.ecocartify-add-to-cart-btn,
	.ecocartify-buy-now-btn {
		font-size: 11px !important;
		padding: 6px 4px !important;
	}

	.logo-main {
		font-size: 14px !important;
	}

	.ecocartify-header-actions {
		gap: 6px;
	}
}

@media (max-width: 360px) {
	.ecocartify-logo-area {
		max-width: calc(100% - 135px);
	}

	.logo-main {
		font-size: 13px !important;
	}

	.logo-leaf {
		font-size: 17px;
	}

	.ecocartify-header-actions {
		gap: 4px;
	}

	.ecocartify-header-actions .action-icon {
		font-size: 17px;
	}

	.ecocartify-header-actions .action-icon svg {
		width: 17px;
		height: 17px;
	}

	.ecocartify-cart-count {
		min-width: 14px;
		height: 14px;
		line-height: 14px;
		font-size: 8.5px;
	}
}

