/*
Theme Name: Colonial Lock Supply
Template: storefront
Description: Storefront child theme styled after the original Colonial Lock Supply (Zen Cart "bask_black") site: logo header, dark menu bar, categories and brands on the left, search, featured banner and mailing list on the right.
Version: 1.0
*/

:root {
	--cls-text: #333;
	--cls-link: #0098c4;
	--cls-red: #e41c05;
	--cls-light-box: #ededed;
	--cls-width: 960px;
}

body {
	font-family: Arial, Verdana, Helvetica, sans-serif;
	font-size: 13px;
	line-height: 1.45;
	color: var(--cls-text);
	background: #fff;
}
h1, h2, h3, h4, h5, h6,
.woocommerce-products-header__title, .entry-title, .product_title {
	font-family: Arial, Verdana, Helvetica, sans-serif;
	color: var(--cls-text);
	font-weight: bold;
	letter-spacing: 0;
}
h1, .entry-title, .woocommerce-products-header__title, .product_title { font-size: 18px; margin: 0.3em 0 0.8em; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
a { color: var(--cls-link); text-decoration: underline; }
a:hover, a:focus { color: var(--cls-link); text-decoration: none; }

.col-full { max-width: var(--cls-width); padding-left: 10px; padding-right: 10px; box-sizing: border-box; }

/* ---------- Header ---------- */
.site-header,
.woocommerce-active .site-header {
	background: #fff;
	border: 0;
	padding-top: 10px;
	margin-bottom: 0 !important;
}
.site-header .col-full { position: relative; }
.cls-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-bottom: 6px;
}
.cls-logo img { display: block; max-width: 360px; width: 100%; height: auto; }
.cls-header-right { display: flex; align-items: center; gap: 28px; text-align: right; }
.cls-slogan { font-style: italic; font-size: 11px; color: #555; text-align: left; line-height: 1.3; }
.cls-phone { font-size: 26px; font-weight: bold; color: #555; white-space: nowrap; }
.cls-phone a { color: inherit; text-decoration: none; }
.cls-account-links {
	position: absolute;
	top: -4px;
	right: 10px;
	font-size: 11px;
}
.cls-account-links a { color: var(--cls-link); }
.cls-account-links .cls-cart-link { margin-left: 10px; font-weight: bold; }

/* Dark menu bar (original bask_black images) */
.storefront-primary-navigation {
	background: url(images/nav_center.gif) repeat-x;
	height: 46px;
	border-radius: 6px;
	margin: 4px 10px 0;
	max-width: calc(var(--cls-width) - 20px);
	position: relative;
	overflow: visible;
}
@media (min-width: 961px) {
	.storefront-primary-navigation { margin-left: auto; margin-right: auto; }
}
.storefront-primary-navigation .col-full { padding: 0; max-width: none; }
.main-navigation ul.menu > li > a,
.main-navigation ul.nav-menu > li > a {
	color: #fff;
	font-weight: bold;
	font-size: 13px;
	padding: 14px 26px;
	text-decoration: none;
	background: url(images/nav_delim.gif) no-repeat right center;
}
.main-navigation ul.menu > li.current-menu-item > a,
.main-navigation ul.menu > li.current_page_item > a,
.main-navigation ul.menu > li > a:hover {
	background-color: rgba(255, 255, 255, 0.12);
	color: #fff;
}
.main-navigation ul.menu > li:first-child > a { border-radius: 6px 0 0 6px; }
.menu-toggle { color: #fff; border-color: #888; margin: 6px 10px; }
.menu-toggle:hover { color: #fff; }
.handheld-navigation { background: #3a3a3a; }
.handheld-navigation a { color: #fff; }

/* ---------- Three-column layout ---------- */
.woocommerce-breadcrumb {
	background: none;
	padding: 0;
	margin: 0 0 8px;
	font-size: 12px;
}
.storefront-breadcrumb { padding: 14px 0 0; margin: 0; }
.storefront-breadcrumb .col-full { padding-left: 196px; }

#content > .col-full {
	display: grid;
	grid-template-columns: 170px minmax(0, 1fr) 190px;
	column-gap: 18px;
	align-items: start;
}
#content > .col-full > * { grid-column: 2; }
#content > .col-full > #cls-left { grid-column: 1; grid-row: 1 / span 6; }
#content > .col-full > #secondary { grid-column: 3; grid-row: 1 / span 6; }
#content #primary, #content #secondary {
	float: none;
	width: auto;
	margin: 0;
}
.site-content { padding-top: 14px; }
.storefront-breadcrumb + .site-content, .storefront-breadcrumb ~ #content { padding-top: 0; }
.site-main { margin-bottom: 30px; }

/* Left column */
.cls-box { margin-bottom: 16px; }
.cls-box-heading {
	font-size: 12px;
	font-weight: bold;
	margin: 0 0 6px;
	padding: 3px 6px;
}
#cls-left .cls-box-heading {
	background: linear-gradient(#5a5a5a, #222);
	color: #fff;
}
#secondary .cls-box-heading {
	background: url(images/left_sb_bg.gif) repeat-x;
	background-color: var(--cls-light-box);
	color: #000;
	text-align: left;
}
.cls-list { list-style: none; margin: 0; padding: 0 4px; }
.cls-list li { margin: 0; line-height: 1.35; }
#cls-left .cls-cats a { color: #222; text-decoration: none; }
#cls-left .cls-cats a:hover, #cls-left .cls-cats .current a { color: var(--cls-link); }
#cls-left .cls-more { border-top: 1px solid #aaa; margin-top: 8px; padding-top: 8px; }
#cls-left .cls-more a { color: #222; text-decoration: none; }
#cls-left .cls-brands a { color: var(--cls-link); }

/* Right column */
#secondary .widget { margin: 0 0 16px; }
.cls-search { text-align: center; }
.cls-search input[type="search"] {
	width: 100%;
	padding: 2px 4px;
	font-size: 13px;
	border: 1px solid #999;
	box-shadow: none;
	background: #fff;
	margin-bottom: 4px;
}
.cls-search button {
	padding: 2px 10px;
	font-size: 12px;
	background: #eee;
	color: #000;
	border: 1px solid #999;
	border-radius: 3px;
}
.cls-featured img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.cls-mailing-list { border: 1px solid #000; padding: 4px; }
.cls-mailing-list h2 { font-size: 18px; text-align: center; margin: 6px 0; }
.cls-mailing-list p { font-size: 12px; text-align: center; margin: 0 0 8px; }
.cls-mailing-list label { display: block; text-align: center; font-size: 15px; margin-bottom: 4px; }
.cls-mailing-list input[type="text"] { width: 100%; padding: 8px; border: 1px solid #aaa; border-radius: 3px; margin-bottom: 10px; background: #fff; }
.cls-mailing-list button { display: block; width: 90%; margin: 0 auto; background: var(--cls-red); color: #fff; border: 0; padding: 10px; font-size: 15px; border-radius: 2px; }
.cls-mailing-list .ctct-form-footer { color: gray; font-size: 9px; text-align: center; margin: 8px 0 0; }

/* ---------- Home page ---------- */
.home .entry-header { display: none; }
.home .entry-content h1 { font-size: 15px; margin-top: 0; }
ul.cls-prod-serv { margin: 0 0 12px 18px; list-style: disc; }
.cls-pics { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 18px; }
.cls-pics img { height: 150px; width: auto; }
.cls-section-heading {
	background: var(--cls-light-box);
	padding: 4px 6px;
	font-size: 13px;
	margin: 10px 0 12px;
}

/* ---------- Product grids (compact, like Zen Cart listings) ---------- */
ul.products li.product { text-align: center; margin-bottom: 18px; }
ul.products li.product img { max-height: 120px; width: auto; margin: 0 auto 6px; }
ul.products li.product .woocommerce-loop-product__title {
	font-size: 12px;
	color: var(--cls-link);
	text-decoration: underline;
	padding: 0;
	margin-bottom: 2px;
}
ul.products li.product .price { font-size: 12px; color: #000; margin-bottom: 6px; }
ul.products li.product .button { font-size: 11px; padding: 4px 10px; }
.button, button, input[type="submit"], .added_to_cart {
	background: #444;
	border-color: #444;
	color: #fff;
}
.button:hover, button:hover, input[type="submit"]:hover { background: #222; border-color: #222; color: #fff; }
.single-product div.product .price { color: #000; font-size: 18px; }
.woocommerce-result-count, .woocommerce-ordering, .storefront-sorting { font-size: 12px; }

/* ---------- Footer ---------- */
.site-footer {
	background: #fff;
	border-top: 1px solid #ddd;
	color: #666;
	font-size: 11px;
	padding: 16px 0 24px;
	text-align: center;
}
.site-footer a { color: var(--cls-link); margin: 0 6px; }
.cls-footer-links { margin-bottom: 6px; }

/* Cart, checkout and My Account use the full width (no side columns) */
.woocommerce-cart #cls-left, .woocommerce-cart #secondary,
.woocommerce-checkout #cls-left, .woocommerce-checkout #secondary,
.woocommerce-account #cls-left, .woocommerce-account #secondary { display: none; }
.woocommerce-cart #content > .col-full > *,
.woocommerce-checkout #content > .col-full > *,
.woocommerce-account #content > .col-full > * { grid-column: 1 / -1; }
.woocommerce-cart .storefront-breadcrumb .col-full,
.woocommerce-checkout .storefront-breadcrumb .col-full,
.woocommerce-account .storefront-breadcrumb .col-full { padding-left: 10px; }

/* ---------- Narrow screens: stack columns ---------- */
@media (max-width: 860px) {
	#content > .col-full { display: block; }
	#cls-left { display: none; }
	#secondary { margin-top: 20px; }
	.storefront-breadcrumb .col-full { padding-left: 10px; }
	.cls-header-top { flex-wrap: wrap; justify-content: center; text-align: center; }
	.cls-header-right { flex-direction: column; gap: 4px; align-items: center; }
	.cls-slogan { text-align: center; }
	.cls-account-links { position: static; text-align: center; margin-bottom: 6px; }
	.storefront-primary-navigation { height: auto; }
}

/* ---------- Table listing (category, brand, search and shop pages) ---------- */
#content ul.products.cls-table {
	display: block;
	margin: 0 0 16px;
	border-top: 1px solid #ddd;
}
#content ul.products.cls-table::before, #content ul.products.cls-table::after { display: none; }
#content ul.products.cls-table li.cls-row {
	display: grid;
	grid-template-columns: 90px 80px 80px minmax(0, 1fr) 110px;
	column-gap: 8px;
	align-items: center;
	width: auto;
	float: none;
	margin: 0;
	padding: 6px 0;
	border-bottom: 1px solid #eee;
	text-align: center;
	font-size: 12px;
}
#content ul.products.cls-table li.cls-row:nth-child(even) { background: #fafafa; }
#content ul.products.cls-table li.cls-head {
	font-weight: bold;
	color: var(--cls-link);
	background: #fff;
	padding: 4px 0;
	border-bottom: 1px solid #ccc;
}
#content ul.products.cls-table li.cls-head div:nth-child(3) { color: #333; }
#content ul.products.cls-table .cls-col-model { word-break: break-word; }
#content ul.products.cls-table .cls-col-img img { max-width: 64px; max-height: 64px; width: auto; height: auto; margin: 0 auto; border: 1px solid #ddd; }
#content ul.products.cls-table .cls-col-name a { font-weight: bold; text-transform: uppercase; }
#content ul.products.cls-table .cls-col-price { text-align: right; }
#content ul.products.cls-table .cls-col-price .price { display: block; color: #000; margin-bottom: 4px; }
.cls-add { display: flex; gap: 4px; justify-content: flex-end; align-items: center; margin: 0; }
.cls-add input[type="number"] { width: 46px; padding: 2px 4px; font-size: 12px; border: 1px solid #999; background: #fff; box-shadow: none; }
.cls-add button { padding: 3px 8px; font-size: 11px; }
.cls-mfr-filter { display: inline-block; margin: 0 12px 10px 0; font-size: 12px; }
.cls-mfr-filter select { font-size: 12px; }

/* Left column: opened sub-categories */
#cls-left .cls-cats li.open > a { font-weight: bold; }
#cls-left .cls-cats li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 600px) {
	#content ul.products.cls-table li.cls-row { grid-template-columns: 64px minmax(0, 1fr) 96px; }
	#content ul.products.cls-table .cls-col-model, #content ul.products.cls-table .cls-col-brand,
	#content ul.products.cls-table li.cls-head div:nth-child(1), #content ul.products.cls-table li.cls-head div:nth-child(2) { display: none; }
}

/* Category/shop heading: compact and left-aligned like the old site */
.woocommerce-products-header { padding: 0 !important; margin: 0 0 8px; text-align: left; }
.woocommerce-products-header__title.page-title { font-size: 15px; margin: 0 0 6px; text-align: left; }
.storefront-sorting { margin-bottom: 8px; padding-bottom: 0; font-size: 12px; }
.storefront-sorting .woocommerce-ordering, .storefront-sorting .woocommerce-result-count { margin-bottom: 6px; }

/* Block cart/checkout: stay inside the page container instead of Storefront's wide alignment */
.woocommerce-checkout .entry-content .alignwide,
.woocommerce-cart .entry-content .alignwide,
.woocommerce-checkout .wp-block-woocommerce-checkout,
.woocommerce-cart .wp-block-woocommerce-cart {
	/* !important: Storefront's own alignwide rule is more specific and widens these blocks past the page. */
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	width: auto !important;
}
.woocommerce-checkout .entry-header, .woocommerce-cart .entry-header { text-align: left; }
/* Block cart/checkout buttons are links; keep them free of the site's link underline */
a.wc-block-cart__submit-button, a.wc-block-cart__submit-button:link, a.wc-block-cart__submit-button:visited,
a.wc-block-cart__submit-button:hover, a.wc-block-cart__submit-button .wc-block-components-button__text,
.wc-block-components-checkout-place-order-button { text-decoration: none; color: #fff; }
