/* ============================================================================
   supermaat-responsive.css
   Shared mobile-first rules for the Supermaat site. Load AFTER Bootstrap 5
   and after custom.css so these win:
     <link rel="stylesheet" href="assets/css/supermaat-responsive.css">
   Keeps the existing brand: green accent, light background, the logo.
   ============================================================================ */

:root {
	--sm-green: #4aba70;      /* the existing brand accent */
	--sm-green-dark: #3a9b5c;
	--sm-ink: #434343;
	--sm-muted: #999;
	--sm-bg: #ffffff;
	--sm-card: #ffffff;
	--sm-touch: 44px;         /* minimum comfortable tap target */
}

/* ---- Brand overrides on Bootstrap's primary/success --------------------- */
.btn-success,
.btn-primary {
	--bs-btn-bg: var(--sm-green);
	--bs-btn-border-color: var(--sm-green);
	--bs-btn-hover-bg: var(--sm-green-dark);
	--bs-btn-hover-border-color: var(--sm-green-dark);
	--bs-btn-active-bg: var(--sm-green-dark);
	--bs-btn-active-border-color: var(--sm-green-dark);
}
.text-success { color: var(--sm-green) !important; }
.form-control:focus {
	border-color: var(--sm-green);
	box-shadow: 0 0 0 .2rem rgba(74, 186, 112, .25);
}

/* ---- Base / mobile-first ------------------------------------------------- */
body {
	background: var(--sm-bg);
	font-family: 'Varela Round', sans-serif;
}

/* Comfortable tap targets on touch screens (BS5 controls are ~38px) */
.btn,
.form-control,
.form-select,
.nav-link {
	min-height: var(--sm-touch);
}
/* radios/checkboxes get a little more room to tap */
.form-check-input {
	width: 1.25rem;
	height: 1.25rem;
	margin-top: .15rem;
}
.form-check-label { padding-left: .25rem; }

/* Never let a stray fixed width cause sideways scrolling on a phone */
img, table { max-width: 100%; }
body { overflow-x: hidden; }

/* ---- Auth / narrow single-column pages ---------------------------------- */
.sm-narrow {
	width: 100%;
	max-width: 380px;
	margin: 0 auto;
	padding: 24px 16px;
}

/* Keep the input font consistent whether typed or browser-autofilled.
   Chrome applies its own font + a pale background on autofill; these rules
   stop the text from "jumping" larger and keep the field visually stable. */
input.form-control,
input.form-control-lg {
	font-size: 1rem;          /* consistent; override BS5's 1.25rem on -lg */
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--sm-ink, #434343);
	font-size: 1rem;
	transition: background-color 9999s ease-in-out 0s;  /* freeze the yellow/blue autofill tint */
}

/* ---- Cart: table on desktop, stacked cards on phones --------------------
   Add class="sm-cart-table" to the basket <table>. On <=575px each row
   becomes a card and each cell shows its header via data-label.            */
@media (max-width: 575.98px) {
	.sm-cart-table thead { display: none; }
	.sm-cart-table, .sm-cart-table tbody, .sm-cart-table tr, .sm-cart-table td {
		display: block;
		width: 100%;
	}
	.sm-cart-table tr {
		border: 1px solid #e6e6e6;
		border-radius: 8px;
		padding: 12px;
		margin-bottom: 12px;
		background: var(--sm-card);
	}
	.sm-cart-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		padding: 6px 0;
		border: 0;
		text-align: right;
	}
	.sm-cart-table td::before {
		content: attr(data-label);
		font-weight: 600;
		color: var(--sm-ink);
		text-align: left;
	}
	.sm-cart-table td img { margin-left: auto; }
	.sm-cart-table input[type="text"] { max-width: 90px; }
}

/* ---- Delivery date/time slot pickers (horizontal scroll on phones) ------ */
.datesholder {
	display: flex;
	gap: 12px;
	width: 100%;
	max-width: 600px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 6px;
}
.divdate {
	flex: 0 0 auto;
	text-align: center;
	white-space: nowrap;
}

