/* Header: utility bar, main row, account/cart actions and the mini-cart drawer. */

/*
 * WordPress's flex layout sets its gap with :root :where(.is-layout-flex), which ties with a single class,
 * so every layout group below is targeted as .wp-block-group.anarta-* (one class more).
 */

/* ---------- Utility bar (scrolls away) ---------- */
.anarta-util, .anarta-nav-wrap { padding-inline: var(--wp--custom--gutter); }
.anarta-util { font-size: var(--wp--preset--font-size--label); font-weight: 300; line-height: 1; color: var(--wp--preset--color--muted); }
.anarta-util__in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--wp--preset--spacing--30); max-width: var(--anarta-content); min-height: 40px; margin-inline: auto; }
.wp-block-group.anarta-util__in > * { margin-block: 0; } /* the flow layout's block gap must not shift grid siblings */
.wp-block-group.anarta-util__prefs { gap: 24px; justify-self: start; align-items: center; }
:lang(ja) .wp-block-group.anarta-util__msg { gap: 0; }
.wp-block-group.anarta-util__msg { gap: .3em; align-items: baseline; letter-spacing: .06em; white-space: nowrap; }
.anarta-util__msg p { margin: 0; }
.anarta-util__links { display: flex; gap: var(--wp--preset--spacing--40); justify-content: flex-end; margin: 0; padding: 0; list-style: none; }
.anarta-util a:hover { color: var(--wp--preset--color--ink); }

/* ---------- Header: sticky on the template-part wrapper; the utility bar scrolls away above the nav row ---------- */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: calc(var(--anarta-util-h, 40px) * -1); z-index: 50; background: var(--wp--preset--color--surface); }
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: calc(var(--wp-admin--admin-bar--height, 32px) - var(--anarta-util-h, 40px)); }

.wp-block-group.anarta-nav { gap: 48px; align-items: center; max-width: var(--anarta-content); height: 88px; margin-inline: auto; }
.wp-block-group.anarta-brand { gap: 14px; align-items: center; flex: 0 0 auto; }
.anarta-brand figure { margin: 0; }
.anarta-brand img { display: block; width: auto; }
.anarta-brand__mark img { height: 40px; }
.anarta-brand__word img { height: 15px; }
.wp-block-group.anarta-actions { gap: 32px; align-items: center; flex: 0 0 auto; }

