@media (max-width: 1170px) {
	.pt-header-nav__inner { display: flex; }
	.pt-main-navigation { position: absolute; top: 100%; right: var(--pt-gutter); left: var(--pt-gutter); z-index: var(--pt-z-menu); display: block; max-height: calc(100dvh - 13rem); overflow-y: auto; padding: .75rem; border: 1px solid #37333c; border-radius: var(--pt-radius-md); background: var(--pt-charcoal); box-shadow: var(--pt-shadow-md); opacity: 0; visibility: hidden; transform: translateY(-.75rem); transition: opacity var(--pt-transition-fast), visibility var(--pt-transition-fast), transform var(--pt-transition-fast); }
	.pt-main-navigation.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
	.pt-main-menu { display: block; }
	.pt-nav-group { display: block; }
	.pt-nav-group + .pt-nav-group { margin-top: .4rem; padding-top: .4rem; border-top: 1px solid #4a4750; }
	.pt-nav-group li + li { border-top: 1px solid #39363e; }
	.pt-nav-group a,
	.pt-nav-link { padding: .8rem .75rem; }
	.pt-header-actions { margin-left: auto; }
	.pt-menu-toggle { display: grid; width: 2.8rem; height: 2.8rem; padding: 0; place-items: center; border: 1px solid #4a4750; border-radius: var(--pt-radius-sm); background: transparent; color: var(--pt-white); cursor: pointer; }
	.pt-menu-toggle__icon { display: grid; gap: 4px; width: 18px; }
	.pt-menu-toggle__icon span { display: block; width: 100%; height: 2px; border-radius: 2px; background: currentColor; transition: transform var(--pt-transition-fast), opacity var(--pt-transition-fast); }
	.pt-menu-toggle[aria-expanded="true"] .pt-menu-toggle__icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
	.pt-menu-toggle[aria-expanded="true"] .pt-menu-toggle__icon span:nth-child(2) { opacity: 0; }
	.pt-menu-toggle[aria-expanded="true"] .pt-menu-toggle__icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

@media (max-width: 1100px) {
	.pt-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pt-category-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	:root { --pt-header-top-height: 57px; --pt-header-nav-height: 58px; }
	.pt-header-top__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--pt-space-4); }
	.pt-header-brand { grid-column: 1; }
	.pt-header-utilities { display: contents; }
	.pt-header-search { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 3.5rem; }
	.pt-header-updates { grid-column: 2; grid-row: 1; }
	.pt-featured-post { grid-template-columns: 1fr; }
	.pt-featured-post__media,
	.pt-featured-post__placeholder { min-height: 20rem; aspect-ratio: 16 / 9; }
	.pt-footer__grid { grid-template-columns: 1.5fr 1fr; }
	.pt-footer__about { grid-column: 1 / -1; }
}

@media (max-width: 782px) {
	.admin-bar .pt-header { top: 46px; }
}

@media (max-width: 620px) {
	:root { --pt-gutter: 1rem; --pt-space-9: 4rem; }
	.pt-header .pt-header-top__inner,
	.pt-header .pt-header-nav__inner { padding-inline: var(--pt-gutter); }
	.pt-brand__image { height: 38px; }
	.pt-header-nav__inner { gap: .75rem; }
	.pt-header-actions { margin-left: auto; }
	.pt-post-grid,
	.pt-category-list { grid-template-columns: 1fr; }
	.pt-featured-post__media,
	.pt-featured-post__placeholder { min-height: 15rem; }
	.pt-featured-post__content { padding: 1.5rem; }
	.pt-post-meta { gap: .35rem .55rem; }
	.pt-post-meta > * + *::before { margin-right: .55rem; }
	.pt-author-box { align-items: flex-start; }
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { text-align: left; }
	.pt-footer__grid { grid-template-columns: 1fr; gap: var(--pt-space-6); }
	.pt-footer__about { grid-column: auto; }
	.pt-footer__bottom-inner { flex-direction: column; align-items: flex-start; justify-content: center; padding-block: var(--pt-space-4); }
	.pt-entry-content :where(h2, h3, h4) { scroll-margin-top: 14rem; }
}

/* Mobile drawer — estrutura funcional */
.pt-mobile-drawer,
.pt-mobile-drawer-overlay {
	display: none;
}

@media (max-width: 1170px) {
	.pt-mobile-drawer-overlay {
		position: fixed;
		inset: 0;
		z-index: calc(var(--pt-z-header) + 10);
		display: block;
		background: rgba(0, 0, 0, .68);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition:
			opacity var(--pt-transition-fast),
			visibility var(--pt-transition-fast);
	}

	.pt-mobile-drawer-overlay.is-open {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.pt-mobile-drawer {
		position: fixed;
		top: 0;
		right: 0;
		z-index: calc(var(--pt-z-header) + 11);
		display: flex;
		flex-direction: column;
		width: min(88vw, 430px);
		height: 100dvh;
		overflow-y: auto;
		background: var(--pt-black);
		color: var(--pt-white);
		visibility: hidden;
		transform: translateX(100%);
		transition:
			transform .28s ease,
			visibility .28s ease;
	}

	.pt-mobile-drawer.is-open {
		visibility: visible;
		transform: translateX(0);
	}

	body.pt-menu-open {
		overflow: hidden;
	}
}

/* =========================================================
   Header mobile PluginTema Blog
   ========================================================= */
@media (max-width: 1170px) {

	/* Barra superior: logo | Atualizações */
	.pt-header-top__inner {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		min-height: var(--pt-header-top-height);
	}

	.pt-header-brand {
		flex: 0 1 auto;
		grid-column: auto;
	}

	.pt-header-utilities {
		display: flex;
		align-items: center;
		margin-left: auto;
	}

	/* Busca sai completamente do header visível no mobile.
	   Ela ficará apenas dentro do drawer. */
	.pt-header-search {
		display: none;
	}

	.pt-header-updates {
		flex-shrink: 0;
		font-size: 1rem;
		line-height: 1;
	}

	/* Barra inferior: somente o botão de menu */
	.pt-header-nav__inner {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		min-height: var(--pt-header-nav-height);
	}

	/* Navegação desktop não vira mais dropdown mobile. */
	.pt-main-navigation {
		display: none;
	}

	.pt-header-actions {
		display: flex;
		width: 100%;
		align-items: center;
		justify-content: flex-end;
		margin-left: 0;
	}

	/* Conta e carrinho deixam o header visível. */
	.pt-header-actions > .pt-header-action {
		display: none;
	}

	/* Hambúrguer segue exatamente a linguagem dos botões atuais. */
	.pt-menu-toggle {
		display: grid;
		place-items: center;
		width: auto;
		min-width: 3.75rem;
		height: 2.8rem;
		min-height: 2.8rem;
		padding: 0 .55rem;
		border: 1px solid rgba(255, 255, 255, .75);
		border-radius: var(--pt-radius-sm);
		background: var(--pt-black);
		box-shadow: 3px 3px 0 var(--pt-white);
		color: var(--pt-white);
		cursor: pointer;
		transition:
			border-color var(--pt-transition-fast),
			background var(--pt-transition-fast),
			box-shadow var(--pt-transition-fast),
			transform var(--pt-transition-fast);
	}

	.pt-menu-toggle:hover {
		transform: translate(2px, 2px);
		border-color: var(--pt-white);
		background: var(--pt-black);
		box-shadow: 1px 1px 0 var(--pt-white);
	}

	.pt-menu-toggle:focus,
	.pt-menu-toggle:focus-visible,
	.pt-menu-toggle:active {
		background: var(--pt-black);
	}

	.pt-menu-toggle:active {
		transform: translate(3px, 3px);
		box-shadow: none;
	}
}

/* =========================================================
   Mobile drawer — visual PluginTema
   Referência: menu mobile de plugintema.com.br
   ========================================================= */
@media (max-width: 1170px) {

	.pt-mobile-drawer {
		box-sizing: border-box;
		padding: 0 1.15rem 2rem;
		background: #fff;
		color: #111;
		color-scheme: light;
	}

	/* Cabeçalho do drawer */
	.pt-mobile-drawer__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		padding: 1.25rem 0 1rem;
	}

	.pt-mobile-drawer__brand {
		display: inline-flex;
		align-items: center;
	}

	.pt-mobile-drawer__brand .pt-brand__image {
		width: 135px;
		height: 38px;
	}

	.pt-mobile-drawer__brand .pt-brand__image--mask {
		background-color: #000;
	}

	.pt-mobile-drawer__close {
		display: grid;
		place-items: center;
		width: 2.5rem;
		height: 2.5rem;
		padding: 0;
		border: 0;
		background: transparent;
		box-shadow: none;
		color: #aaa;
		font-family: Arial, sans-serif;
		font-size: 2.25rem;
		font-weight: 700;
		line-height: 1;
		cursor: pointer;
	}

	.pt-mobile-drawer__close:hover,
	.pt-mobile-drawer__close:focus,
	.pt-mobile-drawer__close:active {
		border: 0;
		background: transparent;
		box-shadow: none;
		color: #111;
		transform: none;
	}

	/* Minha Conta */
	.pt-mobile-drawer__tools {
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}

	.pt-mobile-account {
		display: inline-flex;
		align-items: center;
		align-self: flex-start;
		gap: .45rem;
		min-height: 2.45rem;
		padding: 0 .75rem;
		border: 1.5px solid #111;
		border-radius: .55rem;
		background: #fff;
		box-shadow: 3px 3px 0 #111;
		color: #111;
		font-size: .88rem;
		font-weight: 700;
		text-decoration: none;
		transition:
			transform var(--pt-transition-fast),
			box-shadow var(--pt-transition-fast);
	}

	.pt-mobile-account .pt-header-action__icon {
		width: 16px;
		height: 16px;
		color: #111;
	}

	.pt-mobile-account:hover {
		color: #111;
		text-decoration: none;
		transform: translate(2px, 2px);
		box-shadow: 1px 1px 0 #111;
	}

	.pt-mobile-account:active {
		transform: translate(3px, 3px);
		box-shadow: none;
	}

	/* Busca */
	.pt-mobile-search {
		margin-top: 2.25rem;
		padding-bottom: .9rem;
		border-bottom: 1px solid #bbb;
	}

	.pt-mobile-search .pt-search-form {
		position: relative;
		width: 100%;
		margin: 0;
	}

	.pt-mobile-search .pt-search-form input {
		width: 100%;
		height: 2.7rem;
		padding: 0 3rem 0 1.25rem;
		border: 0;
		border-radius: 999px;
		background: #2a292b;
		box-shadow: none;
		color: #fff;
		font-size: .92rem;
	}

	.pt-mobile-search .pt-search-form input::placeholder {
		color: #d2cfd5;
		opacity: 1;
	}

	.pt-mobile-search .pt-search-form input:focus {
		border: 0;
		background: #2a292b;
		box-shadow: 0 0 0 2px #6212e6;
		color: #fff;
	}

	.pt-mobile-search .pt-search-form button {
		position: absolute;
		top: 0;
		right: 0;
		display: grid;
		place-items: center;
		width: 3rem;
		height: 2.7rem;
		padding: 0;
		border: 0;
		border-radius: 999px;
		background: transparent;
		box-shadow: none;
		color: #fff;
		transform: none;
	}

	.pt-mobile-search .pt-search-form button:hover,
	.pt-mobile-search .pt-search-form button:focus,
	.pt-mobile-search .pt-search-form button:active {
		border: 0;
		background: transparent;
		box-shadow: none;
		color: #fff;
		transform: none;
	}

	/* Navegação */
	.pt-mobile-drawer__navigation {
		margin-top: 1rem;
		color: #111;
	}

	.pt-mobile-menu-section__toggle {
		display: flex;
		width: 100%;
		align-items: center;
		justify-content: flex-start;
		gap: .65rem;
		padding: .35rem 0;
		border: 0;
		background: transparent;
		box-shadow: none;
		color: #111;
		font-family: var(--pt-font-sans);
		font-size: 1rem;
		font-weight: 700;
		text-align: left;
		cursor: pointer;
	}

	.pt-mobile-menu-section__toggle:hover,
	.pt-mobile-menu-section__toggle:focus,
	.pt-mobile-menu-section__toggle:active {
		border: 0;
		background: transparent;
		box-shadow: none;
		color: #111;
		transform: none;
	}

	.pt-mobile-menu-section__chevron {
		display: block;
		width: .5rem;
		height: .5rem;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(-135deg);
		transition: transform var(--pt-transition-fast);
	}

	.pt-mobile-menu-section__toggle[aria-expanded="false"]
	.pt-mobile-menu-section__chevron {
		transform: rotate(45deg);
	}

	.pt-mobile-menu-categories {
		margin: .25rem 0 .85rem;
		padding: 0;
		list-style: none;
	}

	.pt-mobile-menu-categories li {
		margin: 0;
		padding: 0;
	}

	.pt-mobile-menu-categories a {
		display: block;
		padding: .36rem .65rem;
		color: #68656c;
		font-size: .94rem;
		font-weight: 400;
		line-height: 1.35;
		text-decoration: none;
	}

	.pt-mobile-menu-categories a:hover,
	.pt-mobile-menu-categories a:focus {
		color: #111;
		text-decoration: none;
	}

	.pt-mobile-store-link {
		display: block;
		margin-top: .55rem;
		padding: .45rem 0;
		color: #111;
		font-size: 1rem;
		font-weight: 700;
		text-decoration: none;
	}

	.pt-mobile-store-link:hover,
	.pt-mobile-store-link:focus {
		color: #6212e6;
		text-decoration: none;
	}

	.pt-mobile-socials {
		display: flex;
		align-items: center;
		gap: .65rem;
		margin-top: 2rem;
	}
}

/* =========================================================
   Ações flutuantes — fileira horizontal no mobile
   O botão voltar ao topo permanece intocado à direita.
   ========================================================= */
@media (max-width: 620px) {

	/* imediatamente à esquerda do Voltar ao topo */
	.pt-theme-toggle {
		right: 74px !important;
		bottom: 14px !important;
	}

	.pt-share-toggle {
		right: 134px !important;
		bottom: 14px !important;
	}

	.pt-comments-jump {
		right: 194px !important;
		bottom: 14px !important;
	}

	.pt-article-favorite__button {
		right: 254px !important;
		bottom: 14px !important;
	}
}

/* =========================================================
   Correção de overflow horizontal mobile
   ========================================================= */
@media (max-width: 1170px) {

	html,
	body {
		width: 100%;
		max-width: 100%;
		overflow-x: hidden;
	}

	@supports (overflow: clip) {
		html,
		body {
			overflow-x: clip;
		}
	}

	.pt-mobile-drawer {
		max-width: 100vw;
	}
}

/* =========================================================
   Drawer mobile — viewport, overlay e scroll lock
   ========================================================= */
@media (max-width: 1170px) {

	.pt-mobile-drawer-overlay {
		position: fixed !important;
		inset: 0 !important;
		background: rgba(0, 0, 0, .88) !important;
		overscroll-behavior: none;
	}

	.pt-mobile-drawer {
		position: fixed !important;
		top: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		left: auto !important;

		width: min(88vw, 430px);
		max-width: 100vw;

		height: 100dvh !important;
		min-height: 100dvh;
		max-height: 100dvh !important;

		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	html.pt-menu-open,
	body.pt-menu-open {
		overflow: hidden !important;
		overscroll-behavior: none !important;
	}

	/* Quando logado, respeita a admin bar do WordPress. */
	body.admin-bar .pt-mobile-drawer {
		top: 46px !important;
		bottom: 0 !important;
		height: calc(100dvh - 46px) !important;
		min-height: calc(100dvh - 46px);
		max-height: calc(100dvh - 46px) !important;
	}

	body.admin-bar .pt-mobile-drawer-overlay {
		top: 46px !important;
	}
}

/* =========================================================
   Drawer mobile — backdrop definitivo
   ========================================================= */
@media (max-width: 1170px) {

	.pt-mobile-drawer-overlay {
		position: fixed !important;
		inset: 0 !important;
		z-index: 99990 !important;
		width: 100vw !important;
		height: 100dvh !important;
		background: rgba(0, 0, 0, .82) !important;
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
	}

	.pt-mobile-drawer-overlay.is-open {
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto !important;
	}

	.pt-mobile-drawer {
		z-index: 99991 !important;
	}

	body.pt-menu-open {
		overflow: hidden !important;
	}
}

/* =========================================================
   Drawer mobile — acabamento final
   ========================================================= */
@media (max-width: 1170px) {

	.pt-mobile-drawer {
		/* Cantos expostos como no menu principal PluginTema */
		border-radius: 16px 0 0 16px !important;
		box-shadow: -8px 0 28px rgb(0 0 0 / 22%);
	}

	/* O overlay cobre inclusive todo o header do site. */
	.pt-mobile-drawer-overlay {
		z-index: 99990 !important;
	}

	.pt-mobile-drawer {
		z-index: 99991 !important;
	}

	/* Redes sociais abaixo de LOJA */
	.pt-mobile-socials {
		display: flex !important;
		align-items: center;
		gap: .65rem;
		margin-top: 2rem;
		padding-bottom: 1rem;
	}

	.pt-mobile-social {
		display: grid;
		width: 2rem;
		height: 2rem;
		padding: .3rem;
		place-items: center;
		border: 2px solid #17151a;
		border-radius: 6px;
		background: #fff;
		box-shadow: 2px 2px 0 #17151a;
		color: #17151a;
		text-decoration: none;
		transition:
			box-shadow var(--pt-transition-fast),
			transform var(--pt-transition-fast);
	}

	.pt-mobile-social:hover {
		color: #17151a;
		transform: translate(1px, 1px);
		box-shadow: 1px 1px 0 #17151a;
	}

	.pt-mobile-social:active {
		transform: translate(2px, 2px);
		box-shadow: none;
	}

	.pt-mobile-social__svg {
		display: block;
		width: 100%;
		height: 100%;
		fill: currentColor;
	}
}

/* =========================================================
   Drawer mobile — posição final na viewport
   ========================================================= */
@media (max-width: 1170px) {

	.pt-mobile-drawer,
	body.admin-bar .pt-mobile-drawer {
		top: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		left: auto !important;

		height: 100dvh !important;
		min-height: 100dvh !important;
		max-height: 100dvh !important;

		margin: 0 !important;
	}

	.pt-mobile-drawer-overlay,
	body.admin-bar .pt-mobile-drawer-overlay {
		top: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		left: 0 !important;

		width: 100vw !important;
		height: 100dvh !important;
		margin: 0 !important;
	}
}

/* =========================================================
   Redes sociais mobile — acabamento dos ícones
   ========================================================= */
@media (max-width: 1170px) {

	.pt-mobile-social {
		box-sizing: border-box !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;

		width: 34px !important;
		height: 34px !important;
		padding: 6px !important;

		overflow: visible !important;
		border: 2px solid #17151a !important;
		border-radius: 6px !important;
		background: #fff !important;
		color: #17151a !important;
	}

	.pt-mobile-social__svg {
		display: block !important;
		flex: 0 0 auto;
		width: 18px !important;
		height: 18px !important;
		max-width: 18px !important;
		max-height: 18px !important;
		overflow: visible !important;
		fill: currentColor !important;
	}

	.pt-mobile-social--instagram .pt-mobile-social__svg {
		width: 17px !important;
		height: 19px !important;
	}

	.pt-mobile-social--youtube .pt-mobile-social__svg {
		width: 19px !important;
		height: 17px !important;
	}
}

/* YouTube mobile — asset dedicado sem recorte */
@media (max-width: 1170px) {

	.pt-mobile-social__image {
		display: block !important;
		width: 20px !important;
		height: 20px !important;
		max-width: 20px !important;
		max-height: 20px !important;
		object-fit: contain !important;
		object-position: center !important;
	}

	.pt-mobile-social--youtube {
		overflow: visible !important;
		padding: 5px !important;
	}
}

/* =========================================================
   Categorias do drawer — divisão visual 4 + 4
   ========================================================= */
@media (max-width: 1170px) {

	.pt-mobile-menu-categories li:nth-child(4) {
		margin-bottom: .65rem;
		padding-bottom: .65rem;
		border-bottom: 1px solid #d6d3d8;
	}

	.pt-mobile-menu-categories li:nth-child(5) {
		margin-top: .15rem;
	}
}

/* =========================================================
   Fix definitivo — ícone YouTube no drawer mobile
   ========================================================= */
@media (max-width: 1170px) {

        .pt-mobile-socials {
                display: flex;
                align-items: center;
                gap: .7rem;
                margin-top: 1rem;
                padding-bottom: .25rem;
        }

        .pt-mobile-social {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 2.5rem;
                height: 2.5rem;
                padding: 0;
                border: 2px solid #17151a;
                border-radius: .55rem;
                background: #fff;
                box-shadow: 2px 2px 0 #17151a;
                color: #17151a;
                text-decoration: none;
                overflow: hidden;
                flex: 0 0 auto;
        }

        .pt-mobile-social__svg {
                display: block;
                width: 18px;
                height: 18px;
                max-width: 18px;
                max-height: 18px;
                flex: 0 0 18px;
        }

        .pt-mobile-social--youtube .pt-mobile-social__svg {
                width: 20px;
                height: 20px;
                max-width: 20px;
                max-height: 20px;
        }

        .pt-mobile-social--youtube svg,
        .pt-mobile-social--youtube path {
                pointer-events: none;
        }
}

/* YouTube — SVG próprio */
@media (max-width: 1170px) {

        .pt-mobile-social--youtube {
                overflow: visible !important;
        }

        .pt-mobile-social--youtube .pt-mobile-social__svg--youtube {
                display: block !important;
                width: 22px !important;
                height: 22px !important;
                min-width: 22px !important;
                min-height: 22px !important;
                max-width: 22px !important;
                max-height: 22px !important;
                flex: 0 0 22px !important;
                overflow: visible !important;
        }
}
