/* Morphé shop, category and tag pages (woocommerce/archive-product.php). Builds on home.css (.mh tokens, cards, grid). */

body.woocommerce.archive { background: #fff; }
.ms-shop { padding-bottom: 56px; }

/* Header: breadcrumb, title, short category text */
.ms-head.mh-section { padding-top: 20px; }
.ms-crumbs { margin-bottom: 10px; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.ms-crumbs a { color: var(--ink-soft) !important; }
.ms-crumbs a:hover { color: var(--red) !important; }
.ms-title {
	margin: 0; color: var(--ink);
	font: 500 clamp(30px, 8.4vw, 52px)/1.06 var(--display); letter-spacing: -.01em; text-wrap: balance;
}
.ms-desc { margin-top: 12px; max-width: 62ch; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.ms-desc p { margin: 0 0 .8em; }
.ms-desc p:last-child { margin-bottom: 0; }

/* Category doors: small photos in a sideways row; the one she is in gets the window's gold line */
.ms-tools.mh-section { padding-top: 20px; }
.ms-doors__list {
	display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
	margin: 0 calc(var(--gutter) * -1) 20px !important; padding: 4px var(--gutter) 2px !important;
}
.ms-doors__list::-webkit-scrollbar { display: none; }
.ms-doors__list li { flex: none; }
.ms-door { display: block; width: 76px; }
.ms-door__img { display: block; aspect-ratio: 3 / 4; background: var(--floor); overflow: hidden; outline: 1.5px solid transparent; outline-offset: 3px; transition: outline-color .2s; }
.ms-door__img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transition: transform .6s var(--ease-out); }
.ms-door:hover .ms-door__img img { transform: scale(1.06); }
.ms-door__name {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	margin-top: 8px; text-align: center; font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--ink);
	transition: color .2s;
}
.ms-door:hover .ms-door__name { color: var(--red); }
.ms-door.is-on .ms-door__img { outline-color: var(--gold); }
.ms-door.is-on .ms-door__name { font-weight: 800; }

/* The doors slide in one after another as the page opens */
.ms-door { animation: ms-door-in .7s var(--ease-out) both; }
.ms-doors__list li:nth-child(2) .ms-door { animation-delay: .05s; }
.ms-doors__list li:nth-child(3) .ms-door { animation-delay: .1s; }
.ms-doors__list li:nth-child(4) .ms-door { animation-delay: .15s; }
.ms-doors__list li:nth-child(5) .ms-door { animation-delay: .2s; }
.ms-doors__list li:nth-child(n+6) .ms-door { animation-delay: .25s; }
@keyframes ms-door-in { from { opacity: 0; transform: translateX(28px); } }
.ms-door:active .ms-door__img { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
	.ms-door { animation: none; }
}

/* Size filter (inc/size-filter.php) inside the shop: the row runs to the screen edge */
.ms-shop .ms-sizes { margin: 0 0 16px; }
.ms-shop .ms-sizes__list { margin: 0 calc(var(--gutter) * -1) !important; padding: 0 var(--gutter) 2px !important; }

/* Count and sorting, on the gold shelf edge */
.ms-bar {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 12px 0; border-top: 1px solid var(--gold);
}
.ms-count { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.ms-shop .woocommerce-ordering { float: none; margin: 0; }
.ms-shop .woocommerce-ordering select.orderby {
	appearance: none; -webkit-appearance: none; height: 44px; max-width: 210px; margin: 0;
	padding: 0 34px 0 12px; border: 1px solid var(--ink); border-radius: 0; background: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 10px center;
	font: 600 14px/1 var(--body); color: var(--ink); cursor: pointer;
}
.ms-shop .woocommerce-ordering select.orderby:hover { border-color: var(--gold); }

/* Products */
.ms-products.mh-section { padding-top: 12px; }
.ms-shop .woocommerce-notices-wrapper:empty { display: none; }

/* Pages */
.ms-shop .woocommerce-pagination { margin-top: 40px; text-align: center; }
.ms-shop .woocommerce-pagination ul.page-numbers { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; border: 0 !important; margin: 0 !important; }
.ms-shop .woocommerce-pagination ul.page-numbers li { border: 0 !important; float: none; }
.ms-shop .woocommerce-pagination .page-numbers a,
.ms-shop .woocommerce-pagination .page-numbers span {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px;
	border: 1px solid #cfc9c9; background: #fff; color: var(--ink); font: 600 15px/1 var(--body);
	transition: border-color .2s, color .2s;
}
.ms-shop .woocommerce-pagination .page-numbers a:hover { border-color: var(--gold); color: var(--red); background: #fff; }
.ms-shop .woocommerce-pagination .page-numbers span.current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Nothing found */
.ms-empty { padding: 24px 0 8px; }
.ms-empty__text { margin: 0 0 16px; max-width: 40ch; font: 400 clamp(19px, 4.8vw, 24px)/1.4 var(--display); color: var(--ink); }

/* Long category text, below the products */
.ms-about.mh-section { padding-top: 56px; }
.ms-about .ms-desc { margin: 0; padding-top: 20px; border-top: 1px solid var(--gold); max-width: 72ch; }

@media (min-width: 1024px) {
	.mh.ms-shop { --gutter: 32px; padding-bottom: 96px; }
	.ms-head.mh-section { padding-top: 32px; }
	.ms-tools.mh-section {
		display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: end;
		padding-top: 28px;
	}
	.ms-tools > :not(.ms-sizes):not(.ms-bar) { grid-column: 1 / -1; }
	.ms-doors__list { margin-bottom: 28px !important; }
	.ms-door { width: 96px; }
	.ms-door__name { font-size: 13px; }
	.ms-shop .ms-sizes { margin: 0; padding-bottom: 14px; }
	.ms-bar { border-top: 0; padding: 0 0 14px; gap: 20px; }
	.ms-tools::after { content: ""; grid-column: 1 / -1; height: 1px; background: var(--gold); }
	.ms-products.mh-section { padding-top: 28px; }
	.ms-shop .woocommerce-pagination { margin-top: 64px; }
}