/* ---- Product cards: OVERRIDE custom.css ---------------------------------
   custom.css defines an old .card-plus (top-right, 20px) and a
   ".col { width:24%; display:inline-block }" that both fight the Bootstrap 5
   grid and our new card. These rules load last and are more specific, so they
   win. Scoped to .product-card so nothing else is affected.               */
/* Shop layout: never let product columns spill past the right edge. */
#main-container { max-width: 100%; overflow-x: hidden; }
#list-container { max-width: 100%; }

/* custom.css adds left padding to .text-dark and .text-danger globally;
   cancel it inside product cards so the title/price align with the card edge. */
.product-card .text-danger,
.product-card .text-dark { padding-left: 0 !important; margin-top: 0 !important; }

.product-card { position: relative; overflow: hidden; }
.product-card .card-body {
	display: flex;
	flex-direction: column;
	text-align: center;
}
/* Title: reserve up to 2 lines and clamp longer names, so the price row below
   always starts at the same height across a row of cards. */
.product-card .p-title {
	color: #343a40;
	font-size: .85rem;
	line-height: 1.2;
	min-height: 2.4em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Push the price + button row to the bottom so every card's row aligns.
   Price is centered; the "+" sits in the card's bottom-right corner. Reserve
   space at the bottom so they don't collide. */
.product-card .price-row {
	margin-top: auto;
	justify-content: center !important;
	padding-bottom: 4px;
}
.product-card .card-body { padding-bottom: 12px; }
.product-card .price-row .card-title { white-space: nowrap; }
.product-card .img-wrap {
	position: relative;
	width: 100%;
	text-align: center;
}
.product-card .card-img-top {
	display: block;
	margin: 0 auto;        /* center the image in the card */
	max-width: 100%;
}

.product-card .card-img-top {
	width: 100%;
	height: 140px;
	object-fit: contain;
	padding: 8px;
	border: 0;
}
@media (min-width: 768px) {
	.product-card .card-img-top { height: 160px; }
}

/* The "+" is anchored to the bottom-right corner of the whole card. */
.product-card .card-plus {
	position: absolute !important;
	right: 10px !important;
	bottom: 10px !important;
	top: auto !important;
	left: auto !important;
	width: 40px !important;
	height: 40px !important;
	line-height: normal;
	padding: 0 !important;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sm-green);
	color: #fff;
	font-size: 1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0,0,0,.2);
	z-index: 2;
}
.product-card .card-plus:hover { background: var(--sm-green-dark); color: #fff; }

/* Neutralize custom.css ".col { width:24%; display:inline-block }". Our grid
   uses col-6 / col-md-4 / col-lg-3 (not bare .col), so we only need to stop the
   bare ".col" rule from applying a stray width. Bootstrap's own col-* classes
   are left completely alone.                                                */
#main-container .col {
	width: auto;
	display: block;
}

/* ---- Pagination (override custom.css .pagination>li>a legacy rules) ------ */
.sm-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding-left: 0; }
.sm-pagination .page-item { list-style: none; }
.sm-pagination .page-link {
	float: none;                     /* cancel custom.css float:left */
	min-width: 40px;
	height: 40px;
	margin: 0;                       /* cancel custom.css margin-left:-1px */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #dbe2ea;
	border-radius: 8px;              /* rounded tiles like the target */
	color: #1f2d3d;
	background: #fff;
	font-weight: 600;
	text-decoration: none;
	line-height: 1;
	padding: 0 10px;
}
.sm-pagination .page-link:hover { background: #f2f6fa; }
/* Active page: dark outline tile */
.sm-pagination .page-item.active .page-link {
	border-color: #1f2d3d;
	color: #1f2d3d;
	background: #fff;
}
/* Disabled ellipsis / arrows */
.sm-pagination .page-item.disabled .page-link {
	color: #b8c2cc;
	background: #eef2f6;
	border-color: #e4e9ef;
}
/* Prev / next arrows are the first and last items — make them blue like target */
.sm-pagination .page-item:first-child .page-link,
.sm-pagination .page-item:last-child .page-link {
	background: #2f9be6;
	border-color: #2f9be6;
	color: #fff;
	font-size: 1.1rem;
}
.sm-pagination .page-item:first-child.disabled .page-link,
.sm-pagination .page-item:last-child.disabled .page-link {
	background: #bfe0f6;
	border-color: #bfe0f6;
	color: #fff;
}

/* ---- Category list as bordered pill tiles (stacked in the sidebar) ------ */
#list-category {
	list-style: none;
	padding-left: 0;
	margin-bottom: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
#list-category li { margin: 0; }
#list-category li a {
	display: block;
	padding: 10px 14px;
	border: 1px solid #dbe2ea;
	border-radius: 10px;
	background: #fff;
	color: #1f2d3d;
	text-decoration: none;
	font-weight: 500;
	line-height: 1.25;
	transition: background-color .15s ease, border-color .15s ease;
}
#list-category li a:hover {
	background: #f2f6fa;
	border-color: #cdd7e1;
	text-decoration: none;
}
/* The selected category (rendered inside <strong> by the server loop) */
#list-category li strong a,
#list-category li a.active {
	border-color: var(--sm-green);
	color: var(--sm-green-dark);
	background: rgba(74, 186, 112, .08);
	font-weight: 700;
}

