/* Slomilled Shop: uses the TrueSubstance theme's colours and font where present. */
/* 0.1.4: colours also on the bag panel and toast, which sit outside .slm-shop (the Checkout button had no background). */
.slm-shop,
.slm-drawer,
.slm-toast {
	--slm-ink: var(--ink, #1e1d1b);
	--slm-muted: var(--muted, #57524a);
	--slm-rule: var(--rule, rgba(30, 29, 27, 0.16));
	--slm-paper: var(--paper, #f5f1ea);
	--slm-navy: var(--navy, #0d142b);
	--slm-husk: var(--husk-ink, #85561a);
}
.slm-shop {
	display: grid;
	gap: 32px;
	align-items: start;
	padding: 8px var(--pad-x, 20px) clamp(60px, 9vw, 120px); /* same side spacing as the theme's sections */
}
.slm-shop > * { min-width: 0; } /* the swipeable category row must not stretch the page */
@media (min-width: 960px) { .slm-shop { grid-template-columns: 230px minmax(0, 1fr); gap: 48px; } }
@media (max-width: 599px) {
	.slm-grid { grid-template-columns: 1fr; gap: 14px; }
	.slm-card__label { min-height: 112px; padding: 14px 16px 12px; }
	.slm-card__logo { width: 52px; top: 12px; }
	.slm-card__name { font-size: 1.15rem; }
	.slm-card__body { gap: 10px; padding: 12px 16px 14px; }
}

/* Categories: sticky column on the left; on phones a sticky, swipeable row. */
.slm-cats { position: sticky; top: calc(var(--header-h, 76px) + 16px); z-index: 5; }
.slm-cats__title { margin: 0 0 10px; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slm-muted); }
.slm-cats ul { margin: 0; padding: 0; list-style: none; }
.slm-cats a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-left: 2px solid transparent; color: var(--slm-ink); text-decoration: none; font-size: 0.95rem; line-height: 1.3; }
.slm-cats a span { color: var(--slm-muted); font-size: 0.8rem; }
.slm-cats a:hover { background: rgba(0, 0, 0, 0.03); }
.slm-cats a.is-active { border-left-color: var(--slm-husk); background: rgba(168, 116, 42, 0.08); font-weight: 500; }
@media (max-width: 959px) {
	.slm-cats { top: var(--header-h, 76px); margin: 0 calc(-1 * var(--gutter, 20px)); padding: 10px var(--gutter, 20px); background: var(--slm-paper); border-bottom: 1px solid var(--slm-rule); }
	.slm-cats__title { display: none; }
	.slm-cats ul { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
	.slm-cats ul::-webkit-scrollbar { display: none; }
	.slm-cats a { white-space: nowrap; border: 1px solid var(--slm-rule); border-radius: 999px; padding: 7px 14px; }
	.slm-cats a span { display: none; }
	.slm-cats a.is-active { border-color: var(--slm-ink); background: var(--slm-ink); color: #fff; }
}

/* Sections and grid */
.slm-cat { scroll-margin-top: 120px; margin-bottom: 56px; }
.slm-cat__title { margin: 0 0 20px; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); font-weight: 300; }
.slm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

/* Card: a stylised label (logo + product name on a category tint) and the buying controls. */
.slm-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--slm-rule); border-radius: 8px; overflow: hidden; }
.slm-card__label { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 168px; padding: 18px 18px 16px; background: var(--slm-tint, #efe7d8); }
.slm-card__logo { position: absolute; top: 14px; left: 16px; width: 64px; height: auto; opacity: 0.9; }
.slm-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slm-card__name { margin: 0; font-size: 1.32rem; font-weight: 500; line-height: 1.15; color: #1e1d1b; letter-spacing: -0.01em; }
.slm-card__sub { margin: 0; font-size: 0.85rem; line-height: 1.35; color: #4a443b; }
.slm-badge { position: absolute; top: 14px; right: 14px; padding: 3px 9px; border-radius: 999px; background: var(--slm-navy); color: #fff; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.slm-card[data-tint="0"] { --slm-tint: #efe3cf; } /* flours */
.slm-card[data-tint="1"] { --slm-tint: #f2dfd3; }
.slm-card[data-tint="2"] { --slm-tint: #e9dccb; }
.slm-card[data-tint="3"] { --slm-tint: #e2e6d3; }
.slm-card[data-tint="4"] { --slm-tint: #f1e6c9; }
.slm-card[data-tint="5"] { --slm-tint: #f3e8c4; }
.slm-card[data-tint="6"] { --slm-tint: #e5e3dc; }
.slm-card[data-tint="7"] { --slm-tint: #f4e2c0; }
.slm-card[data-tint="8"] { --slm-tint: #e6dfe8; }
.slm-card[data-tint="best"] { --slm-tint: #e3e6ee; }
.slm-card__body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; flex: 1; }
.slm-card__title { margin: 0; font-size: 1.05rem; font-weight: 500; }
.slm-card__title span { display: block; font-weight: 400; font-size: 0.85rem; color: var(--slm-muted); }
.slm-row { display: grid; gap: 6px; }
.slm-row__label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slm-muted); }
.slm-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.slm-opt { min-height: 36px; padding: 6px 12px; border: 1px solid var(--slm-rule); border-radius: 999px; background: #fff; color: var(--slm-ink); font: inherit; font-size: 0.88rem; cursor: pointer; }
.slm-opt[aria-pressed="true"] { border-color: var(--slm-ink); background: var(--slm-ink); color: #fff; }
.slm-opt:disabled { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }
.slm-price { margin: 2px 0 0; font-size: 1.05rem; }
.slm-price s { color: var(--slm-muted); font-size: 0.88rem; }
.slm-off { color: #2e7d32; font-size: 0.82rem; font-weight: 500; }
.slm-buy { display: flex; gap: 10px; align-items: center; margin-top: auto; }
.slm-qty { display: inline-flex; align-items: center; border: 1px solid var(--slm-rule); border-radius: 999px; }
.slm-qty button { width: 36px; height: 38px; border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--slm-ink); }
.slm-qty span { min-width: 22px; text-align: center; }
.slm-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--slm-navy); color: #fff; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.slm-add { flex: 1; }
.slm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.slm-opt:focus-visible, .slm-btn:focus-visible, .slm-qty button:focus-visible, .slm-cats a:focus-visible { outline: 2px solid var(--focus, #a8742a); outline-offset: 2px; }

/* Drawer and toast (the bag button itself is in the site header: bag-button.css) */
.slm-drawer[hidden], .slm-toast[hidden] { display: none !important; }
.slm-drawer { position: fixed; z-index: 90; inset: 0; background: rgba(13, 20, 43, 0.4); }
.slm-drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(440px, 100%); background: #fff; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15); }
.slm-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--rule, #ddd); }
.slm-drawer__head h2 { margin: 0; font-size: 1.3rem; font-weight: 400; }
.slm-drawer__head button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; }
.slm-drawer__items { margin: 0; padding: 8px 20px; list-style: none; overflow-y: auto; flex: 1; }
.slm-drawer__items li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule, #eee); font-size: 0.92rem; }
/* 0.1.4: only the pack line under the name is a block; the price's inner spans stay inline, so "₹" and the amount share one line. */
.slm-drawer__items li > div:first-child > span { display: block; color: var(--muted, #666); font-size: 0.82rem; }
.slm-drawer__items .slm-line { text-align: right; white-space: nowrap; }
.slm-remove { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: -6px; border: 0; border-radius: 50%; background: none; color: var(--muted, #666); cursor: pointer; }
.slm-remove:hover { background: rgba(13, 20, 43, 0.06); color: #a33; }
.slm-remove:focus-visible { outline: 2px solid var(--focus, #a8742a); outline-offset: 2px; }
.slm-remove svg { width: 18px; height: 18px; }
.slm-empty { display: block !important; color: var(--muted, #666); }
.slm-drawer__suggest { padding: 0 20px; }
.slm-suggest__title { margin: 14px 0 6px; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted, #666); }
.slm-suggest { margin: 0; padding: 0; list-style: none; }
.slm-suggest li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; font-size: 0.88rem; }
.slm-drawer__foot { padding: 16px 20px 20px; border-top: 1px solid var(--rule, #ddd); }
.slm-drawer__foot p { display: flex; justify-content: space-between; margin: 0 0 6px; }
.slm-drawer__foot .slm-btn { width: 100%; }
.slm-note { color: var(--muted, #666); font-size: 0.8rem; display: block !important; margin-bottom: 12px !important; }
body.slm-drawer-open { overflow: hidden; }
/* 0.1.3: "Added" message slides in at the bottom right and back out to the right. */
.slm-toast {
	position: fixed;
	z-index: 80;
	right: clamp(12px, 2vw, 24px);
	bottom: clamp(12px, 2vw, 24px);
	max-width: min(380px, calc(100% - 24px));
	padding: 12px 16px;
	border-radius: 8px;
	background: #1e1d1b;
	color: #fff;
	font-size: 0.9rem;
	line-height: 1.4;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
	transform: translateX(calc(100% + 40px));
	opacity: 0;
	transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s ease;
}
.slm-toast.is-in { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .slm-toast { transition: opacity 0.2s ease; transform: none; } }
.slm-toast button { margin-left: 8px; border: 0; background: none; color: #f3c27a; text-decoration: underline; font: inherit; cursor: pointer; }
/* Checkout */
.slm-msg { display: block; font-size: 0.88rem; color: var(--muted, #57524a); }
.slm-msg--warn { color: #9a3412; }
.slm-free-nudge td { padding-top: 0 !important; font-size: 0.86rem; color: #2e7d32; }
.slm-thanks { display: block; padding: 16px 18px; border-radius: 8px; background: #edf6ee; color: #1e4620; font-size: 1.05rem; }
form.slm-is-pickup .slm-delivery-only, form.slm-is-pickup #slm-address-box { display: none !important; }
.slm-delivery-only label .optional { display: none; } /* required for delivery; checked on the server */
#slm-address-box { display: block; width: 100%; margin-bottom: 4px; color-scheme: light; }
/* UPI payment on the order-received page */
.slm-upi { margin: 24px 0 32px; padding: 22px; border: 1px solid var(--rule, #ddd); border-radius: 10px; background: #fff; }
.slm-upi h2 { margin: 0 0 16px; font-size: 1.4rem; font-weight: 400; }
.slm-upi__grid { display: grid; gap: 22px; align-items: start; }
@media (min-width: 700px) { .slm-upi__grid { grid-template-columns: 240px 1fr; } }
.slm-upi__qr { width: 240px; max-width: 100%; aspect-ratio: 1; background: #fff; }
.slm-upi__qr svg { display: block; width: 100%; height: auto; }
.slm-upi__steps { margin: 0 0 16px; padding-left: 20px; line-height: 1.55; }
.slm-upi__steps li { margin-bottom: 10px; }
.slm-upi__app { margin-top: 8px; }
.slm-upi__app.is-desktop { background: #fff; color: var(--navy, #0d142b); border: 1px solid var(--rule, #ccc); }
.slm-upi__utr label { display: block; margin-bottom: 6px; font-size: 0.9rem; }
.slm-upi__utr div { display: flex; gap: 8px; flex-wrap: wrap; }
.slm-upi__utr input { min-height: 42px; padding: 8px 12px; border: 1px solid var(--rule-strong, #999); border-radius: 6px; font: inherit; letter-spacing: 0.08em; width: 16ch; }
.slm-upi__msg { margin: 8px 0 0; font-size: 0.88rem; color: #1e4620; }
.slm-fssai { margin: 24px 0 0; font-size: 0.8rem; color: var(--muted, #57524a); letter-spacing: 0.02em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
