/* ========================================================================
   R27 Luxury — Mobile Commerce UI v4
   Professional compact e-commerce header built on Luchiana's native header.
   - No JS injection.
   - Search row exists only on WooCommerce/product contexts.
   - Native Luchiana menu/cart/filter behavior remains the source of truth.
   ======================================================================== */

.r27-mobile-search-row,
.r27-mobile-header-actions,
.r27-mobile-header-cart {
	display: none;
}

@media (max-width: 767px) {
	:root {
		--r27-mobile-commerce-row-height: 60px;
		--r27-mobile-navy: #212d47;
		--r27-mobile-gold: #98701f;
		--r27-mobile-line: #d9dde5;
		--r27-mobile-muted: #8b93a3;
		--r27-mobile-header-bg: #ffffff;
	}

	/* Commerce header uses the same clean visual language in normal and sticky
	   states: white surface, navy controls and the sticky/mobile logo asset. */
	.r27-mobile-header-ui--commerce-tools > .c-header__row,
	.r27-mobile-header-ui--commerce-tools.c-header--sticky > .c-header__row {
		background: var(--r27-mobile-header-bg) !important;
		color: var(--r27-mobile-navy) !important;
		box-shadow: none !important;
	}

	.r27-mobile-header-ui--commerce-tools .r27-mobile-header-cart,
	.r27-mobile-header-ui--commerce-tools .c-header__menu-button,
	.r27-mobile-header-ui--commerce-tools .c-header__menu-button-icon {
		color: var(--r27-mobile-navy) !important;
	}

	/* --------------------------------------------------------------------
	   Native top row: logo | cart | menu.
	   We only replace the action grouping for mobile header type 1.
	   -------------------------------------------------------------------- */
	.r27-mobile-header-actions {
		display: flex !important;
		align-items: center;
		justify-content: flex-end;
		align-self: stretch;
		flex: 0 0 auto;
		margin-left: auto;
		gap: 2px;
	}

	.r27-mobile-header-actions .c-header__menu-button {
		flex: 0 0 50px !important;
		width: 50px !important;
		min-width: 50px !important;
		height: 100% !important;
		padding: 0 !important;
	}

	.r27-mobile-header-actions .c-header__menu-button-icon {
		font-size: 19px !important;
		line-height: 1 !important;
	}

	.r27-mobile-header-cart {
		position: relative;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		flex: 0 0 42px;
		width: 42px;
		height: 100%;
		padding: 0;
		color: inherit;
		text-decoration: none;
	}

	.r27-mobile-header-cart:hover,
	.r27-mobile-header-cart:focus {
		color: inherit;
		text-decoration: none;
	}

	.r27-mobile-header-cart .c-header__cart-icon {
		display: block;
		font-size: 21px;
		line-height: 1;
	}

	.r27-mobile-header-cart .js-cart-info {
		position: absolute;
		inset: 0;
		pointer-events: none;
	}

	.r27-mobile-header-cart .c-header__cart-sum {
		display: none !important;
	}

	.r27-mobile-header-cart .c-header__cart-count {
		position: absolute !important;
		top: calc(50% - 23px) !important;
		right: 1px !important;
		display: flex !important;
		align-items: center;
		justify-content: center;
		min-width: 16px !important;
		height: 16px !important;
		padding: 0 4px !important;
		border: 2px solid #fff !important;
		border-radius: 999px !important;
		background: var(--r27-mobile-gold) !important;
		color: #fff !important;
		font-size: 9px !important;
		font-weight: 700 !important;
		line-height: 12px !important;
		letter-spacing: 0 !important;
		box-sizing: border-box !important;
	}

	/* --------------------------------------------------------------------
	   Commerce-only second row.
	   It is rendered inside .js-header-mobile, therefore Luchiana's native
	   sticky state carries both rows without custom scroll JavaScript.
	   -------------------------------------------------------------------- */
	.r27-mobile-header-outer--commerce-tools {
		height: calc(var(--header-height-mobile) + var(--r27-mobile-commerce-row-height)) !important;
		min-height: calc(var(--header-height-mobile) + var(--r27-mobile-commerce-row-height)) !important;
	}

	.r27-mobile-header-ui--commerce-tools {
		height: calc(var(--header-height-mobile) + var(--r27-mobile-commerce-row-height)) !important;
		overflow: visible !important;
	}

	.r27-mobile-header-ui--commerce-tools > .c-header__row {
		height: var(--header-height-mobile) !important;
		min-height: var(--header-height-mobile) !important;
	}

	.r27-mobile-header-ui--commerce-tools.c-header--sticky {
		height: calc(var(--sticky-header-height-mobile) + var(--r27-mobile-commerce-row-height)) !important;
	}

	.r27-mobile-header-ui--commerce-tools.c-header--sticky > .c-header__row {
		height: var(--sticky-header-height-mobile) !important;
		min-height: var(--sticky-header-height-mobile) !important;
	}

	.r27-mobile-search-row {
		display: flex !important;
		align-items: center;
		gap: 10px;
		height: var(--r27-mobile-commerce-row-height);
		padding: 8px 18px;
		box-sizing: border-box;
		background: #fff;
		color: var(--r27-mobile-navy);
		border-top: 1px solid rgba(33, 45, 71, .07);
		border-bottom: 1px solid rgba(33, 45, 71, .11);
		box-shadow: 0 3px 10px rgba(20, 31, 53, .035);
	}

	.r27-mobile-search-trigger {
		display: flex !important;
		align-items: center;
		justify-content: space-between;
		flex: 1 1 auto;
		min-width: 0;
		height: 44px;
		margin: 0;
		padding: 0 !important;
		background: #fff !important;
		border: 1px solid var(--r27-mobile-line) !important;
		border-radius: 2px;
		box-sizing: border-box;
		box-shadow: none !important;
		color: var(--r27-mobile-navy) !important;
		text-align: left;
		cursor: text;
		-webkit-tap-highlight-color: transparent;
		transition: border-color .15s ease, box-shadow .15s ease;
	}

	.r27-mobile-search-trigger:focus,
	.r27-mobile-search-trigger:active {
		outline: 0 !important;
		border-color: #aeb7c6 !important;
		box-shadow: 0 0 0 2px rgba(33, 45, 71, .04) !important;
	}

	.r27-mobile-search-trigger__placeholder {
		display: block;
		flex: 1 1 auto;
		min-width: 0;
		padding: 0 14px;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		color: var(--r27-mobile-muted);
		font-size: 13px;
		font-weight: 400;
		line-height: 42px;
		letter-spacing: .01em;
	}

	.r27-mobile-search-trigger__icon {
		display: grid;
		place-items: center;
		align-self: stretch;
		flex: 0 0 44px;
		width: 44px;
		height: 42px;
		border-left: 1px solid #e4e7ec;
		color: var(--r27-mobile-navy);
		font-size: 18px;
		line-height: 0;
	}

	.r27-mobile-search-trigger__icon i {
		display: grid !important;
		place-items: center !important;
		width: 100%;
		height: 100%;
		margin: 0 !important;
		padding: 0 !important;
		font-size: 18px !important;
		line-height: 0 !important;
	}

	.r27-mobile-search-trigger__icon i::before {
		display: block !important;
		margin: 0 !important;
		line-height: 1 !important;
	}

	/* Professional sliders/filter button. The SVG is visual only; the
	   js-filter-show-button class still invokes Luchiana's native drawer. */
	.r27-mobile-filter-button {
		position: relative;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 1px solid var(--r27-mobile-line) !important;
		border-radius: 2px;
		background: #fff !important;
		color: var(--r27-mobile-navy) !important;
		box-shadow: none !important;
		transition: border-color .15s ease, background-color .15s ease;
	}

	.r27-mobile-filter-button:hover,
	.r27-mobile-filter-button:focus {
		border-color: #aeb7c6 !important;
		background: #fafbfc !important;
		outline: none;
	}

	.r27-mobile-filter-icon {
		display: block;
		width: 21px;
		height: 21px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.7;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.r27-mobile-filter-count {
		position: absolute;
		top: -6px;
		right: -6px;
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 17px;
		height: 17px;
		padding: 0 4px;
		border: 2px solid #fff;
		border-radius: 999px;
		background: var(--r27-mobile-gold);
		color: #fff;
		font-size: 9px;
		font-weight: 700;
		line-height: 13px;
		box-sizing: border-box;
	}

	/* The compact header button replaces only the duplicate visual filter
	   control. Luchiana's filter drawer, state and AJAX remain untouched. */
	body.r27-mobile-filter-tools .c-catalog-ordering__filter-show-button--mobile {
		display: none !important;
	}

	/* --------------------------------------------------------------------
	   Shop/category "Bloque HTML (superior)".
	   Keep it available on desktop, but remove it from the mobile visual flow.
	   CSS-only is intentional so LiteSpeed can keep one shared cached document
	   for desktop/mobile instead of varying page HTML by user agent.
	   -------------------------------------------------------------------- */
	.c-category-html.c-category-html--top {
		display: none !important;
	}

	/* --------------------------------------------------------------------
	   Logged-out My Account forms — visual cleanup only. Search row is never
	   rendered on account pages.
	   -------------------------------------------------------------------- */
	.woocommerce-account:not(.logged-in) .l-section--container {
		padding-left: 18px !important;
		padding-right: 18px !important;
	}

	.woocommerce-account:not(.logged-in) .c-login,
	.woocommerce-account .woocommerce-ResetPassword {
		box-sizing: border-box !important;
		width: 100% !important;
		max-width: 430px !important;
		margin: 30px auto 44px !important;
		padding: 0 !important;
		overflow: hidden !important;
		background: #fff !important;
	}

	.woocommerce-account:not(.logged-in) .c-login__header {
		box-sizing: border-box !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 18px 18px 20px !important;
		font-size: 22px !important;
		line-height: 1.2 !important;
		letter-spacing: .18em !important;
		white-space: normal !important;
		text-align: center !important;
	}

	.woocommerce-account:not(.logged-in) .c-login form {
		box-sizing: border-box !important;
		width: 100% !important;
		padding: 0 18px 20px !important;
	}

	.woocommerce-account:not(.logged-in) .c-login .c-form__row,
	.woocommerce-account:not(.logged-in) .c-login .woocommerce-form-row,
	.woocommerce-account .woocommerce-ResetPassword .form-row {
		box-sizing: border-box !important;
		width: 100% !important;
		max-width: 100% !important;
		margin-right: 0 !important;
		margin-left: 0 !important;
	}

	.woocommerce-account:not(.logged-in) .c-login input:not([type="checkbox"]):not([type="radio"]),
	.woocommerce-account .woocommerce-ResetPassword input[type="text"],
	.woocommerce-account .woocommerce-ResetPassword input[type="password"] {
		box-sizing: border-box !important;
		width: 100% !important;
		max-width: 100% !important;
		height: 50px !important;
		min-height: 50px !important;
		padding: 0 14px !important;
		font-size: 13px !important;
	}

	.woocommerce-account:not(.logged-in) .c-login__remember {
		margin-top: 18px !important;
	}

	.woocommerce-account:not(.logged-in) .c-login .woocommerce-button,
	.woocommerce-account:not(.logged-in) .c-login .woocommerce-Button,
	.woocommerce-account:not(.logged-in) .c-login .button,
	.woocommerce-account .woocommerce-ResetPassword .button {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		box-sizing: border-box !important;
		width: 100% !important;
		max-width: 100% !important;
		min-height: 50px !important;
		margin-right: 0 !important;
		margin-left: 0 !important;
		padding: 11px 14px !important;
		font-size: 10px !important;
		font-weight: 600 !important;
		letter-spacing: .18em !important;
		text-align: center !important;
		text-transform: uppercase !important;
	}

	.woocommerce-account:not(.logged-in) .c-login__bottom {
		display: flex !important;
		align-items: center !important;
		justify-content: space-between !important;
		gap: 12px !important;
		width: 100% !important;
		margin-top: 26px !important;
		padding: 0 !important;
		box-sizing: border-box !important;
	}

	.woocommerce-account:not(.logged-in) .c-login__lost-password,
	.woocommerce-account:not(.logged-in) .c-login__register {
		min-width: 0 !important;
		margin: 0 !important;
		font-size: 12px !important;
		line-height: 1.4 !important;
	}

	.woocommerce-account:not(.logged-in) .c-login__lost-password-link,
	.woocommerce-account:not(.logged-in) .c-login__register {
		overflow-wrap: anywhere !important;
	}

	.woocommerce-account:not(.logged-in) .c-login p,
	.woocommerce-account .woocommerce-ResetPassword p {
		box-sizing: border-box !important;
		max-width: 100% !important;
		font-size: 13px !important;
		line-height: 1.65 !important;
		overflow-wrap: anywhere !important;
	}

	.woocommerce-account:not(.logged-in) .c-login .woocommerce-privacy-policy-text {
		margin: 14px 0 18px !important;
		color: #737b8a !important;
	}

	.woocommerce-account .woocommerce-ResetPassword {
		padding: 22px 18px 24px !important;
	}

	.woocommerce-account .woocommerce-ResetPassword > p:first-child {
		margin: 0 0 18px !important;
		padding: 0 !important;
		color: #697181 !important;
	}
}