/* On mobile the category list expands in-flow above the products; give it
   breathing room so the last tile isn't clipped by the product grid. */
@media (max-width: 767.98px) {
	#catCollapse {
		margin-bottom: 16px;
		padding-bottom: 4px;
	}
	#list-category { padding-bottom: 2px; }
}

/* ---- Radio card list (address / store / payment selection) -------------- */
.sm-radio-list { display: flex; flex-direction: column; gap: 10px; }
.sm-radio-card {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid #dbe2ea;
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	margin: 0;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.sm-radio-card:hover { border-color: #cdd7e1; }
.sm-radio-card input[type="radio"] {
	margin-top: 2px;
	width: 1.25rem;
	height: 1.25rem;
	flex: 0 0 auto;
	accent-color: var(--sm-green);
}
/* Highlight the whole card when its radio is selected */
.sm-radio-card:has(input[type="radio"]:checked) {
	border-color: var(--sm-green);
	background: rgba(74, 186, 112, .06);
	box-shadow: 0 0 0 1px var(--sm-green) inset;
}
.sm-radio-body { display: flex; flex-direction: column; gap: 2px; }
.sm-radio-title { font-weight: 600; color: #1f2d3d; }
.sm-radio-sub { color: #667; font-size: .9rem; }

/* Display-only card (address management list): not selectable, holds buttons */
.sm-radio-card.d-block { display: block; cursor: default; }
.sm-radio-card.d-block:hover { border-color: #dbe2ea; }

/* ---- Basket page -------------------------------------------------------- */
.sm-basket {
	max-width: 760px;
	margin: 0 auto;
	padding: 16px;
}
.sm-cart-img {
	height: 64px;
	width: auto;
	max-width: 80px;
	object-fit: contain;
}
.sm-qty { width: 70px; text-align: center; }
.sm-money-input { width: 140px; flex: 0 0 auto; margin-left: auto; }
.sm-summary { border: 1px solid #e6e9ee; }
.sm-summary hr { margin: 12px 0; opacity: .12; }
/* Herberekenen: give it a visible outline on the white panel */
#btnRecalculate {
	border: 1px solid #cfd6de;
	color: #556;
	background: #f7f9fb;
}
#btnRecalculate:hover { background: #eef2f6; color: #333; }

/* Date chips (delivery day) + time-slot chips: bordered, selectable pills */
.datesholder { display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.divdate { flex: 0 0 auto; }
.datechip, .timechip { margin: 0; cursor: pointer; }
.datechip input, .timechip input { position: absolute; opacity: 0; pointer-events: none; }
.datechip span, .timechip span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #dbe2ea;
	border-radius: 10px;
	padding: 8px 12px;
	background: #fff;
	white-space: nowrap;
	min-height: 44px;
}
.sm-timeslots { display: flex; flex-wrap: wrap; gap: 8px; }
.datechip input:checked + span,
.timechip input:checked + span {
	border-color: var(--sm-green);
	background: rgba(74, 186, 112, .10);
	color: var(--sm-green-dark);
	font-weight: 600;
}

/* Cart table: desktop shows a normal table; ≤767px each row becomes a card.
   (The base sm-cart-table rule below the 575 breakpoint is superseded here so
   the cards appear on tablets too, matching the narrower .sm-basket width.) */
.sm-cart-table thead th { border-bottom: 2px solid #eee; font-weight: 600; }
.sm-cart-table .sm-cart-remove a { text-decoration: none; }

@media (max-width: 767.98px) {
	.sm-cart-table thead { display: none; }
	.sm-cart-table, .sm-cart-table tbody, .sm-cart-table tr, .sm-cart-table td {
		display: block;
		width: 100%;
	}
	.sm-cart-table tr {
		position: relative;
		border: 1px solid #e6e6e6;
		border-radius: 10px;
		padding: 12px 12px 12px 96px;   /* room for the image on the left */
		margin-bottom: 12px;
		background: #fff;
	}
	/* Tables without a product image (e.g. orders list): no left gutter */
	.sm-cart-table.sm-no-image tr { padding-left: 12px; }
	.sm-cart-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		padding: 4px 0;
		border: 0;
		text-align: right;
		min-height: 32px;
	}
	.sm-cart-table td::before {
		content: attr(data-label);
		font-weight: 600;
		color: #556;
		text-align: left;
	}
	/* the "Product" cell holds the image — pin it top-left, vertically centered
	   against the first couple of rows, and don't let it stretch the card */
	.sm-cart-table td[data-label="Product"] {
		position: absolute;
		left: 12px;
		top: 50%;
		transform: translateY(-50%);
		width: 72px;
		min-height: 0;
		padding: 0;
		display: block;
	}
	.sm-cart-table td[data-label="Product"]::before { content: ""; }
	.sm-cart-table .sm-cart-img { height: 72px; max-width: 72px; display: block; }
	.sm-cart-table .sm-qty { width: 70px; }
	.sm-cart-table td.sm-cart-remove { justify-content: flex-end; }
	.sm-cart-table td.sm-cart-remove::before { content: ""; }
}
/* On phones the "Verwijder" word can crowd; keep it, but the trash icon alone
   is enough on very small screens */
@media (max-width: 360px) {
	.sm-remove-text { display: none; }
}

/* ---- Account / form pages: white card panels on the grey page ----------
   Roomy on desktop (wide fields like the original), centered and capped so it
   doesn't stretch edge-to-edge on very large monitors. */
.sm-account {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 16px 24px 32px;
}
.sm-panel { border: 1px solid #e6e9ee; }
.sm-panel .card-body { padding: 24px; }

/* ---- Orders list: search toolbar + sortable headers -------------------- */
.sm-orders-toolbar { max-width: 360px; }
.sm-sort {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-weight: 600;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
}
.sm-sort:hover { color: var(--sm-green-dark); }
.sm-sort-ind { color: var(--sm-green); font-size: .8em; }

/* ---- Header: layout + mobile account menu ------------------------------ */
.sm-header-main { min-width: 0; }

/* Desktop: stable header row that doesn't reflow when the dropdown opens.
   The search flexes; Winkel / account / cart keep their intrinsic width.
   The open dropdown is absolutely positioned (out of flow) so it can never
   push the header into a second row. */
@media (min-width: 992px) {
	.sm-header-main > form { flex: 1 1 auto; min-width: 0; }
	.sm-header-main > ul,
	.sm-header-main > #cartButton { flex: 0 0 auto; }
	.sm-header-main .nav-item.dropdown { position: relative; }
	.sm-header-main .dropdown-menu.show {
		position: absolute !important;
		inset: auto 0 auto auto !important;
		transform: none !important;
		top: 100% !important;
		margin-top: .25rem !important;
	}
	.sm-header-main #navbarDropdownStore + .dropdown-menu.show { inset: auto auto auto 0 !important; }
}
.sm-account-menu {
	width: 100%;
	max-width: 320px;
	margin: 0 auto;
	gap: 8px;
	padding: 4px 0 8px;
}
.sm-account-menu .sm-menu-greeting {
	text-align: left;
	color: #8a97a0;
	font-size: .9rem;
	padding: 4px 18px 2px;
}
.sm-account-menu .nav-item { width: 100%; }
.sm-account-menu .nav-link {
	display: block;
	width: 100%;
	text-align: left;
	padding: 13px 18px;
	color: var(--sm-green-dark);
	background: #f4f8f5;
	border: 1px solid #e3ece6;
	border-radius: 10px;
	font-weight: 600;
	min-height: 48px;
}
.sm-account-menu .nav-link:hover,
.sm-account-menu .nav-link:active {
	background: var(--sm-green);
	border-color: var(--sm-green);
	color: #fff;
}
/* Uitloggen stands apart */
.sm-account-menu .sm-logout .nav-link {
	background: #fff;
	color: #b23b3b;
	border-color: #eccdcd;
}
.sm-account-menu .sm-logout .nav-link:hover,
.sm-account-menu .sm-logout .nav-link:active {
	background: #b23b3b;
	border-color: #b23b3b;
	color: #fff;
}

/* ---- Live chat (bmsgreply.asp) ----------------------------------------- */
.sm-chat {
	display: flex;
	flex-direction: column;
	height: 100vh;
	max-width: 900px;
	margin: 0 auto;
	background: #fff;
}
.sm-chat-head {
	padding: 12px 16px;
	background: #eef1f3;
	border-bottom: 1px solid #e0e4e8;
	font-weight: 500;
	flex: 0 0 auto;
}
.sm-chat-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	background: #f4f6f7;
}
.sm-chat-foot {
	flex: 0 0 auto;
	padding: 10px 12px;
	border-top: 1px solid #e0e4e8;
	background: #fff;
}
/* message bubbles (class names kept from the AJAX renderer) */
.sm-chat-body .chat { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.sm-chat-body .chat-left { justify-content: flex-start; }
.sm-chat-body .chat-content {
	max-width: 78%;
	padding: 8px 12px;
	border-radius: 14px;
	background: var(--sm-green);
	color: #fff;
	word-wrap: break-word;
}
.sm-chat-body .chat-left .chat-content { background: #e4e8eb; color: #1f2d3d; }
.sm-chat-body .chat-content p { margin: 0 0 2px; }
.sm-chat-body .chat-content img { display: block; margin: 6px 0; border-radius: 8px; max-width: 100%; height: auto; }
.sm-chat-body .chat-time { font-style: italic; font-size: 10px; opacity: .8; }

/* ---- Category list (default.asp) — narrow boxes that fit their text ---- */
.sm-cat-list {
	display: flex;
	flex-direction: column;
	align-items: flex-start;   /* boxes shrink to their text, left-aligned */
	gap: 8px;
	padding: 4px 0 10px;
}
.sm-cat-item {
	display: inline-block;
	max-width: 100%;
	padding: 8px 14px;
	border: 1px solid #dbe2ea;
	border-radius: 8px;
	background: #fff;
	color: #33475b;
	font-size: .92rem;
	text-decoration: none;
	line-height: 1.35;
}
.sm-cat-item:hover { border-color: var(--sm-green); color: var(--sm-green-dark); }
.sm-cat-item.active {
	background: var(--sm-green);
	border-color: var(--sm-green);
	color: #fff;
	font-weight: 600;
}

/* ---- Balance table: sortable headers (not blue hyperlinks) ------------- */
.sm-sort-th,
th .sm-sort-th,
.table thead th a.sm-sort-th {
	color: #33475b !important;
	text-decoration: none !important;
	font-weight: 600;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.sm-sort-th:hover,
.table thead th a.sm-sort-th:hover {
	color: var(--sm-green-dark) !important;
	text-decoration: none !important;
}
.sm-sort-th .fa-sort { color: #b7c2ce !important; font-size: .85em; }
.sm-sort-th:hover .fa-sort { color: var(--sm-green) !important; }

/* ---- Accessibility floor ------------------------------------------------ */
:focus-visible {
	outline: 3px solid rgba(74, 186, 112, .6);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}

/* ---- Small niceties on wider screens ------------------------------------ */
@media (min-width: 768px) {
	.sm-narrow { padding: 30px 0; }
}
