/*
Theme Name: GRC Total
Description: Block theme for grctotal.com. Replaces the legacy Reload theme.
Version: 1.1.4
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: grctotal
License: GPLv2 or later
*/

/* Source Sans Pro is licensed under the SIL Open Font License 1.1. */

.wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.wp-site-blocks > main,
.wp-site-blocks > .wp-block-group:has(> main) {
	flex: 1;
}

:where(a, button, .wp-element-button) {
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary-dark);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition: none !important;
		animation: none !important;
	}
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.admin-bar .site-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.site-header .wp-block-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--primary-dark);
}

.site-header .wp-block-navigation__container > .wp-block-navigation-item:last-child > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--white);
	padding: 0.55em 1.2em;
	border-radius: 8px;
}

.site-header .wp-block-navigation__container > .wp-block-navigation-item:last-child > .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--white);
}

.wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--border) !important;
	border-radius: 10px;
	box-shadow: var(--wp--preset--shadow--card);
	padding: 0.5rem 0;
	min-width: 260px !important;
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.5rem 1.1rem;
	font-weight: 400;
}

/* Buttons */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: inherit;
	border: 2px solid currentColor;
	padding: calc(0.8em - 2px) calc(1.6em - 2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--secondary);
	border-color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-dark > .wp-block-button__link {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-dark > .wp-block-button__link:hover {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--secondary);
}

.wp-element-button:hover {
	transform: translateY(-1px);
}

/* Home */
.home-hero {
	background-image: radial-gradient(ellipse at 85% 20%, rgba(36, 209, 196, 0.18), transparent 55%), linear-gradient(160deg, #1c2730 0%, #16202a 100%);
}

.home-hero .eyebrow,
.section-kicker {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary-dark);
	margin-bottom: 0.25rem;
}

.home-hero .eyebrow {
	color: var(--wp--preset--color--primary);
}

.home-hero .hero-lead {
	color: rgba(255, 255, 255, 0.78);
	max-width: 34rem;
	line-height: 1.55;
}

.hero-graphic img {
	width: 100%;
	opacity: 0.9;
}

.logo-row {
	gap: var(--wp--preset--spacing--40) !important;
}

.logo-row .wp-block-image {
	margin: 0;
	flex: 1 1 160px;
	text-align: center;
}

.logo-row img {
	max-height: 56px;
	width: auto !important;
	filter: grayscale(1);
	opacity: 0.6;
	transition: filter 0.2s ease, opacity 0.2s ease;
}

.logo-row a:hover img {
	filter: none;
	opacity: 1;
}

.section-head h2 {
	margin-top: 0.25rem;
}

.card,
.partner {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	padding: var(--wp--preset--spacing--40) !important;
	box-shadow: var(--wp--preset--shadow--card);
}

.card {
	display: flex;
	flex-direction: column;
}

.card:hover {
	box-shadow: var(--wp--preset--shadow--raised);
	transform: translateY(-2px);
}

.card .card-index {
	font-weight: 700;
	color: var(--wp--preset--color--primary-dark);
	background: var(--wp--preset--color--primary-soft);
	border-radius: 8px;
	display: inline-block;
	align-self: flex-start;
	padding: 0.15rem 0.6rem;
	font-size: 0.875rem;
}

.card h3 {
	margin-top: 1rem;
	font-size: 1.375rem;
}

.card .card-link {
	margin-top: auto;
	padding-top: 0.5rem;
	font-weight: 600;
}

.card .card-link a {
	text-decoration: none;
}

.partner-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.partner-logo img {
	max-height: 52px;
	width: auto !important;
}

.partner p {
	margin-top: 1rem;
}

@media (max-width: 781px) {
	.partner-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.cta-band p {
	color: var(--wp--preset--color--secondary);
	margin-top: 0.5rem;
}

/* Inner pages */
.page-hero .wp-block-post-title {
	font-size: var(--wp--preset--font-size--xx-large);
	margin: 0;
}

/* Footer */
/* !important: some old pages ship page-builder CSS such as p { color: black !important }. */
.site-footer .footer-muted {
	color: rgba(255, 255, 255, 0.65) !important;
	max-width: 22rem;
}

.site-footer .footer-title {
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--wp--preset--color--primary) !important;
	margin-bottom: 1rem;
}

.site-footer .footer-links {
	list-style: none;
	padding: 0;
	margin: 0;
}

.site-footer .footer-links li {
	margin-bottom: 0.5rem;
}

.site-footer .footer-links a {
	text-decoration: none;
	color: rgba(255, 255, 255, 0.85);
}

.site-footer .footer-links a:hover {
	color: var(--wp--preset--color--primary);
}


.site-footer .footer-sep {
	border-color: rgba(255, 255, 255, 0.12);
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--30);
}

