/*
Theme Name: Kiosko
Theme URI: https://wordpress.com/theme/kiosko/
Author: Automattic
Author URI: https://automattic.com/
Description: Kiosko is a store theme for WooCommerce.
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 5.7
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: 
Text Domain: kiosko
Tags: e-commerce, four-columns, wide-blocks, block-patterns, block-styles, featured-images, full-site-editing, rtl-language-support, sticky-post, template-editing, threaded-comments, translation-ready
*/

/*
 * Control the hover stylings of outline block style.
 * Unnecessary once block styles are configurable via theme.json
 * https://github.com/WordPress/gutenberg/issues/42794
 */
.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background):hover {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--contrast);
}

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-color: var(--wp--preset--color--primary);
	text-decoration-thickness: 0.5px !important;
	text-underline-offset: 0.05em;
}

/* Reset browser default margins for blockquote element */
.wp-block-pullquote blockquote {
	margin: 0;
}

/* Search button inside style */
.wp-block-search__button-inside .wp-block-search__inside-wrapper {
	padding: 4px;
}

/* Adjust font size for comment reply title */
.wp-block-post-comments-form .comment-reply-title {
	font-size: var(--wp--preset--font-size--large);
}

/* Remove the bottom margin from the button */
.wp-block-post-comments-form .form-submit {
	margin-bottom: 0;
}

/*
 * Responsive menu container padding.
 * This ensures the responsive container inherits the same
 * spacing defined above. This behavior may be built into
 * the Block Editor in the future.
 */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50);
}

/* Adjust the top padding for the submenu items */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container {
	padding-top: var(--wp--preset--spacing--30);
}

/* Override the Gutenberg style to theme style */
.wp-block-post-author__byline,
.wp-block-post-author__bio {
	font-size: inherit;
}

/* Round the avatar and reset the vertical alignment */
.wp-block-post-author__avatar img {
	border-radius: 999px;
	line-height: 0;
}

/* Style tag cloud outline style  */
.wp-block-tag-cloud.is-style-outline a {
	border-color: var(--wp--preset--color--tertiary);
	border-radius: 999px;
	padding: 0 0.5rem;
}

.wp-block-tag-cloud.is-style-outline a:hover {
	color: var(--wp--preset--color--base);
	background-color: var(--wp--preset--color--primary);
}

/* Remove the default margin from author bio */
.wp-block-post-author__bio {
	margin: 0;
}

/* Remove the default margin from term description. */
.wp-block-term-description p:first-child {
	margin-top: 0;
}

.wp-block-term-description p:last-child {
	margin-bottom: 0;
}

/* Normalise font sizes for the latest comments and latest posts widgets */
.wp-block-latest-comments__comment-excerpt p,
.wp-block-latest-comments__comment-date,
.wp-block-latest-posts__post-author,
.wp-block-latest-posts__post-date {
	font-size: inherit;
}

/* Adjust font colour in the Calendar widget */
.wp-block-calendar table:where(:not(.has-text-color)) {
	color: var(--wp--preset--color--foreground);
}

/* Fix border radius setting for the avatar block */
.wp-block-avatar a,
.wp-block-avatar img {
	border-radius: inherit;
	vertical-align: middle;
}

/* Fix line height for various fields */
.wp-block-search__input,
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]),
.wp-block-post-comments-form .comment-form textarea {
	line-height: inherit;
}

/* Style  border colour for search and Jetpack subscription blocks */
.wp-block-search__input,
.wp-block-search__button-inside .wp-block-search__inside-wrapper,
.wp-block-jetpack-subscriptions.wp-block-jetpack-subscriptions__supports-newline form input[type="email"] {
	border-color: var(--wp--preset--color--tertiary);
}

/* Needed to style input field for various Jetpack blocks */
.wp-block-jetpack-contact-form input:not([type="submit"]):not([type="checkbox"]),
.wp-block-jetpack-contact-form select,
.wp-block-jetpack-contact-form textarea,
.wp-block-jetpack-mailchimp input:not([type="submit"]):not([type="checkbox"]),
.wp-block-jetpack-revue input:not([type="submit"]):not([type="checkbox"]) {
	background-color: #fff;
	border: 1px solid var(--wp--preset--color--tertiary);
	font-size: inherit;
	line-height: inherit;
	padding: 0.5rem;
}

.wp-block-jetpack-contact-form.contact-form label {
	font-weight: 400;
}

.wp-block-jetpack-contact-form.contact-form label span {
	opacity: 0.7;
}

.wp-block-jetpack-contact-form.contact-form select {
	padding: 0.5rem;
}

