/* ── IGcr Theme — Navigation ───────────────────────────────────────────────
 *
 * Desktop sidebar + mobile header/footer navigation styles.
 * ────────────────────────────────────────────────────────────────────────── */

/* ── Sidebar ── */

.igcr-sidebar {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 8px 12px 20px;
}

/* Logo + pin */
.igcr-sidebar-logo {
	height: 73px;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 0 12px;
	margin-bottom: 10px;
}


/* Pin button — hidden by default, shown only when sidebar is expanded */
.igcr-sidebar-pin {
	margin-left: auto;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	border-radius: var( --igcr-theme-radius );
	color: var( --igcr-theme-text-muted );
	display: none;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: opacity 0.15s, color 0.15s, transform 0.15s;
}

/* Show pin when sidebar is hovered (expanded) */
.igcr-sidebar-wrap:hover .igcr-sidebar-pin {
	display: flex;
	opacity: 0.6;
}

/* Show pin when sidebar is pinned */
.igcr-sidebar-pinned .igcr-sidebar-pin {
	display: flex;
	opacity: 0.6;
	transform: rotate( 45deg );
}

.igcr-sidebar-pin:hover {
	opacity: 1;
	color: var( --igcr-theme-text );
}

.igcr-topbar-logo {
	text-decoration: none;
	color: var( --igcr-theme-text );
	display: flex;
	align-items: center;
}

/* Logo images — !important overrides WooCommerce's global `img { height: auto }` */
.igcr-logo-img {
	display: block;
	height: 28px !important;
	width: auto !important;
	flex-shrink: 0;
}

/* Sidebar logo: smaller */
.igcr-sidebar-logo .igcr-logo-img {
	height: 24px !important;
}

/* Logo variants: "light" SVG = dark-colored (for light bg), "dark" SVG = light-colored (for dark bg) */
.igcr-logo-light {
	display: block !important;
}

.igcr-logo-dark {
	display: none !important;
}

@media ( prefers-color-scheme: dark ) {
	.igcr-logo-light {
		display: none !important;
	}

	.igcr-logo-dark {
		display: block !important;
	}
}

.igcr-logo-full {
	display: none;
	align-items: center;
}

.igcr-logo-icon {
	display: flex;
	align-items: center;
}

/* Nav list */
.igcr-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
}

/* Nav item */
.igcr-nav-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px;
	border-radius: var( --igcr-theme-radius );
	color: var( --igcr-theme-text );
	text-decoration: none;
	font-size: 15px;
	transition: background 0.15s;
	line-height: 1;
}

.igcr-nav-item:hover {
	background: var( --igcr-theme-border-light );
	color: var( --igcr-theme-text );
}

.igcr-nav-item.is-active {
	font-weight: 700;
}

.igcr-nav-item.is-active .igcr-t-icon {
	stroke-width: 2.5;
}

.igcr-nav-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.igcr-nav-label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Login variant */
.igcr-nav-login {
	color: var( --igcr-theme-accent );
}

.igcr-nav-login:hover {
	color: var( --igcr-theme-accent-hover );
}

/* ── More menu dropdown ── */

.igcr-more-menu {
	position: fixed;
	bottom: 72px;
	left: 4px;
	width: 220px;
	background: var( --igcr-theme-bg-card );
	border: 1px solid var( --igcr-theme-border );
	border-radius: var( --igcr-theme-radius );
	box-shadow: var( --igcr-theme-shadow );
	z-index: 200;
	padding: 8px 0;
}

.igcr-more-menu[hidden] {
	display: none;
}

.igcr-more-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.igcr-more-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	color: var( --igcr-theme-text );
	text-decoration: none;
	font-size: 14px;
	transition: background 0.1s;
}

.igcr-more-item:hover {
	background: var( --igcr-theme-border-light );
	color: var( --igcr-theme-text );
}

/* ── Mobile header ── */

.igcr-mobile-header-wrap {
	padding: 0;
}

