/*
 * Product card (every product loop) + shop / category / tag / search archives.
 * Colours come from --dm-* tokens only (dx.css); logical properties only (EN LTR / AR RTL).
 * Markup: woocommerce/content-product.php, woocommerce/loop/add-to-cart.php, template-parts/shop/*.
 */

/* Product photos are shot on white: the image well stays light in dark mode too
   (images multiply into it), slightly dimmed so it does not glare. */
.dx { --dm-well: #F1F1F2; }
[data-theme="dark"] .dx { --dm-well: #DCDCDF; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .dx { --dm-well: #DCDCDF; }
}

/* ---------- GRID (any ul.products: archives, home, related) ----------
   body.dx + .dm-cell outrank WooCommerce's float/width/clearfix rules. */
body.dx ul.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
body.dx ul.products::before, body.dx ul.products::after { display: none; }
body.dx ul.products.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.dx ul.products.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.dx ul.products.columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body.dx ul.products.columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body.dx ul.products li.product.dm-cell { width: auto; float: none; margin: 0; padding: 0; clear: none; display: flex; min-width: 0; text-align: start; }
@media (max-width: 1100px) {
	body.dx ul.products[class*="columns-"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	body.dx ul.products[class*="columns-"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* ---------- CARD ---------- */
.dm-card { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--dm-card); border: 1px solid var(--dm-border); border-radius: 22px; overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s; }
.dm-card:hover { border-color: var(--dm-text); transform: translateY(-2px); box-shadow: 0 10px 24px var(--dm-shadow-soft); }
.dm-card__media { position: relative; }
.dx .dm-card .dx-pi { background: var(--dm-well); }
.dx .dm-card .dx-pi img { mix-blend-mode: multiply; }
.dm-card .dx-rib { color: var(--dm-text); z-index: 1; font-weight: 600; }
.dm-card .dx-rib.is-sale { background: var(--dm-accent); border-color: var(--dm-accent); color: var(--dm-on-accent); }
.dm-card .dx-rib.is-out { background: var(--dm-btn-bg); border-color: var(--dm-btn-bg); color: var(--dm-btn-text); }
.dm-card.is-out .dx-pi img { opacity: .55; filter: grayscale(1); }
.dm-card .dx-pb { gap: 6px; }
.dx .dm-card__title { font-size: 16px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.dm-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.dm-card__sub { font-size: 12.5px; color: var(--dm-muted); line-height: 1.45; }
.dm-card__coffee { display: grid; gap: 6px; }
.dm-card .dx-notes { line-height: 1.45; }
.dm-card .dx-meter { margin-block-start: 2px; }
.dm-card .dx-pm { gap: 6px; }
.dm-card .dx-pm span:nth-child(2) { text-align: center; color: var(--dm-text-2); }

/* Price: WooCommerce markup (amount + currency symbol, sale del/ins, ranges). */
.dm-card .dx-pf { flex-wrap: wrap; align-items: center; padding-block-start: 10px; }
.dm-card .dx-pr { font-size: 18px; color: var(--dm-text); }
.dm-card .dx-pr .woocommerce-Price-currencySymbol { font-size: 12px; font-weight: 400; color: var(--dm-muted); }
.dm-card .dx-pr del { display: block; font-size: 13px; font-weight: 400; color: var(--dm-muted); }
.dm-card .dx-pr del .woocommerce-Price-currencySymbol { font-size: 11px; }
.dm-card .dx-pr ins { text-decoration: none; }
.dx a.dx-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.dx .dx-add.loading { opacity: .6; cursor: progress; }
.dx .dx-add.added::before { content: "✓"; }
.dx .dm-card__add[disabled] { background: var(--dm-surface); color: var(--dm-muted); border: 1px solid var(--dm-border); cursor: not-allowed; opacity: 1; }

@media (max-width: 760px) {
	.dm-card { border-radius: 18px; }
	.dm-card:hover { transform: none; }
	.dm-card .dx-pb { padding: 12px 12px 14px; }
	.dx .dm-card__title { font-size: 14.5px; }
	.dm-card .dx-notes { font-size: 12.5px; }
	.dm-card .dx-pm { font-size: 11px; }
	.dm-card .dx-pm span:nth-child(2) { display: none; }
	.dm-card .dx-pf { flex-direction: column; align-items: stretch; gap: 8px; }
	.dm-card .dx-pr { font-size: 16px; }
	.dx .dm-card .dx-add { width: 100%; min-height: 42px; }
}

/* ---------- ARCHIVE HEAD ---------- */
.dx .dx-bc.woocommerce-breadcrumb { margin: 0; padding-block-start: 16px; font-size: 13px; color: var(--dm-muted); }
.dx .dx-bc a { color: var(--dm-muted); }
.dm-shop__top { padding-block: 14px 8px; }
.dm-shop-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 22px 40px; background: var(--dm-inverse-bg); color: var(--dm-inverse-text); border: 1px solid var(--dm-band-edge); border-radius: 30px; padding: clamp(26px, 4vw, 52px) clamp(22px, 4vw, 52px) calc(clamp(26px, 4vw, 52px) + 30px); }
/* Brand tile strip along the bottom edge (black artwork, inverted onto the dark band). */
.dm-shop-hero::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 30px; background: url(../img/dimitris-tile-black.png) repeat-x center / auto 30px; filter: invert(1); opacity: .16; pointer-events: none; }
.dm-shop-hero__text { flex: 1 1 380px; min-width: 0; }
.dx .dm-shop-hero__k { color: var(--dm-accent-ink); }
.dx a.dm-shop-hero__k:hover { text-decoration: underline; text-underline-offset: 3px; }
.dx .dm-shop-hero__title { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.12; color: var(--dm-inverse-text); overflow-wrap: anywhere; }
.dm-shop-hero__count { margin-block-start: 8px; font-weight: 600; color: var(--dm-inverse-muted); font-size: 15px; }
.dx .dm-shop-hero__lead { color: var(--dm-inverse-text-2); margin-block-start: 10px; }
.dm-shop-search { flex: 0 1 420px; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--dm-card); color: var(--dm-text); border-radius: 999px; padding: 4px; padding-inline-start: 16px; height: 52px; }
.dm-shop-search:focus-within { outline: 3px solid var(--dm-focus); outline-offset: 2px; }
.dm-shop-search svg { color: var(--dm-muted); }
.dx .dm-shop-search input[type="search"] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; box-shadow: none; padding: 0; margin: 0; height: 44px; font-size: 15px; color: var(--dm-text); }
.dx .dm-shop-search__go { min-height: 44px; background: var(--dm-btn-bg); color: var(--dm-btn-text); }
.dx .dm-shop-search__go:hover { background: var(--dm-btn-hover-bg); color: var(--dm-btn-hover-text); }

