/**
 * Copyright © Inn. All rights reserved.
 * Inn_AccountControl
 *
 * Hides the customer login / account / registration UI when accounts are
 * disabled. Server-side the related blocks are removed and registration is
 * disallowed, but the header links live inside the block_html-cached header,
 * so they are hidden here via the "inn-accounts-disabled" body class (set by
 * Inn\AccountControl\Plugin\Framework\View\Page\ConfigPlugin).
 */

/* Header / top links: "Sign In", "My Account", "Create an Account" */
body.inn-accounts-disabled li.authorization-link,
body.inn-accounts-disabled .authorization-link,
body.inn-accounts-disabled .header.links .authorization-link,
body.inn-accounts-disabled .panel.header .authorization-link,
body.inn-accounts-disabled a[href*="customer/account/login"],
body.inn-accounts-disabled a[href*="customer/account/create"],
body.inn-accounts-disabled a[href*="customer/account/forgotpassword"],
body.inn-accounts-disabled li.link.authorization-link,
body.inn-accounts-disabled .header .links > li > a[href*="customer/account"] {
    display: none !important;
}

/* Hide the list item that wraps any remaining account/login link
   (keeps the menu free of empty bullets). */
body.inn-accounts-disabled .header.links li:has(> a[href*="customer/account"]),
body.inn-accounts-disabled .panel.header .links li:has(> a[href*="customer/account"]),
body.inn-accounts-disabled .customer-welcome,
body.inn-accounts-disabled .customer-name {
    display: none !important;
}

/* "Account" (Konto) tab in the mobile off-canvas navigation (store.links). */
body.inn-accounts-disabled .navigation .nav-sections-item-title[aria-controls*="store"],
body.inn-accounts-disabled .nav-sections-item-title[aria-controls="store.links"] {
    display: none !important;
}

/* Authentication popup trigger / modal. */
body.inn-accounts-disabled .block-authentication,
body.inn-accounts-disabled .authentication-wrapper,
body.inn-accounts-disabled .action.showcart ~ .authentication-dropdown {
    display: none !important;
}

/* Checkout email step: hard-coded knockout note
   "You can create an account after checkout." that cannot be removed via
   layout because it lives inside a JS template. */
body.inn-accounts-disabled #customer-email ~ .note {
    display: none !important;
}

/* Any other link into the account area, e.g. "Mein Konto", "Meine
   Bestellungen" or "Wunschliste" in the footer CMS blocks. Those pages need a
   login, so the links would only lead to the (blocked) login page. The list
   item is hidden too so no empty bullet remains. */
body.inn-accounts-disabled a[href*="/customer/account"],
body.inn-accounts-disabled a[href*="/sales/order/history"],
body.inn-accounts-disabled a[href*="/wishlist"],
body.inn-accounts-disabled li:has(> a[href*="/customer/account"]),
body.inn-accounts-disabled li:has(> a[href*="/sales/order/history"]),
body.inn-accounts-disabled li:has(> a[href*="/wishlist"]) {
    display: none !important;
}
