/*
Theme Name: Astra Child
Theme URI: https://example.com/
Description: Astra child theme with a product catalog layout (left category sidebar + right product grid). Works with WooCommerce product category archive pages.
Author: gxdynasty
Author URI: https://example.com/
Template: astra
Version: 1.0.0
Text Domain: astra-child
*/

/* ============================================================
   Brand hero (top of product archive pages)
   Colors match dynastydevice.com theme: blue #0067ff on #e7f6ff
   ============================================================ */

.gd-hero {
	background: linear-gradient(135deg, #e7f6ff 0%, #f2faff 55%, #ffffff 100%);
	border-bottom: 1px solid #d8ecfb;
	padding: 46px 24px;
}

.gd-hero-inner {
	max-width: 1240px;
	margin: 0 auto;
}

.gd-hero-eyebrow {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #0067ff;
}

.gd-hero-title {
	margin: 0 0 12px;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.25;
	color: #1a1a1a;
	max-width: 720px;
}

.gd-hero-desc {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.6;
	color: #364151;
	max-width: 720px;
}

.gd-hero-btn {
	display: inline-block;
	padding: 12px 26px;
	border-radius: 6px;
	background: #0067ff;
	color: #ffffff;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.2s;
}

.gd-hero-btn:hover {
	background: #005ee9;
	color: #ffffff;
}

@media (max-width: 768px) {
	.gd-hero {
		padding: 30px 16px;
	}

	.gd-hero-title {
		font-size: 24px;
	}
}

/* ============================================================
   Product archive: left categories + right products
   ============================================================ */

.gd-archive-wrap {
	display: flex;
	align-items: flex-start;
	gap: 32px;
	max-width: 1280px;
	margin: 0 auto;
	padding: 32px 20px 64px;
}

/* ---------- Left sidebar ---------- */

.gd-archive-sidebar {
	flex: 0 0 260px;
	max-width: 260px;
	min-width: 0;
}

/* Mobile toggle (hidden on desktop because <details open> stays open) */
.gd-sidebar-details > summary {
	display: none;
	cursor: pointer;
	font-weight: 600;
	font-size: 15px;
	padding: 12px 2px;
}

.gd-sidebar-inner {
	position: sticky;
	top: 24px;
	background: var(--ast-global-color-5, #ffffff);
	border: 1px solid var(--ast-global-color-8, #e6e6e6);
	border-radius: 10px;
	padding: 20px 18px;
}

.gd-sidebar-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 14px;
	color: var(--ast-global-color-2, #1e293b);
}

/* Search box */
.gd-sidebar-inner .woocommerce-product-search {
	display: flex;
	gap: 6px;
	margin-bottom: 14px;
}

.gd-sidebar-inner .search-field {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--ast-global-color-8, #e6e6e6);
	border-radius: 6px;
	font-size: 13px;
	background: var(--ast-global-color-5, #ffffff);
}

.gd-sidebar-inner .search-submit {
	padding: 8px 12px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	background: var(--ast-global-color-0, #0170b9);
	color: #ffffff;
	font-size: 13px;
}

/* All products link */
.gd-all-link {
	display: block;
	padding: 7px 10px;
	margin-bottom: 6px;
	border-radius: 6px;
	font-size: 14px;
	text-decoration: none;
	color: var(--ast-global-color-0, #0170b9);
	font-weight: 500;
}

.gd-all-link:hover {
	background: var(--ast-global-color-8, #f0f0f0);
}

/* Category tree */
.gd-cat-list,
.gd-cat-list ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gd-cat-list li {
	margin: 2px 0;
}

.gd-cat-list ul {
	margin-left: 12px;
	padding-left: 10px;
	border-left: 1px solid var(--ast-global-color-8, #e6e6e6);
}

.gd-cat-list a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border-radius: 6px;
	font-size: 14px;
	text-decoration: none;
	color: var(--ast-global-color-2, #1e293b);
	transition: background 0.15s;
}

.gd-cat-list a:hover {
	background: var(--ast-global-color-8, #f0f0f0);
}

.gd-cat-list .current-cat > a {
	background: var(--ast-global-color-0, #0170b9);
	color: #ffffff;
	font-weight: 500;
}

.gd-cat-list .count {
	font-size: 12px;
	opacity: 0.7;
}

.gd-cat-list .current-cat > a .count {
	opacity: 0.9;
}

/* ---------- Right content: toolbar + grid ---------- */

.gd-archive-content {
	flex: 1;
	min-width: 0;
}

.gd-archive-content .woocommerce-products-header__title {
	font-size: 26px;
	margin: 0 0 18px;
}

.gd-archive-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 24px;
}

.gd-archive-toolbar .woocommerce-result-count,
.gd-archive-toolbar .woocommerce-ordering {
	margin: 0;
}

.gd-archive-toolbar .orderby {
	padding: 6px 10px;
	border: 1px solid var(--ast-global-color-8, #e6e6e6);
	border-radius: 6px;
	background: var(--ast-global-color-5, #ffffff);
	font-size: 13px;
}

/* Product grid (overrides Astra / WooCommerce defaults) */
.gd-archive-content ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 24px;
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
}

.gd-archive-content ul.products li.product {
	display: flex;
	flex-direction: column;
	margin: 0 !important;
	width: auto !important;
	float: none !important;
	border: 1px solid var(--ast-global-color-8, #e6e6e6);
	border-radius: 10px;
	overflow: hidden;
	background: var(--ast-global-color-5, #ffffff);
	transition: box-shadow 0.2s, transform 0.2s;
}

.gd-archive-content ul.products li.product:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.gd-archive-content ul.products li.product a img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
	margin: 0;
}

.gd-archive-content ul.products li.product .woocommerce-loop-product__title {
	font-size: 14px;
	font-weight: 600;
	padding: 12px 14px 4px;
	margin: 0;
	color: var(--ast-global-color-2, #1e293b);
}

.gd-archive-content ul.products li.product .price {
	padding: 0 14px 12px;
	font-size: 14px;
	color: var(--ast-global-color-0, #0170b9);
}

.gd-archive-content ul.products li.product .button {
	margin: auto 14px 14px;
	text-align: center;
	padding: 9px 14px;
	border-radius: 6px;
	font-size: 13px;
}

/* ---------- Mobile: sidebar collapses to a toggle ---------- */

@media (max-width: 768px) {
	.gd-archive-wrap {
		flex-direction: column;
		gap: 16px;
		padding: 20px 14px 48px;
	}

	.gd-archive-sidebar {
		flex: 1;
		max-width: none;
		width: 100%;
	}

	.gd-sidebar-details > summary {
		display: block;
		list-style: none;
	}

	.gd-sidebar-details > summary::-webkit-details-marker {
		display: none;
	}

	.gd-sidebar-details > summary::after {
		content: "+";
		float: right;
		font-weight: 400;
	}

	.gd-sidebar-details[open] > summary::after {
		content: "-";
	}

	.gd-sidebar-inner {
		position: static;
		margin-top: 8px;
	}

	.gd-archive-content ul.products {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 14px;
	}
}

/* ============================================================
   Fix: Astra sets .site-content .ast-container to display:flex
   on desktop, which puts the hero beside the archive area.
   Restore block flow so hero renders full-width on top.
   ============================================================ */

.woocommerce-page #content > .ast-container,
.woocommerce #content > .ast-container {
	display: block;
}
