/*
 * asc-mobile.css - the shop on a phone (owner, 2026-11-26: "the phone view should have a good experience"). Linked
 * after asc-core.css by the package core_edits, with catalog/view/javascript/asc-mobile.js; checked by
 * upgrade/tests/t_mobile.js at 320 - 414 px. Everything but section 1 applies below 768 px only (Bootstrap's xs),
 * so the desktop look stays as it is.
 */

/* 1. Content written in the admin (category, product and information descriptions) never wider than its column:
      a video or picture with a fixed width, or a long unbroken run of characters (the dotted lines of the
      withdrawal form), made the whole page scroll sideways on a phone. */
#product-category #content > .row > .col-sm-10,
#asc-ps-description, #tab-description,
#information-information #content {
	overflow-wrap: break-word;
}
#product-category #content > .row > .col-sm-10 img, #product-category #content > .row > .col-sm-10 video,
#asc-ps-description img, #asc-ps-description video, #tab-description img, #tab-description video,
#information-information #content img, #information-information #content video {
	max-width: 100%;
	height: auto;
}
#product-category #content > .row > .col-sm-10 iframe, #asc-ps-description iframe, #tab-description iframe,
#information-information #content iframe {
	max-width: 100%;
}
/* asc-mobile.js wraps a table that is wider than its column in this, so only the table scrolls */
.asc-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
}