.wp-block-jetpack-contact-form.contact-form textarea {
	margin-bottom: var(--wp--preset--spacing--40);
}

/* Style the feedback you get after submitting the contact form */
div[id^="contact-form-"] h4 {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: inherit;
	line-height: 1.555555556;
}

div[id^="contact-form-"] .contact-form-submission {
	margin: 0;
	padding: 0;
}

/* Adjust vertical margins in the mailchimp block */
.wp-block-jetpack-mailchimp .wp-block-jetpack-button,
.wp-block-jetpack-mailchimp p {
	margin: var(--wp--preset--spacing--40) 0;
}

/* Adjust the size of the consent text in mailchimp block */
#wp-block-jetpack-mailchimp_consent-text {
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: 0;
}

/* Remove underline from the price after discounted */
ins {
	text-decoration: none;
}

/* Fix the hardcoded wide width value in the stylesheet for TT3 */
.woocommerce.woocommerce-page main {
	max-width: calc(var(--wp--style--global--wide-size) + var(--wp--style--root--padding-right) + var(--wp--style--root--padding-left));
}

/* Header categories flyout next to product search */
.kiosko-header-search-categorias {
	min-width: 260px;
	width: 100%;
}

.kiosko-header-search-categorias > .wp-block-group {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-width: 0;
}

.kiosko-header-search-categorias .wp-block-search {
	flex: 1 1 auto;
	margin: 0;
}

.kiosko-header-search-categorias .wp-block-shortcode {
	flex: 0 0 auto;
	margin: 0;
}

.kiosko-header-search-categorias .kiosko-categorias-flyout {
	flex: 0 0 auto;
}

.kiosko-categorias-flyout {
	position: relative;
	margin: 0;
}

.kiosko-categorias-trigger {
	list-style: none !important;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	min-width: 170px;
	padding: 11px 18px;
	border: 1px solid #d4d8de;
	border-radius: 10px;
	background: #fff;
	color: #4a5568;
	font-size: 1.04rem;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
}

.kiosko-categorias-trigger::after {
	content: "";
	width: 9px;
	height: 9px;
	margin-top: -2px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease, margin-top 0.2s ease;
}

.kiosko-categorias-flyout[open] .kiosko-categorias-trigger {
	color: #394659;
	background: #f7f8fa;
}

.kiosko-categorias-flyout[open] .kiosko-categorias-trigger::after {
	transform: rotate(-135deg);
	margin-top: 4px;
}

.kiosko-categorias-trigger::-webkit-details-marker {
	display: none;
}

.kiosko-categorias-panel {
	position: absolute;
	top: calc(100% + 14px);
	right: 0;
	width: clamp(260px, 30vw, 500px);
	max-height: min(62vh, 460px);
	overflow: auto;
	background: #fff;
	border: 1px solid #e1e4ea;
	border-radius: 10px;
	box-shadow: 0 14px 34px rgba(19, 30, 54, 0.14);
	z-index: 30;
}

.kiosko-categorias-panel::before {
	content: "";
	position: absolute;
	top: -7px;
	right: 28px;
	width: 14px;
	height: 14px;
	background: #fff;
	border-left: 1px solid #e1e4ea;
	border-top: 1px solid #e1e4ea;
	transform: rotate(45deg);
}

.kiosko-categorias-list {
	list-style: none !important;
	margin: 0 !important;
	padding: 10px 0;
}