/* Classes emitted by the grctotal-migrator plugin. */
.wp-block-image img {
	height: auto;
}

.is-centered {
	text-align: center;
}

.is-centered > .wp-block-buttons {
	justify-content: center;
}

.is-centered .wp-block-image img {
	margin-inline: auto;
}

.wp-block-heading.has-title-line::after {
	content: "";
	display: block;
	width: 48px;
	height: 3px;
	border-radius: 2px;
	margin-top: 0.6em;
	background: var(--wp--preset--color--primary);
}

.is-centered .wp-block-heading.has-title-line::after {
	margin-inline: auto;
}

.entry-content h4 a,
.entry-content h5 a {
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

.entry-content h4 a:hover,
.entry-content h5 a:hover {
	color: var(--wp--preset--color--primary-dark);
}

/* Converted rows with a background read as cards inside the content column. */
.entry-content .wp-block-group.has-background:not(.alignfull) {
	border-radius: 14px;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.entry-content .wp-block-group.alignfull.has-background {
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}

.wp-block-details {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	padding: 0.9rem 1.25rem;
	background: var(--wp--preset--color--white);
}

.wp-block-details + .wp-block-details {
	margin-top: 0.75rem;
}

.wp-block-details summary {
	cursor: pointer;
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	font-size: 1.0625rem;
}

.wp-block-columns .wp-block-group.alignfull {
	margin-inline: 0;
}

/* Contact Form 7 */
.wpcf7 input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	padding: 0.7rem 0.9rem;
	font: inherit;
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--white);
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	border-color: var(--wp--preset--color--primary-dark);
	outline: 2px solid var(--wp--preset--color--primary-soft);
}

.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--secondary);
	border: 0;
	border-radius: 8px;
	padding: 0.8em 2em;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--white);
}

.wpcf7 label {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--wp--preset--color--contrast);
}

/* Legacy hand-written tables inside converted content. */
.entry-content table {
	width: 100% !important;
	border-collapse: collapse;
	border: 1px solid var(--wp--preset--color--border);
}

.entry-content td,
.entry-content th {
	border: 1px solid var(--wp--preset--color--border);
	padding: 0.75rem;
	vertical-align: top;
}

@media (max-width: 781px) {
	.entry-content table {
		display: block;
		overflow-x: auto;
	}
}

.wp-block-site-logo img {
	height: auto;
}

/* WooCommerce classic forms */
.woocommerce form .input-text,
.woocommerce form select,
.woocommerce .select2-container .select2-selection--single {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	padding: 0.7rem 0.9rem;
	font: inherit;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--contrast);
}

.woocommerce .select2-container .select2-selection--single {
	height: auto;
	padding: 0.35rem 0.25rem;
}

.woocommerce .select2-container .select2-selection--single .select2-selection__rendered {
	line-height: 1.8;
	color: var(--wp--preset--color--contrast);
	font-size: 1rem;
}

.woocommerce .select2-container .select2-selection--single .select2-selection__arrow {
	height: 100%;
}

.woocommerce form .form-row label {
	font-weight: 600;
	color: var(--wp--preset--color--contrast);
	font-size: 0.9375rem;
}

.woocommerce-checkout h3,
.woocommerce-checkout #order_review_heading {
	font-size: var(--wp--preset--font-size--x-large);
}

.woocommerce table.shop_table {
	border-radius: 12px;
	border-color: var(--wp--preset--color--border);
}

.woocommerce-checkout #payment {
	background: var(--wp--preset--color--surface);
	border-radius: 12px;
}

.woocommerce-checkout #payment #place_order {
	float: none;
	width: 100%;
	box-sizing: border-box;
	margin-top: 0.5rem;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--secondary);
	border-radius: 8px;
	font-weight: 600;
	padding: 0.8em 1.6em;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	background: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--white);
}

/* Product review form: labels above full-width fields, same look as the other forms. */
.woocommerce #review_form #respond p {
	margin: 0 0 1rem;
}

.woocommerce #review_form #respond label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--contrast);
}

.woocommerce #review_form #respond input[type="text"],
.woocommerce #review_form #respond input[type="email"],
.woocommerce #review_form #respond input[type="url"],
.woocommerce #review_form #respond textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	padding: 0.7rem 0.9rem;
	font: inherit;
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--white);
}

.woocommerce #review_form #respond input:focus,
.woocommerce #review_form #respond textarea:focus {
	border-color: var(--wp--preset--color--primary-dark);
	outline: 2px solid var(--wp--preset--color--primary-soft);
}

.woocommerce #review_form #respond .comment-form-cookies-consent label {
	display: inline;
	font-weight: 400;
}