.igcr-mobile-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var( --igcr-theme-mobile-header-h );
	background: var( --igcr-theme-bg-card );
	border-bottom: 1px solid var( --igcr-theme-border );
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	z-index: 100;
}

body.admin-bar .igcr-mobile-header {
	top: 46px;
}

.igcr-mobile-logo {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.5px;
	color: var( --igcr-theme-text );
	text-decoration: none;
}

.igcr-mobile-header-actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

.igcr-mobile-action-btn {
	color: var( --igcr-theme-text );
	text-decoration: none;
	display: flex;
	align-items: center;
}

/* ── Mobile footer nav ── */

.igcr-mobile-footer-wrap {
	padding: 0;
}

.igcr-mobile-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: var( --igcr-theme-mobile-footer-h );
	background: var( --igcr-theme-bg-card );
	border-top: 1px solid var( --igcr-theme-border );
	display: flex;
	align-items: center;
	justify-content: space-around;
	z-index: 100;
}

.igcr-mobile-nav-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	height: 100%;
	color: var( --igcr-theme-text );
	text-decoration: none;
	transition: opacity 0.1s;
}

.igcr-mobile-nav-btn:hover {
	color: var( --igcr-theme-text );
}

.igcr-mobile-nav-btn.is-active .igcr-t-icon {
	stroke-width: 2.5;
}

.igcr-mobile-nav-btn:not(.is-active) {
	opacity: 0.6;
}

/* ── Search overlay ── */

.igcr-search-overlay {
	position: fixed;
	inset: 0;
	background: var( --igcr-theme-overlay );
	z-index: 300;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 120px;
}

.igcr-search-overlay[hidden] {
	display: none;
}

.igcr-search-box {
	width: 90%;
	max-width: 500px;
	background: var( --igcr-theme-bg-card );
	border-radius: var( --igcr-theme-radius );
	box-shadow: var( --igcr-theme-shadow );
	overflow: hidden;
}

.igcr-search-input {
	width: 100%;
	border: none;
	padding: 16px 20px;
	font-size: 16px;
	font-family: var( --igcr-theme-font );
	background: transparent;
	color: var( --igcr-theme-text );
	outline: none;
}

.igcr-search-input::placeholder {
	color: var( --igcr-theme-text-muted );
}

/* ── Header menu (sidebar bottom) ── */

.igcr-header-menu-wrap {
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var( --igcr-theme-border-light );
}

.igcr-header-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.igcr-header-menu li a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: var( --igcr-theme-radius );
	color: var( --igcr-theme-text-secondary );
	text-decoration: none;
	font-size: 13px;
	transition: background 0.15s, color 0.15s;
}

.igcr-header-menu li a:hover {
	background: var( --igcr-theme-border-light );
	color: var( --igcr-theme-text );
}

/* Mobile header menu (inline) */
.igcr-mobile-header-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 16px;
}

.igcr-mobile-header-menu li a {
	color: var( --igcr-theme-text );
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
}

.igcr-mobile-header-menu li a:hover {
	color: var( --igcr-theme-accent );
}

/* Collapsed sidebar (default): hide header menu labels, show icons */
.igcr-header-menu-label {
	display: none;
}

.igcr-header-menu li a {
	justify-content: center;
	padding: 10px;
}

/* Hover expand: restore header menu labels */
.igcr-sidebar-wrap:hover .igcr-header-menu-label {
	display: inline;
}

.igcr-sidebar-wrap:hover .igcr-header-menu li a {
	justify-content: flex-start;
	padding: 10px 12px;
}

/* Pinned: restore header menu labels */
.igcr-sidebar-pinned .igcr-header-menu-label {
	display: inline;
}

.igcr-sidebar-pinned .igcr-header-menu li a {
	justify-content: flex-start;
	padding: 10px 12px;
}