.kiosko-categorias-list ul {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.kiosko-categorias-list li {
	margin: 0;
	padding: 0;
}

.kiosko-categorias-list a {
	display: block;
	padding: 13px 18px;
	border-radius: 0;
	text-decoration: none;
	color: #4a5568;
	font-size: 1.02rem;
	line-height: 1.25;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.kiosko-categorias-list a:hover {
	background: #f1f4f8;
	color: #2f4f76;
}

.kiosko-categorias-list .children {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border-left: 0;
}

.kiosko-categorias-list .children a {
	padding-left: 34px;
	font-size: 0.96rem;
	color: #5f6877;
}

/* Move home category navigation to top dropdown: hide old sidebar list */
.home main > .wp-block-columns.alignwide > .wp-block-column:first-child {
	display: none;
}

.home main > .wp-block-columns.alignwide > .wp-block-column:last-child {
	flex-basis: 100% !important;
}

/* Header layout: search + horizontal nav links under search */
.kiosko-header-rightstack {
	width: min(820px, 100%);
}

.kiosko-header-rightstack .kiosko-header-search-categorias {
	width: 100%;
	min-width: 0;
}

.kiosko-header-rightstack .wp-block-navigation {
	width: 100%;
}

.kiosko-header-rightstack .wp-block-navigation__container {
	flex-wrap: nowrap !important;
}

/* Keep "Mi Cuenta" and similar header nav labels on one line */
.wp-site-blocks > header.wp-block-template-part .wp-block-navigation {
	flex-shrink: 0;
}

.wp-site-blocks > header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__content,
.wp-site-blocks > header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__label {
	white-space: nowrap;
	word-break: normal;
	overflow-wrap: normal;
}

@media (max-width: 1024px) {
	.kiosko-header-rightstack .wp-block-navigation__container {
		flex-wrap: wrap !important;
	}

	.kiosko-categorias-trigger {
		min-width: 156px;
		padding: 10px 14px;
	}

	.kiosko-categorias-panel {
		width: min(430px, 82vw);
	}
}

@media (max-width: 782px) {
	.wp-site-blocks > header .wp-block-group.alignwide.is-content-justification-space-between.is-nowrap.is-layout-flex {
		flex-wrap: wrap !important;
		row-gap: 15px;
		align-items: center;
		justify-content: center !important;
	}

	.wp-site-blocks > header .wp-block-group.alignwide.is-content-justification-left.is-layout-flex {
		flex: 1 1 100%;
		min-width: 0;
		justify-content: center !important;
	}

	.wp-site-blocks > header .wp-block-group.alignwide.is-content-justification-left.is-layout-flex .wp-block-image {
		margin: 0 auto;
	}

	.wp-site-blocks > header .wp-block-group.alignwide.is-content-justification-left.is-layout-flex .wp-block-image img {
		max-width: min(70vw, 240px);
		height: auto;
		display: block;
		margin: 0 auto;
	}

	.wp-site-blocks > header.wp-block-template-part .wp-block-woocommerce-customer-account,
	.wp-site-blocks > header.wp-block-template-part .wp-block-navigation {
		flex: 0 0 auto;
	}

	.kiosko-header-rightstack {
		flex: 1 1 100%;
		width: 100%;
	}

	.kiosko-header-search-categorias > .wp-block-group {
		flex-wrap: wrap;
		gap: 10px;
		align-items: center;
	}

	.kiosko-header-search-categorias .wp-block-search {
		order: 1;
		flex: 1 1 100%;
		min-width: 0;
	}

	.kiosko-header-search-categorias .wp-block-shortcode {
		order: 2;
		flex: 0 0 auto;
		min-width: 0;
	}

	.kiosko-header-search-categorias .kiosko-categorias-flyout {
		order: 2;
		flex: 0 0 auto;
		width: auto;
	}

	.kiosko-header-search-categorias .wp-block-woocommerce-mini-cart {
		order: 3;
		flex: 0 0 auto;
		margin-left: auto;
	}

	.kiosko-categorias-flyout {
		display: inline-block;
		width: auto;
		margin-right: 0;
	}

	.kiosko-categorias-trigger {
		min-width: 136px;
		width: auto;
		padding: 9px 12px;
		font-size: 0.95rem;
		justify-content: flex-start;
	}

	.kiosko-categorias-panel::before {
		left: 20px;
		right: auto;
	}

	.kiosko-categorias-panel {
		left: 0;
		right: auto;
		width: min(92vw, 360px);
		max-height: 62vh;
	}

	/* Tighten intro text band spacing on mobile */
	.home main > .wp-block-group.alignwide.has-primary-color.has-text-color.has-link-color {
		padding-top: 22px !important;
		padding-bottom: 22px !important;
	}

	.home main > .wp-block-group.alignwide.has-primary-color.has-text-color.has-link-color > .wp-block-group.alignwide {
		margin-top: 0 !important;
	}

	.home main > .wp-block-group.alignwide.has-primary-color.has-text-color.has-link-color p {
		margin-top: 0;
		margin-bottom: 14px;
	}

	.home main > .wp-block-group.alignwide.has-primary-color.has-text-color.has-link-color p:last-child {
		margin-bottom: 0;
	}
}

@media (min-width: 783px) {
	/* Match tightened intro text band spacing on desktop */
	.home main > .wp-block-group.alignwide.has-primary-color.has-text-color.has-link-color {
		padding-top: 22px !important;
		padding-bottom: 22px !important;
	}

	.home main > .wp-block-group.alignwide.has-primary-color.has-text-color.has-link-color > .wp-block-group.alignwide {
		margin-top: 0 !important;
	}

	.home main > .wp-block-group.alignwide.has-primary-color.has-text-color.has-link-color p {
		margin-top: 0;
		margin-bottom: 14px;
	}

	.home main > .wp-block-group.alignwide.has-primary-color.has-text-color.has-link-color p:last-child {
		margin-bottom: 0;
	}
}

/* Mobile header ordering for current block markup (iPhone + Android, portrait + landscape) */
@media (max-width: 920px), (max-width: 1024px) and (orientation: landscape) {
	.wp-site-blocks > header.wp-block-template-part .wp-block-group.alignwide.is-nowrap.is-layout-flex {
		flex-wrap: wrap !important;
		align-items: flex-start;
		row-gap: 12px;
		column-gap: 10px;
	}

	/* Row 1: logo */
	.wp-site-blocks > header.wp-block-template-part .wp-block-group.alignwide.is-content-justification-left.is-layout-flex {
		order: 1;
		flex: 1 1 100%;
		min-width: 0;
		justify-content: flex-start !important;
	}

	.wp-site-blocks > header.wp-block-template-part .wp-block-group.alignwide.is-content-justification-left.is-layout-flex .wp-block-image {
		display: block;
		margin: 0;
	}

	.wp-site-blocks > header.wp-block-template-part .wp-block-group.alignwide.is-content-justification-left.is-layout-flex .wp-block-image img {
		display: block;
		width: auto;
		height: auto;
		max-width: min(72vw, 260px);
		object-fit: contain !important;
	}

	/* Row 2: search + categories */
	.wp-site-blocks > header.wp-block-template-part .kiosko-header-rightstack {
		order: 2;
		flex: 1 1 100%;
		width: 100%;
	}

	.wp-site-blocks > header.wp-block-template-part .kiosko-header-search-categorias > .wp-block-group {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 10px;
	}

	.wp-site-blocks > header.wp-block-template-part .kiosko-header-search-categorias .wp-block-search {
		order: 1;
		flex: 1 1 100%;
		min-width: 0;
		margin: 0;
		justify-content: center !important;
	}

	.wp-site-blocks > header.wp-block-template-part .kiosko-header-search-categorias .wp-block-search .wp-block-search__inside-wrapper {
		margin: 0 auto;
		max-width: 100%;
	}

	.wp-site-blocks > header.wp-block-template-part .kiosko-header-search-categorias .wp-block-shortcode,
	.wp-site-blocks > header.wp-block-template-part .kiosko-header-search-categorias .kiosko-categorias-flyout {
		order: 2;
		flex: 0 0 auto;
	}

	/* Row 3: links below search */
	.wp-site-blocks > header.wp-block-template-part nav.wp-block-navigation {
		order: 3;
		flex: 1 1 100%;
		width: 100%;
		margin-top: 2px;
	}

	.wp-site-blocks > header.wp-block-template-part nav.wp-block-navigation .wp-block-navigation__responsive-container-open,
	.wp-site-blocks > header.wp-block-template-part nav.wp-block-navigation .wp-block-navigation__responsive-container-close {
		display: none !important;
	}

	.wp-site-blocks > header.wp-block-template-part nav.wp-block-navigation .wp-block-navigation__responsive-container {
		display: block !important;
		position: static !important;
		inset: auto !important;
		width: 100% !important;
		height: auto !important;
		max-width: none !important;
		background: transparent !important;
		transform: none !important;
	}

	.wp-site-blocks > header.wp-block-template-part nav.wp-block-navigation .wp-block-navigation__responsive-close,
	.wp-site-blocks > header.wp-block-template-part nav.wp-block-navigation .wp-block-navigation__responsive-dialog,
	.wp-site-blocks > header.wp-block-template-part nav.wp-block-navigation .wp-block-navigation__responsive-container-content {
		display: block !important;
		position: static !important;
		width: 100% !important;
		height: auto !important;
		padding: 0 !important;
	}

	.wp-site-blocks > header.wp-block-template-part nav.wp-block-navigation .wp-block-navigation__container {
		display: flex !important;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 12px;
		justify-content: center !important;
	}

	.wp-site-blocks > header.wp-block-template-part .wp-block-woocommerce-customer-account {
		order: 4;
		flex: 0 0 auto;
		margin-left: 0;
	}

	.wp-site-blocks > header.wp-block-template-part .kiosko-categorias-panel {
		left: 0;
		right: auto;
		width: min(92vw, 360px);
		max-height: 62vh;
	}

	.wp-site-blocks > header.wp-block-template-part .kiosko-categorias-panel::before {
		left: 20px;
		right: auto;
	}
}