/* Account + cart: thin outline icons with labels, like the design. */
.anarta-actions .wp-block-woocommerce-customer-account { margin: 0; }
.anarta-actions .wc-block-customer-account__link,
.anarta-actions .wc-block-mini-cart__button { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0; background: none; border: 0; font: inherit; font-size: var(--wp--preset--font-size--small); letter-spacing: .04em; color: var(--wp--preset--color--ink); text-decoration: none; cursor: pointer; transition: opacity .2s var(--wp--custom--ease); }
.anarta-actions .wc-block-customer-account__link:hover,
.anarta-actions .wc-block-mini-cart__button:hover { opacity: .6; }
.anarta-actions .wc-block-customer-account__visual svg,
.anarta-actions .wc-block-mini-cart__icon { display: none; }
.anarta-actions .wc-block-customer-account__visual { width: 20px; height: 20px; margin-right: 6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1f18' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20c0-3.6 3.1-6 7-6s7 2.4 7 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.anarta-actions .wc-block-customer-account__link .label { font-size: 0; }
.anarta-actions .wc-block-customer-account__link .label::after { font-size: var(--wp--preset--font-size--small); }
:lang(ja) .anarta-actions .wc-block-customer-account__link .label::after { content: "アカウント"; }
:lang(en) .anarta-actions .wc-block-customer-account__link .label::after { content: "Account"; }
.anarta-actions .wc-block-mini-cart__quantity-badge { position: relative; display: inline-flex; width: 20px; height: 20px; margin-right: 6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1f18' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h14l-1 12H6L5 8z'/%3E%3Cpath d='M9 8V7a3 3 0 0 1 6 0v1'/%3E%3C/svg%3E") center / contain no-repeat; }
.anarta-actions .wc-block-mini-cart__button::after { font-size: var(--wp--preset--font-size--small); }
:lang(ja) .anarta-actions .wc-block-mini-cart__button::after { content: "カート"; }
:lang(en) .anarta-actions .wc-block-mini-cart__button::after { content: "Cart"; }
.anarta-actions .wc-block-mini-cart__badge { position: absolute; top: -9px; right: -11px; display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin: 0; padding: 0 5px; border-radius: 9px; /* Woo sets the badge colours inline from the block's colour settings */ background: var(--wp--preset--color--cta) !important; color: #fff !important; font-size: 10px; font-weight: 500; letter-spacing: 0; line-height: 1; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--wp--preset--color--surface); }
.anarta-actions .wc-block-mini-cart__badge[hidden] { display: none; }

@media (max-width: 1199px) {
	.wp-block-group.anarta-nav { gap: 32px; }
}

/* ---------- Small screens: [menu] logo [account, cart] / search ---------- */
@media (max-width: 899px) {
	.anarta-util__in { grid-template-columns: auto 1fr; }
	.anarta-util__links { display: none; }
	.wp-block-group.anarta-util__msg { justify-content: flex-end; overflow: hidden; }

	.wp-block-group.anarta-nav { display: grid; grid-template-columns: 44px 1fr auto; gap: 0 8px; height: auto; padding-block: var(--wp--preset--spacing--10) var(--wp--preset--spacing--20); }
	.anarta-nav > .anarta-mega-wrap { grid-column: 1; grid-row: 1; align-self: center; }
	.anarta-nav > .anarta-brand { grid-column: 2; grid-row: 1; justify-self: center; }
	.wp-block-group.anarta-actions { grid-column: 3; grid-row: 1; gap: 8px; margin-right: -8px; }
	.anarta-nav > .anarta-search { grid-column: 1 / -1; grid-row: 2; max-width: none; margin: var(--wp--preset--spacing--10) 0 0; }
	.anarta-actions .wc-block-customer-account__link .label,
	.anarta-actions .wc-block-mini-cart__button::after { display: none; }
	.anarta-actions .wc-block-customer-account__link, .anarta-actions .wc-block-mini-cart__button { justify-content: center; min-width: 40px; }
	.anarta-actions .wc-block-customer-account__visual, .anarta-actions .wc-block-mini-cart__quantity-badge { margin-right: 0; }
}
@media (max-width: 781px) { :root { --anarta-util-h: 40px; } }
@media (max-width: 599px) {
	.anarta-util__msg { font-size: 11px; }
	.anarta-brand__mark img { height: 34px; }
	.anarta-brand__word img { height: 13px; }
}

/* ---------- Mini-cart drawer (WooCommerce block) in the design's slide-out style ---------- */
.wc-block-components-drawer__screen-overlay { background: rgba(13, 31, 24, .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.wc-block-components-drawer { width: min(440px, 100vw); max-width: 100vw; background: var(--wp--preset--color--surface); box-shadow: -16px 0 48px rgba(13, 31, 24, .14); font-family: var(--wp--preset--font-family--base); color: var(--wp--preset--color--body); }
.wc-block-components-drawer .wc-block-components-drawer__content { padding: 0; }
.wc-block-mini-cart__template-part, .wp-block-woocommerce-mini-cart-contents { display: flex; flex-direction: column; height: 100%; }
.wp-block-woocommerce-filled-mini-cart-contents-block { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.wc-block-components-drawer__close-wrapper { top: 14px; right: 16px; }
.wc-block-components-drawer__close-wrapper .wc-block-components-drawer__close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--wp--preset--color--muted); box-shadow: none; }
.wc-block-components-drawer__close-wrapper .wc-block-components-drawer__close:hover { background: var(--wp--preset--color--tone-sand); color: var(--wp--preset--color--ink); }
.wc-block-components-drawer .wc-block-mini-cart__title.wp-block-woocommerce-mini-cart-title-block { box-sizing: border-box; width: 100%; margin: 0; padding: 20px 64px 20px 24px; border-bottom: 1px solid var(--wp--preset--color--border); font-size: 18px; font-weight: 400; line-height: 1.4; letter-spacing: 0; color: var(--wp--preset--color--ink); }
.wc-block-components-drawer .wp-block-woocommerce-mini-cart-title-block { display: flex; align-items: baseline; }
.wc-block-components-drawer .wp-block-woocommerce-mini-cart-title-items-counter-block { margin: 0 0 0 .25em; }
:lang(ja) .wc-block-components-drawer .wp-block-woocommerce-mini-cart-title-items-counter-block { margin-left: 0; }
.wc-block-mini-cart__items { flex: 1 1 auto; min-height: 0; padding: 8px 24px; overflow-y: auto; overscroll-behavior: contain; }

/* Line items: thumbnail, details, line total; quantity pill and a text "Remove" link */
.wc-block-mini-cart__items table.wc-block-cart-items { width: 100%; margin: 0; border: 0; border-collapse: collapse; }
.wc-block-mini-cart__items .wc-block-cart-items__row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--wp--preset--color--border); }
.wc-block-mini-cart__items .wc-block-cart-items__row:last-child { border-bottom: 0; }
.wc-block-mini-cart__items .wc-block-cart-items__row > td { display: block; padding: 0; border: 0; }
.wc-block-mini-cart__items .wc-block-cart-item__image { width: 64px; }
.wc-block-mini-cart__items .wc-block-cart-item__image a { display: block; width: 64px; height: 72px; overflow: hidden; border-radius: 4px; background: var(--wp--preset--color--tone-sand); }
.wc-block-mini-cart__items .wc-block-cart-item__image img:not([hidden]) { display: block; width: 100%; max-width: none; height: 100%; object-fit: cover; }
.wc-block-mini-cart__items .wc-block-cart-item__wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.wc-block-mini-cart__items .wc-block-components-product-name { font-size: 14px; line-height: 1.35; }
.wc-block-mini-cart__items a.wc-block-components-product-name:hover { color: var(--wp--preset--color--accent); }
.wc-block-mini-cart__items .wc-block-components-product-metadata__description { display: none; }
.wc-block-mini-cart__items .wc-block-components-product-details { margin: 0; padding: 0; font-size: 12px; color: var(--wp--preset--color--muted); }
.wc-block-mini-cart__items .wc-block-cart-item__prices { margin-top: 2px; }
.wc-block-mini-cart__items .wc-block-cart-item__prices .price, .wc-block-mini-cart__items .wc-block-cart-item__prices .price * { font-size: 13px; font-weight: 400; color: var(--wp--preset--color--muted); }
.wc-block-mini-cart__items .wc-block-cart-item__quantity { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.wc-block-mini-cart__items .wc-block-components-quantity-selector { width: auto; height: 32px; margin: 0; border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius); background: var(--wp--preset--color--surface); box-shadow: none; }
.wc-block-mini-cart__items .wc-block-components-quantity-selector::after { display: none; }
.wc-block-mini-cart__items .wc-block-components-quantity-selector__input { width: 32px; min-width: 0; height: 100%; padding: 0; font-size: 13px; color: var(--wp--preset--color--ink); }
.wc-block-mini-cart__items .wc-block-components-quantity-selector__button { width: 28px; min-width: 0; height: 100%; padding: 0; font-size: 14px; color: var(--wp--preset--color--muted); }
.wc-block-mini-cart__items .wc-block-components-quantity-selector__button:hover { color: var(--wp--preset--color--ink); }
.wc-block-mini-cart__items .wc-block-cart-item__remove-link { width: auto; height: auto; padding: 4px; border: 0; background: transparent; font-size: 12px; font-weight: 400; color: var(--wp--preset--color--muted); text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
.wc-block-mini-cart__items .wc-block-cart-item__remove-link svg { display: none; }
.wc-block-mini-cart__items .wc-block-cart-item__remove-link::after { content: "Remove"; }
:lang(ja) .wc-block-mini-cart__items .wc-block-cart-item__remove-link::after { content: "削除"; }
.wc-block-mini-cart__items .wc-block-cart-item__remove-link:hover { color: var(--wp--preset--color--ink); }
.wc-block-mini-cart__items .wc-block-cart-item__total { align-self: start; padding-top: 2px; text-align: right; }
.wc-block-mini-cart__items .wc-block-cart-item__total .price, .wc-block-mini-cart__items .wc-block-cart-item__total .price * { font-size: 14px; font-weight: 500; color: var(--wp--preset--color--ink); font-variant-numeric: tabular-nums; }
.wc-block-mini-cart__items .wc-block-components-sale-badge { display: none; }

/* Footer: subtotal, note, checkout, continue shopping */
.wc-block-mini-cart__footer { flex-shrink: 0; padding: 24px; border-top: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--surface); }
.wc-block-mini-cart__footer .wc-block-mini-cart__footer-subtotal { padding: 0; margin: 0 0 6px; }
.wc-block-mini-cart__footer .wc-block-components-totals-item__label { font-size: 15px; font-weight: 500; color: var(--wp--preset--color--ink); }
.wc-block-mini-cart__footer .wc-block-components-totals-item__value { font-size: 20px; font-weight: 500; color: var(--wp--preset--color--ink); font-variant-numeric: tabular-nums; }
.wc-block-components-drawer .wc-block-mini-cart__footer .wc-block-components-totals-item.wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__description { display: block; margin: 0; font-size: 12px; line-height: 1.4; color: var(--wp--preset--color--muted); }
.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions { display: flex; flex-direction: column; margin-top: 24px; }
.wc-block-mini-cart__items .wc-block-cart-item__image > img[hidden] { display: none; }
.wc-block-mini-cart__footer .wc-block-components-button { box-sizing: border-box; width: 100%; min-height: 48px; border-radius: var(--wp--custom--radius-lg); font-size: 14px; font-weight: 500; letter-spacing: .04em; }
.wc-block-mini-cart__footer-checkout, .wc-block-mini-cart__footer-checkout:hover { background: var(--wp--preset--color--cta); color: #fff; border: 0; }
.wp-block-anarta-minicart-continue { display: block; width: 100%; margin: 10px 0 0; padding: 8px; border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--wp--preset--color--muted); text-align: center; cursor: pointer; transition: color .2s var(--wp--custom--ease); }
.wp-block-anarta-minicart-continue:hover { color: var(--wp--preset--color--ink); }

/* Empty state */
.wp-block-woocommerce-empty-mini-cart-contents-block { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; }
.wp-block-woocommerce-empty-mini-cart-contents-block p, .wp-block-woocommerce-empty-mini-cart-contents-block p strong { margin: 0 0 24px; font-weight: 400; font-size: 18px; font-weight: 400; color: var(--wp--preset--color--ink); }
.wp-block-woocommerce-empty-mini-cart-contents-block .wc-block-mini-cart__shopping-button { margin: 0; }
.wp-block-woocommerce-empty-mini-cart-contents-block .wc-block-components-button { min-height: 44px; padding: 0 28px; border-radius: var(--wp--custom--radius-lg); background: var(--wp--preset--color--cta); color: #fff; border: 0; font-size: 14px; font-weight: 500; }