/* Category chip rail (desktop; ≤960px it is the "Categories" sheet below). */
.dm-rail { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 18px 4px; }
.dx .dm-rail .dx-chip { display: inline-flex; align-items: center; flex: none; white-space: nowrap; font-weight: 600; border-color: var(--dm-border); transition: border-color .15s, background .15s, color .15s; }
.dx .dm-rail .dx-chip:hover { border-color: var(--dm-text); }
/* Category artwork in the chips, as on the live site's rail. */
.dx .dm-rail .dx-chip { gap: 10px; min-height: 68px; padding: 6px 18px 6px 6px; }
.dx .dm-rail .dm-chip__img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--dm-border); }
.dx .dm-rail .dm-chip__img--icon { display: inline-grid; place-items: center; background: var(--dm-card); color: var(--dm-text); }
.dx .dm-rail .dm-chip__img--icon svg { width: 24px; height: 24px; }
.dm-chip__n { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--dm-muted); background: var(--dm-surface); border-radius: 999px; padding: 2px 8px; }
.dx .dm-rail .dx-chip[aria-current] .dm-chip__n { color: inherit; background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.dx .dm-rail .dx-chip[aria-current] { background: var(--dm-text); border-color: var(--dm-text); color: var(--dm-bg); }

/* ---------- CATEGORY SHEET (≤960px, as on the live site; template-parts/shop/catsheet.php) ---------- */
@property --dm-ring { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes dm-ring { to { --dm-ring: 360deg; } }
.dm-ks__btn { display: none; }
@media (max-width: 960px) {
	.dm-rail { display: none; }
	.dx .dm-ks__btn { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; margin-block-start: 18px; padding: 0 22px; border: 1px solid var(--dm-border); border-radius: 999px; background: var(--dm-card); color: var(--dm-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
	.dm-ks__btn svg { width: 18px; height: 18px; }
	/* Red ring travelling around the button. */
	.dm-ks__btn::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--dm-ring), var(--dm-accent) 0deg, transparent 70deg 180deg, var(--dm-accent) 250deg, transparent 330deg); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; animation: dm-ring 2.2s linear infinite; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
	.dm-ks__btn::after { animation: none; }
}
.dx-dr.dm-ks, .admin-bar .dx-dr.dm-ks { top: auto; bottom: 0; inset-inline: 0; width: min(560px, 100%); max-height: 82vh; margin-inline: auto; border-radius: 20px 20px 0 0; transform: translateY(105%); }
.dx-dr.dm-ks.open { transform: none; }
.dm-ks__body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px calc(22px + env(safe-area-inset-bottom)); }
.dm-ks__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 8px; margin: 0; padding: 0; list-style: none; }
.dx .dm-ks__tile { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 0; background: none; border: 0; color: var(--dm-text); font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.25; text-align: center; overflow-wrap: break-word; cursor: pointer; }
.dx .dm-ks .dm-chip__img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--dm-border); }
.dx .dm-ks .dm-chip__img--icon { display: grid; place-items: center; background: var(--dm-surface); color: var(--dm-text); }
.dm-ks .dm-chip__img--icon svg { width: 26px; height: 26px; }
.dx .dm-ks__tile[aria-current] .dm-chip__img { box-shadow: 0 0 0 2px var(--dm-card), 0 0 0 4px var(--dm-accent); }
.dx .dm-ks__back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: 0 0 16px; padding: 0 16px 0 12px; border: 1px solid var(--dm-border); border-radius: 999px; background: var(--dm-surface); color: var(--dm-text); font: inherit; font-size: 13px; cursor: pointer; }
.dm-ks__back span { font-size: 18px; line-height: 1; }

