/* 四元商品元件 for Elementor */

.sypw-editor-notice {
	padding: 10px 14px;
	margin-bottom: 12px;
	border: 1px dashed #93003c;
	border-radius: 6px;
	background: #fdf2f6;
	color: #93003c;
	font-size: 13px;
	line-height: 1.5;
}

/* =========================================================
 * 商品分類
 * ====================================================== */

.sypw-cats {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sypw-cats--list {
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}

.sypw-cats--pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.sypw-cats .sypw-cat {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	text-align: inherit;
	text-decoration: none;
	color: #1a1a1a;
	background: #fff;
	border: 1px solid #e7e7e7;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s;
}

.sypw-cats div.sypw-cat {
	cursor: default;
}

.sypw-cats a.sypw-cat:hover,
.sypw-cats button.sypw-cat:hover {
	border-color: #c9c9c9;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

.sypw-cats .sypw-cat:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.sypw-cats .sypw-cat.is-active {
	background: #1a1a1a;
	border-color: #1a1a1a;
	color: #fff;
}

.sypw-cats .sypw-cat.is-active .sypw-cat__name {
	color: inherit;
}

.sypw-cat__media {
	display: block;
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f4f4f4;
}

.sypw-cat__media img.sypw-cat__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	transition: transform .5s ease;
}

.sypw-zoom-yes .sypw-cat:hover .sypw-cat__img {
	transform: scale(1.06);
}

.sypw-cat__all-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #b5b5b5;
}

.sypw-cat__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
}

.sypw-cat__name {
	font-weight: 600;
	line-height: 1.4;
	color: inherit;
}

.sypw-cat__count {
	font-size: .85em;
	opacity: .6;
}

.sypw-cat__desc {
	font-size: .9em;
	line-height: 1.6;
	opacity: .8;
}

/* 清單 */
.sypw-cats--list .sypw-cat {
	flex-direction: row;
	align-items: center;
	gap: 16px;
	padding: 12px;
}

.sypw-cats--list .sypw-cat__media {
	flex: 0 0 auto;
	width: 72px;
	border-radius: 8px;
}

.sypw-cats--list .sypw-cat__body {
	padding: 0;
	flex: 1;
}

/* 標籤按鈕 */
.sypw-cats--pills .sypw-cat {
	flex: 0 0 auto;
	flex-direction: row;
	align-items: center;
	padding: 8px 18px;
	border-radius: 999px;
	white-space: nowrap;
}

.sypw-cats--pills .sypw-cat__body {
	flex-direction: row;
	align-items: baseline;
	gap: 6px;
	padding: 0;
}

@media (max-width: 1024px) {
	.sypw-cats--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.sypw-cats--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

	.sypw-cats--pills.sypw-cats--scroll {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 2px;
	}

	.sypw-cats--pills.sypw-cats--scroll::-webkit-scrollbar { display: none; }
}

/* =========================================================
 * 商品卡片
 * ====================================================== */

.sypw-products {
	position: relative;
}

.sypw-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	transition: opacity .2s;
}

.sypw-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow .25s, transform .25s, border-color .25s, background-color .25s;
}

.sypw-card:hover {
	box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
}

.sypw-lift-yes .sypw-card:hover {
	transform: translateY(-4px);
}

.sypw-card .sypw-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f6f6f6;
}

.sypw-card .sypw-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
	transition: transform .5s ease;
}

.sypw-zoom-yes .sypw-card:hover .sypw-card__media img {
	transform: scale(1.06);
}

.sypw-card__badges {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.sypw-badge-right .sypw-card__badges {
	left: auto;
	right: 12px;
	align-items: flex-end;
}

.sypw-card__badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: #fff;
	background: #d63638;
}

.sypw-card__badge--oos {
	background: #555;
}

.sypw-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 6px;
	padding: 16px;
}

.sypw-card__cat {
	font-size: 12px;
	letter-spacing: .04em;
	opacity: .55;
}

.sypw-card .sypw-card__title {
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.45;
}

.sypw-card .sypw-card__title a {
	color: #1a1a1a;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sypw-card__rating .star-rating {
	float: none;
	margin: 0;
	font-size: 13px;
}

.sypw-card__body .sypw-card__rating .star-rating {
	display: inline-block;
}

.sypw-card__excerpt {
	font-size: 14px;
	line-height: 1.6;
	opacity: .75;
}

.sypw-card__footer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: auto;
	padding-top: 6px;
}

.sypw-card__price {
	font-size: 16px;
	font-weight: 700;
	color: #1a1a1a;
}

.sypw-card__price del {
	margin-right: 6px;
	font-size: .85em;
	font-weight: 400;
	opacity: .45;
}

.sypw-card__price ins {
	text-decoration: none;
	color: #d63638;
}

.sypw-card .sypw-card__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	gap: 6px;
	padding: 10px 18px;
	border: 1px solid #1a1a1a;
	border-radius: 8px;
	background: #1a1a1a;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}

.sypw-card .sypw-card__button:hover {
	background: #fff;
	color: #1a1a1a;
}

.sypw-btn-full-yes .sypw-card .sypw-card__button {
	align-self: stretch;
}

.sypw-card .sypw-card__button.loading {
	opacity: .6;
	pointer-events: none;
}

.sypw-card .sypw-card__button.added::after {
	content: "✓";
}

.sypw-card .added_to_cart {
	display: block;
	font-size: 13px;
	text-align: center;
	text-decoration: underline;
}

.sypw-empty {
	grid-column: 1 / -1;
	padding: 48px 16px;
	text-align: center;
	opacity: .65;
}

/* 載入中 */
.sypw-products.is-loading .sypw-grid {
	opacity: .35;
	pointer-events: none;
}

.sypw-products.is-loading::after {
	content: "";
	position: absolute;
	top: 80px;
	left: 50%;
	width: 32px;
	height: 32px;
	margin-left: -16px;
	border: 3px solid rgba(0, 0, 0, .15);
	border-top-color: rgba(0, 0, 0, .65);
	border-radius: 50%;
	animation: sypw-spin .7s linear infinite;
}

@keyframes sypw-spin {
	to { transform: rotate(360deg); }
}

.sypw-error {
	grid-column: 1 / -1;
	padding: 16px;
	text-align: center;
	color: #d63638;
}

/* 分頁 */
.sypw-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 32px;
}

.sypw-products .sypw-page,
.sypw-products .sypw-loadmore {
	min-width: 40px;
	height: 40px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #1a1a1a;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s;
}

.sypw-products .sypw-loadmore {
	height: 46px;
	padding: 0 36px;
	border-radius: 999px;
}

.sypw-products .sypw-page:hover,
.sypw-products .sypw-page.is-current,
.sypw-products .sypw-loadmore:hover {
	background: #1a1a1a;
	border-color: #1a1a1a;
	color: #fff;
}

.sypw-page-gap {
	padding: 0 4px;
	opacity: .5;
}

@media (max-width: 1024px) {
	.sypw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.sypw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.sypw-card__body { padding: 12px; }
	.sypw-card .sypw-card__title { font-size: 14px; }
	.sypw-card .sypw-card__button { padding: 9px 12px; font-size: 13px; }
}