/* Product grids: same square frame for every product image, placeholder included. */
.wc-block-product-template .wc-block-components-product-image img,
.woocommerce ul.products li.product img {
	aspect-ratio: 1;
	object-fit: cover;
	width: 100%;
	height: auto;
	background: var(--wp--preset--color--surface);
	border-radius: 10px;
}

.logo-row img {
	max-width: 100%;
}

@media (max-width: 600px) {
	.logo-row .wp-block-image {
		flex: 1 1 40%;
	}
}

/* Post grids (Blog page, archives): same frame for every featured image. */
.wp-block-post-template .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
	width: 100%;
	height: auto;
	border-radius: 10px;
}

.wp-block-post-template .wp-block-post-title {
	margin-top: 0.75rem;
}

/*
 * Click to Chat shows its "Contáctenos" label with jQuery show()/hide()
 * animations that are never stopped, so moving over the button queues them
 * and the label keeps popping in and out. Drive the label from CSS hover
 * instead; !important beats the inline styles the animations write.
 */
.ht-ctc-chat .ht-ctc-cta-hover {
	display: none !important;
}

.ht-ctc-chat:hover .ht-ctc-cta-hover {
	display: block !important;
	width: auto !important;
	height: auto !important;
	opacity: 1 !important;
	padding: 0 16px !important;
	margin: 0 10px !important;
	overflow: visible !important;
	white-space: nowrap;
}

/* Keep the reCAPTCHA badge above the WhatsApp button instead of under it. */
.grecaptcha-badge {
	bottom: 80px !important;
}

/*
 * Old content colours text and links inline with light turquoise and light
 * blue, which is hard to read on white. Use the readable brand teal instead,
 * except inside coloured panels where the light shade was chosen on purpose.
 */
.entry-content :is([style*="#33cccc"], [style*="#33CCCC"], [style*="#24d1c4"], [style*="#73d0f1"], [style*="#17a2b8"]):not(.has-background *):not(.has-background) {
	color: var(--wp--preset--color--primary-dark) !important;
}

/* In-page anchors land below the sticky header. */
.entry-content [id] {
	scroll-margin-top: 110px;
}

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* Policy link that replaces the old grey "Politicas" button in forms. */
.grctotal-policy-link {
	font-size: 0.95rem;
}

/* Post lists (Artículos, archives): cards with image, date, title, summary. */
.post-cards .wp-block-post-template > li {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.post-cards .wp-block-post-title {
	margin: 0;
	line-height: 1.3;
}

.post-cards .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

.post-cards .wp-block-post-title a:hover {
	color: var(--wp--preset--color--primary-dark);
}

.post-cards .wp-block-post-date {
	color: var(--wp--preset--color--muted);
	margin-top: 0.5rem;
}

.post-cards .wp-block-post-excerpt {
	margin: 0;
	font-size: 0.95rem;
}

.post-cards .wp-block-post-template {
	row-gap: var(--wp--preset--spacing--50);
}

/* Cart: quantities update on change (see functions.php), so the button is not needed. */
.woocommerce-cart-form button[name="update_cart"] {
	display: none !important;
}

/*
 * Popup Maker: old popup themes (thick teal "framed border", offset shadows,
 * 32px thin titles, close button outside the box). Give every popup the
 * site's card look.
 */
.pum-overlay.pum-overlay {
	background-color: rgba(20, 28, 34, 0.6) !important;
}

.pum-overlay .pum-container {
	border: 0 !important;
	border-radius: 14px !important;
	box-shadow: 0 24px 60px rgba(20, 28, 34, 0.35) !important;
	background: var(--wp--preset--color--white) !important;
	padding: 2rem 2rem 1.5rem !important;
	max-height: calc(100vh - 4rem);
	overflow-y: auto;
	top: 2rem !important;
}

.pum-overlay .pum-title,
.pum-overlay .pum-content :is(h1, h2, h3, h4, h5, h6, p) {
	text-shadow: none !important;
}

.pum-overlay .pum-title {
	color: var(--wp--preset--color--contrast) !important;
	font-weight: 600 !important;
	font-size: 1.5rem !important;
	line-height: 1.3 !important;
}

.pum-overlay .pum-content {
	color: var(--wp--preset--color--body) !important;
}

.pum-overlay .pum-close {
	top: 0.75rem !important;
	right: 0.75rem !important;
	left: auto !important;
	bottom: auto !important;
	width: 2.25rem !important;
	height: 2.25rem !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--wp--preset--color--surface) !important;
	color: var(--wp--preset--color--contrast) !important;
	box-shadow: none !important;
	font-size: 1.25rem !important;
	line-height: 2.25rem !important;
	text-align: center;
}

@media (max-width: 600px) {
	.pum-overlay .pum-container {
		padding: 1.5rem 1.25rem 1.25rem !important;
		top: 1rem !important;
	}
}