/* ---------- CHILD CATEGORIES ---------- */
.dm-cats { padding-block: 22px 4px; }
.dx .dm-cats__h { margin-block-end: 12px; }
.dm-cats__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dm-cat { display: flex; align-items: center; gap: 14px; background: var(--dm-surface); border: 1.5px solid transparent; border-radius: 18px; padding: 10px; padding-inline-end: 16px; transition: border-color .15s; height: 100%; }
.dm-cat:hover { border-color: var(--dm-text); }
.dm-cat__img { flex: none; width: 64px; height: 64px; border-radius: 12px; background: var(--dm-well); overflow: hidden; }
.dx .dm-cat__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.dm-cat__txt { display: grid; min-width: 0; line-height: 1.35; }
.dm-cat__txt b { font-size: 15px; overflow-wrap: anywhere; }
.dm-cat__txt small { font-size: 12.5px; color: var(--dm-muted); }

/* ---------- ORIGIN TILES (shop) ---------- */
.dm-og { padding-block: clamp(34px, 4vw, 52px) 0; }
.dm-og__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.dm-og__tile { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-height: 132px; height: 100%; background: var(--dm-surface); border: 2px solid transparent; border-radius: 20px; padding: 18px; transition: border-color .2s, transform .2s; }
.dm-og__tile:hover { border-color: var(--dm-text); transform: translateY(-2px); }
.dm-og__en { display: inline-flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; color: var(--dm-text-2); }
.dm-og__tile b { font-size: 19px; line-height: 1.3; }
.dm-og__tile small { font-size: 13px; color: var(--dm-muted); }

