/* GrL'Ca Divi Shop View Switcher — colours and sizes come from the settings as CSS variables. */

/* Products stay hidden until the saved view is applied (no grid→list flash).
   If the script never runs, they appear anyway after 1.5 s. */
.et_pb_shop .products {
	opacity: 0;
	transition: opacity .3s ease;
	animation: grlca-dsvs-reveal 0s linear 1.5s forwards;
}

.et_pb_shop .products.initialized {
	opacity: 1;
	animation: none;
}

@keyframes grlca-dsvs-reveal {
	to { opacity: 1; }
}

/* Switcher buttons */
.shop-view-switcher {
	text-align: right;
	margin-bottom: 20px;
	padding: 0 10px;
}

.shop-view-switcher .view-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: 8px;
	padding: var(--grlca-dsvs-pad, 10px) 16px;
	border: none;
	border-radius: var(--grlca-dsvs-radius, 25px);
	background: var(--grlca-dsvs-off-bg, #f8f9fa);
	color: var(--grlca-dsvs-off-text, #666);
	font-size: var(--grlca-dsvs-font, 14px);
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
	transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.shop-view-switcher .view-btn.active,
.shop-view-switcher .view-btn:hover,
.shop-view-switcher .view-btn:focus-visible {
	background: var(--grlca-dsvs-bg, #2ea3f2);
	color: var(--grlca-dsvs-text, #fff);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.shop-view-switcher .view-btn:hover {
	transform: translateY(-1px);
}

.shop-view-switcher .view-icon {
	font-size: 16px;
}

/* LIST VIEW — override Divi's grid */
body.shop-list .et_pb_shop .products {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.shop-list .et_pb_shop .product,
body.shop-list .et_pb_shop .product.et_pb_grid_item,
body.shop-list .et_pb_shop .product.et_pb_portfolio_item {
	display: flex !important;
	flex-direction: column !important;
	float: none !important;
	clear: both !important;
	position: relative !important;
	inset: auto !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 15px 0 !important;
	border-bottom: 1px solid #eaeaea;
	background: transparent !important;
	box-shadow: none !important;
}

body.shop-list .et_pb_shop .product:last-child {
	border-bottom: none;
}

body.shop-list .et_pb_shop .product img {
	display: none !important;
}

body.shop-list .et_pb_shop .product .grlca-dsvs-title-link {
	color: inherit;
	text-decoration: none;
}

body.shop-list .et_pb_shop .product .woocommerce-loop-product__title {
	display: block !important;
	width: 100% !important;
	margin: 0 0 8px !important;
	padding: 0 15px !important;
	font-size: 16px !important;
	font-weight: 600;
	line-height: 1.4 !important;
	text-align: left;
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
}

body.shop-list .et_pb_shop .product .product-actions {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	gap: 15px;
	width: 100% !important;
	padding: 0 15px !important;
}

body.shop-list .et_pb_shop .product .price {
	flex-shrink: 0;
	margin: 0 !important;
	color: #222;
	font-size: 16px !important;
	font-weight: 600;
	text-align: left !important;
	white-space: nowrap !important;
}

body.shop-list .et_pb_shop .product .product-actions .grlca-dac-wrap {
	width: auto;
	margin: 0;
	padding: 0;
}

body.shop-list .et_pb_shop .product a.button,
body.shop-list .et_pb_shop .product .button {
	flex-shrink: 0;
	min-width: 120px !important;
	margin: 0 !important;
	padding: 8px 16px !important;
	font-size: 14px !important;
	text-align: center;
	white-space: nowrap !important;
}

/* Divi grid helpers inside the list (1.0.x used `.columns-*`, which is not valid
   CSS and made the browser drop the whole rule). */
body.shop-list .et_pb_shop .products .et_pb_module,
body.shop-list .et_pb_shop .products .et_pb_column,
body.shop-list .et_pb_shop .products .et_pb_row,
body.shop-list .et_pb_shop .products [class*="columns-"] {
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Short descriptions are hidden in both views (as in 1.0.x). */
body.shop-grid .et_pb_shop .product .woocommerce-product-details__short-description,
body.shop-list .et_pb_shop .product .woocommerce-product-details__short-description {
	display: none !important;
}

@media (max-width: 980px) {
	.shop-view-switcher .view-btn .view-text {
		display: none;
	}

	/* The list uses the full screen width on tablets and phones. */
	body.shop-list .et_pb_shop {
		width: 100vw !important;
		max-width: 100vw !important;
		margin-left: calc(-50vw + 50%) !important;
		margin-right: calc(-50vw + 50%) !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	body.shop-list .et_pb_shop .product {
		padding: 12px 5% !important;
	}

	body.shop-list .et_pb_shop .product .woocommerce-loop-product__title {
		padding: 0 !important;
		margin-bottom: 6px !important;
		font-size: 15px !important;
		overflow-wrap: anywhere;
	}

	body.shop-list .et_pb_shop .product .product-actions {
		padding: 0 !important;
		gap: 12px;
	}

	body.shop-list .et_pb_shop .product .price {
		font-size: 15px !important;
	}

	body.shop-list .et_pb_shop .product a.button,
	body.shop-list .et_pb_shop .product .button {
		min-width: 110px !important;
		padding: 7px 14px !important;
		font-size: 13px !important;
	}
}

@media (max-width: 480px) {
	body.shop-list .et_pb_shop .product .woocommerce-loop-product__title {
		font-size: 13px !important;
		line-height: 1.3 !important;
	}

	body.shop-list .et_pb_shop .product .product-actions {
		flex-wrap: wrap;
		gap: 8px;
	}

	body.shop-list .et_pb_shop .product .price {
		font-size: 13px !important;
	}

	body.shop-list .et_pb_shop .product a.button,
	body.shop-list .et_pb_shop .product .button {
		min-width: 90px !important;
		padding: 5px 10px !important;
		font-size: 11px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.et_pb_shop .products,
	.shop-view-switcher .view-btn {
		transition: none;
	}
}