@media (max-width: 767px) {

	/* 2. Form fields at 16px: below that, Safari on the iPhone zooms the page in when a field is tapped and leaves
	      it zoomed. The same selectors stylesheet.css sets to 12px, and the heights that fit the larger text. */
	select.form-control, textarea.form-control, input[type="text"].form-control, input[type="password"].form-control,
	input[type="datetime"].form-control, input[type="datetime-local"].form-control, input[type="date"].form-control,
	input[type="month"].form-control, input[type="time"].form-control, input[type="week"].form-control,
	input[type="number"].form-control, input[type="email"].form-control, input[type="url"].form-control,
	input[type="search"].form-control, input[type="tel"].form-control, input[type="color"].form-control,
	.input-group input, .input-group select, input.form-control, select, textarea {
		font-size: 16px;
	}
	.input-group-sm > .form-control, .input-group-lg > .form-control {
		font-size: 16px;
	}
	.form-control:not(textarea), .input-group-sm > .form-control, .input-group-sm > .input-group-btn > .btn,
	.input-group .input-group-addon, .input-group-sm > .input-group-addon {
		height: 40px;
	}
	.input-group-btn > .btn {
		min-height: 40px;
	}
	#search .input-lg, #search .btn-lg {
		height: 44px;
	}

	/* 3. Things to tap at least 40px high: the icons of the top bar, the currency, the footer links, the links of
	      the listing toolbar. */
	#top {
		padding: 0;
	}
	#top-links {
		padding-top: 0;
	}
	#top-links .list-inline {
		margin: 0;
	}
	#top-links .list-inline > li {
		padding: 0;
	}
	#top-links .list-inline > li > a {
		display: inline-block;
		min-width: 40px;
		padding: 10px 8px;
		line-height: 20px;
		text-align: center;
	}
	#top .btn-link, #form-currency .btn-link {
		padding: 10px 8px;
		line-height: 20px;
	}
	footer .list-unstyled > li > a {
		display: inline-block;
		padding: 8px 0;
	}
	footer .list-unstyled > li {
		margin: 0;
	}
	#compare-total {
		display: inline-block;
		padding: 10px 0;
	}
	/* the breadcrumb: its items may wrap (a long category name ran past the edge at 320px), each link a taller
	   target, and a plain slash between items instead of the drawn arrows, which only fit one line */
	ul.breadcrumb {
		padding: 2px 8px;
	}
	ul.breadcrumb > li {
		padding: 0 2px;
		white-space: normal;
	}
	ul.breadcrumb > li:after {
		display: none;
	}
	ul.breadcrumb > li + li:before {
		content: "/";
		padding: 0 6px 0 2px;
		color: #aaa;
	}
	ul.breadcrumb > li > a {
		display: inline-block;
		min-width: 24px;
		padding: 9px 0;
	}
	/* lists of links (the account's menu, the site map, links in a page's text lists): room between the rows */
	#content ul > li > a {
		display: inline-block;
		padding: 4px 0;
	}
	#account-account #content ul.list-unstyled > li > a {
		display: block;
		padding: 10px 0;
		border-bottom: 1px solid #eee;
	}
	#product-manufacturer #content > .row > [class*="col-"] > a {
		display: inline-block;
		min-width: 32px;
		padding: 6px 0;
	}
	ul.pagination > li > a, ul.pagination > li > span {
		min-width: 40px;
		padding: 10px 12px;
		text-align: center;
	}
	/* the "I have read and agree" box next to a form's button (register, return, checkout) */
	.buttons .pull-right > input[type="checkbox"] {
		width: 22px;
		height: 22px;
		margin: 0 10px 0 4px;
		vertical-align: middle;
	}
	#product-manufacturer #content > p > a {
		display: inline-block;
		min-width: 32px;
		padding: 8px 6px;
		text-align: center;
	}

	/* 4. Subcategories (the Antropy Subcategory Images package): one row each, picture on the left, the way the
	      home page lists its departments, instead of a 228px tile per screen line. */
	#product-category #content > .row > .flex.center {
		justify-content: flex-start;
		margin-bottom: 10px;
	}
	#product-category #content > .row > .flex.center > a {
		flex-direction: row;
		justify-content: flex-start;
		width: 100%;
		min-height: 76px;
		padding: 8px 12px;
		border: 1px solid #e4e7ea;
		border-radius: 8px;
		background: #fff;
		text-decoration: none;
	}
	#product-category #content > .row > .flex.center > a > img {
		flex: 0 0 60px;
		width: 60px;
		height: 60px;
		object-fit: contain;
		margin-right: 14px;
	}
	#product-category #content > .row > .flex.center > a > h5 {
		margin: 0;
		text-align: left;
		font-size: 15px;
		font-weight: 600;
		line-height: 1.35;
	}
	#product-category #content > .row > .flex.center > a > br {
		display: none;
	}

	/* 5. Product cards (categories, search, brands, specials, related): two per row like the home page's offers,
	      without the description excerpt (the product page has it). Rows line up in height (flex); a browser without
	      :has() still gets two per row, each row started on the left. */
	.product-layout.product-grid {
		width: 50%;
		padding-left: 6px;
		padding-right: 6px;
	}
	.product-layout.product-grid:nth-child(2n+1) {
		clear: left;
	}
	.row:has(> .product-layout.product-grid) {
		display: flex;
		flex-wrap: wrap;
		margin-left: -6px;
		margin-right: -6px;
	}
	.row:has(> .product-layout.product-grid)::before, .row:has(> .product-layout.product-grid)::after {
		display: none;
	}
	.row > .product-layout.product-grid {
		display: flex;
	}
	.product-grid .product-thumb {
		display: flex;
		flex-direction: column;
		width: 100%;
		margin-bottom: 12px;
		border-radius: 8px;
		overflow: hidden;
	}
	.product-grid .product-thumb > .image {
		padding: 8px 8px 0;
	}
	.product-grid .product-thumb > div:not(.image) {
		flex: 1;
		display: flex;
		flex-direction: column;
	}
	.product-grid .product-thumb .caption {
		flex: 1;
		min-height: 0;
		padding: 0 8px;
	}
	.product-grid .product-thumb h4 {
		margin: 8px 0 6px;
		font-size: 13px;
		font-weight: 600;
		line-height: 1.4;
	}
	.product-grid .product-thumb .caption > p:not([class]) {
		display: none;
	}
	.product-grid .product-thumb .price {
		font-size: 17px;
		margin-bottom: 8px;
	}
	.product-grid .product-thumb .price-old {
		margin-left: 6px;
		font-size: 13px;
	}
	.product-grid .product-thumb .button-group button {
		line-height: 40px;
	}

	/* 6. Tables of products and orders (cart, checkout confirmation, order history and details, wishlist, returns):
	      each row as a card, every value under its column's name (asc-mobile.js copies the names into data-label),
	      instead of a table whose quantity, price and remove button sat off the right edge of the screen. */
	.table-responsive.asc-stack-wrap {
		border: 0;
		overflow-x: visible;
		margin-bottom: 15px;
	}
	table.asc-stack, table.asc-stack > tbody, table.asc-stack > tbody > tr, table.asc-stack > tbody > tr > td {
		display: block;
		width: auto;
	}
	table.asc-stack {
		border: 0;
		margin-bottom: 0;
	}
	table.asc-stack > thead {
		display: none;
	}
	table.asc-stack > tbody > tr {
		margin-bottom: 12px;
		padding: 10px 12px;
		border: 1px solid #ddd;
		border-radius: 8px;
		background: #fff;
	}
	table.asc-stack > tbody > tr > td {
		padding: 3px 0 !important;
		border: 0 !important;
		text-align: left !important;
		white-space: normal !important;
	}
	table.asc-stack > tbody > tr > td:empty {
		display: none;
	}
	table.asc-stack > tbody > tr > td[data-label]::before {
		content: attr(data-label) ": ";
		color: #777;
	}
	table.asc-stack > tbody > tr > td.asc-stack-title {
		font-weight: 600;
		font-size: 14px;
	}
	table.asc-stack > tbody > tr > td.asc-stack-total {
		font-weight: 600;
	}
	table.asc-stack.asc-stack--img > tbody > tr {
		display: grid;
		grid-template-columns: 72px 1fr;
		column-gap: 12px;
		align-items: start;
	}
	table.asc-stack.asc-stack--img > tbody > tr > td {
		grid-column: 2;
	}
	table.asc-stack.asc-stack--img > tbody > tr > td.asc-stack-img {
		grid-column: 1;
		grid-row: 1 / span 8;
	}
	table.asc-stack.asc-stack--img > tbody > tr > td.asc-stack-img img {
		max-width: 72px;
		height: auto;
	}
	table.asc-stack > tbody > tr > td .input-group {
		max-width: 260px !important;
	}
	table.asc-stack > tfoot {
		display: block;
	}
	table.asc-stack > tfoot > tr {
		display: flex;
		justify-content: space-between;
		gap: 12px;
	}
	table.asc-stack > tfoot > tr > td {
		border: 0 !important;
		padding: 4px 0 !important;
	}
	table.asc-stack > tfoot > tr > td:first-child {
		flex: 1 1 auto;
		min-width: 0;
		text-align: left !important;
	}
	table.asc-stack > tfoot > tr > td:last-child {
		flex: 0 0 auto;
		white-space: nowrap;
	}
}