/* ---------- SHOP SECTIONS (template-parts/shop/sections.php, shop page 1) ---------- */
.dm-sec .dx-head { margin-block-end: 14px; }
.dm-sec__links { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 22px; }
.dx .dm-sec__links .dx-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; font-size: 13px; font-weight: 600; border-color: var(--dm-border); background: var(--dm-card); }
.dx .dm-sec__links .dx-chip:hover { border-color: var(--dm-text); }
.dx .dm-sec__lead { margin-block-end: 22px; }
.dm-sec__tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.dm-sec__tile { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; text-align: center; background: var(--dm-card); border: 2px solid transparent; border-radius: 20px; padding: 16px 12px; transition: border-color .2s, transform .2s; }
.dm-sec__tile:hover { border-color: var(--dm-text); transform: translateY(-2px); }
.dx .dm-sec__tile img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--dm-border); margin-block-end: 4px; }
.dm-sec__tile b { font-size: 14px; line-height: 1.3; overflow-wrap: break-word; }
.dm-sec__tile small { font-size: 12.5px; color: var(--dm-muted); }
.dx-w > .dm-sec__tiles .dm-sec__tile { background: var(--dm-surface); }
.dx .dm-sec__cta { display: flex; justify-content: space-between; align-items: center; gap: 14px 24px; flex-wrap: wrap; margin-block-start: 18px; padding: clamp(18px, 2.4vw, 28px); }
.dm-sec__cta b { display: block; font-size: 18px; }
.dm-sec__cta p { color: var(--dm-text-2); }
@media (max-width: 600px) {
	/* Tiles scroll sideways on phones instead of stacking into a tall list. */
	.dm-sec__tile b { font-size: 13px; }
	.dm-sec__tiles { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 150px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * clamp(16px, 3vw, 32px)); padding-inline: clamp(16px, 3vw, 32px); scroll-padding-inline: clamp(16px, 3vw, 32px); padding-block-end: 4px; }
	.dm-sec__tiles::-webkit-scrollbar { display: none; }
	.dm-sec__tiles li { scroll-snap-align: start; }
	.dm-sec__links { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * clamp(16px, 3vw, 32px)); padding-inline: clamp(16px, 3vw, 32px); }
	.dm-sec__links::-webkit-scrollbar { display: none; }
	.dx .dm-sec__links .dx-chip { flex: none; white-space: nowrap; }
}

/* ---------- LIST BAR, MORE, EMPTY ---------- */
.dm-shop__list { padding-block: clamp(30px, 4vw, 48px) clamp(44px, 6vw, 76px); }
.dm-shop__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-block-end: 18px; }
.dx .dm-shop__h { font-size: clamp(22px, 2.2vw, 30px); }
.dx .woocommerce-ordering { margin: 0; float: none; }
.dx .woocommerce-ordering select { min-height: 44px; border-radius: 999px; border: 1.5px solid var(--dm-border); background-color: var(--dm-card); color: var(--dm-text); padding-block: 0; padding-inline: 16px 36px; font-size: 14px; cursor: pointer; max-width: 100%; }
.dx .woocommerce-ordering select:hover { border-color: var(--dm-text); }
.dm-more { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-block-start: 34px; text-align: center; }
.dm-more__status { font-size: 14px; color: var(--dm-muted); }
.dx .dm-more__btn { min-width: 220px; }
.dx .dm-more__btn[aria-busy] { opacity: .6; pointer-events: none; }
.dm-empty { display: grid; justify-items: center; gap: 10px; text-align: center; background: var(--dm-surface); border-radius: 26px; padding: clamp(30px, 5vw, 60px) 20px; }
.dm-empty__t { font-size: clamp(20px, 2vw, 26px); }
.dm-empty p { color: var(--dm-text-2); max-width: 460px; margin-block-end: 8px; }

@media (max-width: 980px) {
	.dm-og__list { grid-template-columns: repeat(5, minmax(150px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * clamp(16px, 3vw, 32px)); padding-inline: clamp(16px, 3vw, 32px); padding-block-end: 6px; scroll-padding-inline: clamp(16px, 3vw, 32px); }
	.dm-og__list::-webkit-scrollbar { display: none; }
	.dm-og__list li { scroll-snap-align: start; }
}
@media (max-width: 600px) {
	.dm-shop-hero { border-radius: 22px; }
	.dm-shop-search { flex-basis: 100%; }
	.dm-cats__list { grid-auto-flow: column; grid-auto-columns: minmax(200px, 72%); grid-template-columns: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin-inline: calc(-1 * clamp(16px, 3vw, 32px)); padding-inline: clamp(16px, 3vw, 32px); }
	.dm-cats__list li { scroll-snap-align: start; }
	.dm-shop__bar { align-items: stretch; flex-direction: column; }
	.dx .woocommerce-ordering select { width: 100%; }
}
/* Touch: no sticky hover colour on the tapped card button. */
@media (hover: none) {
	.dx .dm-card .dx-add:hover { background: var(--dm-btn-bg); color: var(--dm-btn-text); }
}