/* Medium screens: pinned state stays collapsed, hover still works */
@media ( max-width: 1264px ) {
	.igcr-sidebar-pinned .igcr-header-menu-label {
		display: none;
	}

	.igcr-sidebar-pinned .igcr-header-menu li a {
		justify-content: center;
		padding: 10px;
	}

	/* Medium: pinned state reverts to collapsed, but hover still shows pin */
	.igcr-sidebar-pinned .igcr-sidebar-pin {
		display: none;
	}
}

/* ── Topbar (Header Bar) — Instagram.com-style top bar ── */

.igcr-topbar {
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	height: 54px;
	background: var( --igcr-theme-bg-card );
	border-bottom: 1px solid var( --igcr-theme-border );
	z-index: 90;
	margin-left: var( --igcr-theme-sidebar-collapsed-w );
	transition: margin-left 0.25s ease;
}

.igcr-sidebar-pinned .igcr-topbar {
	margin-left: var( --igcr-theme-sidebar-w );
}

.igcr-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.igcr-topbar-left {
	flex: 0 0 auto;
}

.igcr-topbar-right {
	flex: 1;
	display: flex;
	justify-content: flex-end;
}

.igcr-topbar-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.igcr-topbar-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	color: var( --igcr-theme-text );
	text-decoration: none;
	border-radius: var( --igcr-theme-radius );
	transition: background 0.15s, color 0.15s;
}

.igcr-topbar-link:hover {
	color: var( --igcr-theme-text );
	background: var( --igcr-theme-border-light );
}

/* Button-style link (add CSS class "btn" to the menu item in WP Admin) */
.igcr-topbar-btn {
	background: var( --igcr-theme-btn-primary );
	color: var( --igcr-theme-on-accent ) !important;
	border-radius: var( --igcr-theme-radius );
}

.igcr-topbar-btn:hover {
	background: var( --igcr-theme-btn-primary-hover );
	color: var( --igcr-theme-on-accent ) !important;
}

/* WC mini cart icon in topbar */
.igcr-topbar-cart {
	position: relative;
	padding: 8px;
}

.igcr-topbar-cart-count {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: var( --igcr-theme-danger );
	color: var( --igcr-theme-on-accent );
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	border-radius: 8px;
}

/* Medium screens: pinned reverts to collapsed offset */
@media ( max-width: 1264px ) {
	.igcr-sidebar-pinned .igcr-topbar {
		margin-left: var( --igcr-theme-sidebar-collapsed-w );
	}
}

/* Mobile: no sidebar offset, topbar hidden (mobile header used instead) */
@media ( max-width: 767px ) {
	.igcr-topbar {
		display: none !important;
	}
}

/* Admin bar offset */
body.admin-bar .igcr-topbar {
	top: 32px;
}

@media ( max-width: 782px ) {
	body.admin-bar .igcr-topbar {
		top: 46px;
	}
}

/* ── Site footer ── */

.igcr-site-footer {
	margin-left: var( --igcr-theme-sidebar-collapsed-w );
	padding: 32px 20px;
	border-top: 1px solid var( --igcr-theme-border-light );
	text-align: center;
	transition: margin-left 0.25s ease;
}

/* Pinned: footer shifts with content */
.igcr-sidebar-pinned .igcr-site-footer {
	margin-left: var( --igcr-theme-sidebar-w );
}

.igcr-footer-nav {
	margin-bottom: 12px;
}

.igcr-footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 20px;
}

.igcr-footer-menu li a {
	color: var( --igcr-theme-text-secondary );
	text-decoration: none;
	font-size: 12px;
}

.igcr-footer-menu li a:hover {
	color: var( --igcr-theme-text );
}

.igcr-footer-copy {
	margin: 0;
	font-size: 12px;
	color: var( --igcr-theme-text-muted );
}

@media ( max-width: 1264px ) {
	.igcr-sidebar-pinned .igcr-site-footer {
		margin-left: var( --igcr-theme-sidebar-collapsed-w );
	}
}

@media ( max-width: 767px ) {
	.igcr-site-footer {
		margin-left: 0 !important;
		padding-bottom: calc( var( --igcr-theme-mobile-footer-h ) + 20px );
	}
}
