/**
 * AMA Shop Archive — filterable WooCommerce product grid.
 * Tuned to the same polish as the Blog Archive (ama-posts-archive.css):
 * card shadow + hover lift, label chips, navy/maroon buttons, crisp type.
 *
 * @package AMAIndiaTwentySix
 */

/* Product-category archive wrapper (rendered by AMA_Shop_Archive::render_term_archive) */
.ama-shop-archive-main--term { max-width: 1240px; margin: 0 auto; padding: 40px 24px 72px; }
.ama-shop-termhead { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--ama-border, #d6cfc4); }
.ama-shop-termhead__eyebrow {
	margin: 0 0 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: .14em;
	text-transform: uppercase; color: var(--ama-maroon, #8a3a2a);
}
.ama-shop-termhead__title {
	margin: 0; font-family: var(--font-serif, Georgia, serif);
	font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--ama-navy, #1a2744);
}
.ama-shop-termhead__desc { margin: 10px 0 0; max-width: 720px; font-size: 0.9375rem; line-height: 1.7; color: var(--ama-muted, #534c45); }

.ama-shop {
	--shop-navy:   var(--ama-navy, #1a2744);
	--shop-maroon: var(--ama-maroon, #8a3a2a);
	--shop-text:   var(--ama-text, #0d1524);
	--shop-muted:  var(--ama-muted, #534c45);
	--shop-border: var(--ama-border, #d6cfc4);
	color: var(--shop-text);
	font-family: var(--font-sans, "Plus Jakarta Sans", system-ui, sans-serif);
}

/* ══ Top bar ═══════════════════════════════════════════════════════════════ */
.ama-shop__top {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; flex-wrap: wrap;
	padding: 0 0 14px; margin-bottom: 26px;
	border-bottom: 1px solid var(--shop-border);
}
.ama-shop__count { margin: 0; font-size: 0.8125rem; color: var(--shop-muted); }
.ama-shop__count strong { color: var(--shop-text); font-weight: 700; }
.ama-shop__tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.ama-shop__search-input {
	border: 1px solid var(--shop-border); border-radius: 4px;
	padding: 8px 12px; font-size: 0.8125rem; min-width: 240px;
	background: #fff; color: var(--shop-text);
}
.ama-shop__search-input:focus-visible { outline: 2px solid var(--shop-navy); outline-offset: 1px; }

.ama-shop__sort { display: inline-flex; align-items: center; gap: 8px; }
.ama-shop__sort-label { font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; color: var(--shop-muted); }
.ama-shop__sort-select {
	border: 1px solid var(--shop-border); border-radius: 4px;
	padding: 8px 10px; font-size: 0.8125rem; background: #fff; color: var(--shop-text);
}

/* ══ Layout: sidebar + grid ════════════════════════════════════════════════ */
.ama-shop__layout { display: grid; grid-template-columns: 210px 1fr; gap: 40px; align-items: start; }

/* ── Filters ───────────────────────────────────────────────────────────── */
.ama-shop__filters { font-size: 0.8125rem; position: sticky; top: 24px; }
.ama-shop__filters-title {
	margin: 0 0 18px; font-size: 0.75rem; font-weight: 700; letter-spacing: 1.4px;
	text-transform: uppercase; color: var(--shop-maroon);
}
.ama-shop__filter-group { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--shop-border); }
.ama-shop__filter-group:last-of-type { border-bottom: none; }
.ama-shop__filter-head {
	margin: 0 0 10px; font-size: 0.75rem; font-weight: 700; letter-spacing: 1px;
	text-transform: uppercase; color: var(--shop-muted);
}
.ama-shop__filter-opt {
	display: flex; align-items: center; gap: 8px; padding: 4px 0;
	cursor: pointer; color: var(--shop-text);
}
.ama-shop__filter-opt input { accent-color: var(--shop-navy); flex-shrink: 0; }
.ama-shop__filter-name { flex: 1; }
.ama-shop__filter-count { color: var(--shop-muted); font-size: 0.75rem; }

/* Category list: scrollable so a long/hierarchical list never pushes the
   Availability / Price groups off-screen. */
.ama-shop__cat-scroll { max-height: 320px; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.ama-shop__cat-scroll::-webkit-scrollbar { width: 6px; }
.ama-shop__cat-scroll::-webkit-scrollbar-thumb { background: var(--shop-border); border-radius: 3px; }

/* Sub-categories: indented with an "|_" connector, smaller + muted. */
.ama-shop__filter-opt--d1,
.ama-shop__filter-opt--d2 { position: relative; }
.ama-shop__filter-opt--d1 { padding-left: 20px; }
.ama-shop__filter-opt--d2 { padding-left: 36px; }
.ama-shop__filter-opt--d1 .ama-shop__filter-name,
.ama-shop__filter-opt--d2 .ama-shop__filter-name { font-size: 0.78125rem; color: var(--shop-muted); }
.ama-shop__filter-opt--d1::before,
.ama-shop__filter-opt--d2::before {
	content: ""; position: absolute; top: -2px; bottom: 50%; width: 9px;
	border-left: 1px solid var(--shop-border);
	border-bottom: 1px solid var(--shop-border);
	border-bottom-left-radius: 2px;
}
.ama-shop__filter-opt--d1::before { left: 6px; }
.ama-shop__filter-opt--d2::before { left: 22px; }

.ama-shop__filter-clear {
	background: none; border: none; padding: 0; margin-top: 2px;
	color: var(--shop-maroon); font-size: 0.75rem; cursor: pointer; text-decoration: underline;
}
.ama-shop__price-range { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.ama-shop__price-range input {
	width: 64px; border: 1px solid var(--shop-border); border-radius: 4px;
	padding: 6px 7px; font-size: 0.8125rem; background: #fff; color: var(--shop-text);
}
.ama-shop__price-range input:disabled { opacity: 0.45; }
.ama-shop__price-apply {
	border: 1px solid var(--shop-navy); background: var(--shop-navy); color: #fff;
	border-radius: 4px; padding: 6px 12px; font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.ama-shop__price-apply:hover { background: var(--shop-maroon); border-color: var(--shop-maroon); }

.ama-shop__title { margin: 0 0 20px; font-size: clamp(1.3rem, 2.4vw, 1.8rem); color: var(--shop-navy); }

/* ══ Grid ══════════════════════════════════════════════════════════════════ */
.ama-shop__grid { display: grid; gap: 28px 24px; }
.ama-shop__grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.ama-shop__grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.ama-shop__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.ama-shop__grid.is-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.15s ease; }

/* ══ Card ══════════════════════════════════════════════════════════════════ */
.ama-shop-card {
	display: flex; flex-direction: column; background: #fff;
	border: 1px solid var(--shop-border); border-radius: 4px; overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
	transition: transform .18s ease, box-shadow .18s ease;
}
.ama-shop-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0, 0, 0, .11); }

/* White mat, not navy: `contain` leaves a margin on any cover that is not
   exactly the frame's ratio, and a dark mat drew a hard band around every
   one of them. On white it reads as space, not as a border. The striped
   navy placeholder below is unaffected — it paints its own background. */
.ama-shop-card__cover {
	position: relative; display: block; aspect-ratio: 3 / 4;  /* PORTRAIT */
	overflow: hidden; background: #fff;
}
/* Elementor's frontend.css has `.elementor img { height: auto }` (0,1,1), which
   outranks a single class and collapsed the cover to its own aspect ratio,
   leaving the navy container background as a strip under the image. Repeated
   class = (0,2,0), which wins on class count. */
/* `contain`, not `cover`: book covers run from about 0.65 to 0.71 wide/tall,
   so a 3/4 frame with `cover` cropped up to 13% off the top and bottom of the
   narrower ones. `contain` keeps one frame size for the grid while showing
   every cover whole; the navy frame shows as a narrow mat at the sides. */
/* `fill`, not `contain`/`cover`: the frame has to be one size across the grid,
   and covers run from about 0.65 to 0.71 wide/tall. `cover` cropped them,
   `contain` left a mat; `fill` stretches each cover to the 3/4 frame instead,
   so the whole image is always visible edge to edge. The stretch is
   horizontal and runs from ~6% on a 0.71 cover to ~15% on a 0.65 one. */
.ama-shop-card__img.ama-shop-card__img { width: 100%; height: 100%; object-fit: fill; display: block; transition: transform .35s ease; }
.ama-shop-card:hover .ama-shop-card__img { transform: scale(1.05); }

/* Striped placeholder with a centred "[ Cover ]" / category label */
.ama-shop-card__img--ph {
	display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
	background:
		repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 4px, transparent 4px 14px),
		var(--shop-navy);
}
.ama-shop-card__ph-label {
	font-size: 0.75rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
	color: rgba(255, 255, 255, .5); padding: 4px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 2px;
}

/* WooCommerce's own sale flash (<span class="onsale">), restyled + top-right */
.ama-shop-card__flash { position: absolute; top: 10px; right: 10px; z-index: 1; }
.ama-shop-card__flash .onsale {
	display: inline-block; margin: 0; min-width: 0; min-height: 0; line-height: 1.4;
	font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
	padding: 3px 9px; border-radius: 2px; color: #fff; background: var(--shop-maroon);
}

/* Stock badge — top-LEFT, so it never collides with the sale flash opposite.
   Same shape as .onsale above; muted rather than maroon, because "sold out" is
   information and "Sale!" is a claim on attention. */
.ama-shop-card__stock {
	position: absolute; top: 10px; left: 10px; z-index: 1;
	display: inline-block; line-height: 1.4;
	font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
	padding: 3px 9px; border-radius: 2px;
	color: #fff; background: #534c45; background: var(--shop-muted);
}
/* Backorder is a softer message: still buyable, just not shipping today. */
.ama-shop-card__stock--backorder { background: #8a6d00; }

.ama-shop-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.ama-shop-card__eyebrow {
	margin: 0 0 5px; font-size: 0.75rem; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--shop-maroon);
}
/* !important so the Elementor Kit's global heading styles don't override the
   card title size/weight (per the theme's Kit-specificity rule). */
.ama-shop-card .ama-shop-card__title { margin: 0 0 5px; font-size: 0.9375rem !important; line-height: 1.35 !important; font-weight: 700 !important; }
/* (0,3,1) — beats Elementor Kit's .elementor-kit-N a:hover (0,2,1) */
.ama-shop-card .ama-shop-card__title a { color: var(--shop-navy); text-decoration: none; }
.ama-shop-card .ama-shop-card__title a:hover { color: var(--shop-maroon); }
/* Subtitle hidden by request across shop archive, shop widget and the shop page. */
.ama-shop-card__subtitle { display: none; margin: 0 0 12px; font-size: 0.8125rem; font-style: italic; color: var(--shop-muted); }

.ama-shop-card__foot {
	margin-top: auto; padding-top: 12px; border-top: 1px solid var(--shop-border);
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ama-shop-card__price { font-size: 0.9375rem; font-weight: 700; color: var(--shop-text); }
.ama-shop-card__price del { color: var(--shop-muted); font-weight: 400; font-size: 0.8125rem; margin-right: 5px; }
.ama-shop-card__price ins { text-decoration: none; color: var(--shop-maroon); }

a.ama-shop-card__btn {
	flex-shrink: 0; display: inline-block;
	background: var(--shop-navy); color: #fff !important;
	border: 1px solid var(--shop-navy); border-radius: 3px;
	padding: 7px 14px; font-size: 0.75rem; font-weight: 700;
	text-decoration: none !important; cursor: pointer; white-space: nowrap;
	transition: background .15s ease, border-color .15s ease;
}
a.ama-shop-card__btn:hover { background: var(--shop-maroon); border-color: var(--shop-maroon); color: #fff !important; }
a.ama-shop-card__btn.loading { opacity: 0.6; pointer-events: none; }
a.ama-shop-card__btn.added::after { content: " ✓"; }
a.ama-shop-card__btn--view { background: transparent; color: var(--shop-navy) !important; }
a.ama-shop-card__btn--view:hover { background: var(--shop-navy); color: #fff !important; }

/* ══ Empty + load more ═════════════════════════════════════════════════════ */
.ama-shop__empty { color: var(--shop-muted); padding: 48px 0; text-align: center; }
.ama-shop__more-wrap { text-align: center; margin-top: 40px; }
.ama-shop__more {
	background: transparent; border: 2px solid var(--shop-navy); color: var(--shop-navy);
	border-radius: 3px; padding: 12px 44px; font-size: 0.875rem; font-weight: 700;
	letter-spacing: .04em; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.ama-shop__more:hover { background: var(--shop-navy); color: #fff; }

/* ══ Responsive ════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
	.ama-shop__layout { grid-template-columns: 1fr; gap: 24px; }
	.ama-shop__filters { position: static; }
	.ama-shop__cat-scroll { max-height: 220px; }
	.ama-shop__grid--cols-3, .ama-shop__grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.ama-shop__grid--cols-2, .ama-shop__grid--cols-3, .ama-shop__grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
	.ama-shop__search-input { min-width: 0; width: 100%; }
	.ama-shop-card__foot { flex-direction: column; align-items: flex-start; }
}
