/**
 * FineCenter - Tax Display Preferences v1.5.0
 */

.fc-tax-display-switch {
    --fc-tax-border: #d7dce2;
    --fc-tax-text: #1f2937;
    --fc-tax-muted: #6b7280;
    --fc-tax-bg: #ffffff;
    --fc-tax-active-bg: #111827;
    --fc-tax-active-text: #ffffff;
    --fc-tax-focus: rgba(17, 24, 39, 0.18);

    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
    color: var(--fc-tax-text);
    line-height: 1.35;
}

.fc-tax-display-switch__label {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.fc-tax-display-switch__options {
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--fc-tax-border);
    border-radius: 9px;
    background: var(--fc-tax-bg);
}

.fc-tax-display-switch__option {
    appearance: none;
    min-height: 34px;
    padding: 6px 11px;
    border: 0;
    border-left: 1px solid var(--fc-tax-border);
    border-radius: 0;
    background: transparent;
    color: var(--fc-tax-text);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.fc-tax-display-switch__option:last-child {
    border-left: 0;
}

.fc-tax-display-switch__option:hover:not(:disabled) {
    background: #f3f4f6;
}

.fc-tax-display-switch__option.is-active {
    background: var(--fc-tax-active-bg);
    color: var(--fc-tax-active-text);
}

.fc-tax-display-switch__option:focus-visible {
    position: relative;
    z-index: 1;
    outline: 3px solid var(--fc-tax-focus);
    outline-offset: -2px;
}

.fc-tax-display-switch__option:disabled {
    cursor: wait;
    opacity: 0.65;
}

.fc-tax-display-switch__status {
    min-width: 0;
    font-size: 11px;
    color: var(--fc-tax-muted);
}

.fc-tax-display-switch__status:empty {
    display: none;
}

.fc-tax-display-switch__status.is-success {
    color: #08783e;
}

.fc-tax-display-switch__status.is-error {
    color: #b42318;
}

.fc-tax-display-switch__status.is-saving {
    color: var(--fc-tax-muted);
}

/* Header / compact login bar */
.fc-tax-display-switch--header {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    gap: 5px;
    margin: 0;
    text-align: center;
}

.fc-tax-display-switch--header .fc-tax-display-switch__label {
    display: block;
    width: 100%;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.fc-tax-display-switch--header .fc-tax-display-switch__options {
    border-radius: 8px;
}

.fc-tax-display-switch--header .fc-tax-display-switch__option {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 11px;
}

.fc-tax-display-switch--header .fc-tax-display-switch__status {
    display: none;
}

/* Elementor login bar with the existing LOG class */
.LOG .fc-tax-display-switch--header {
    flex: 0 0 auto;
    align-self: center;
}

.LOG .elementor-shortcode:has(.fc-tax-display-switch--header) {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
 * Mobile login/profile widget
 * ========================================================= */
.fc-mobile-login-widget,
.fc-mobile-login-widget * {
    box-sizing: border-box;
}

.fc-mobile-login-widget {
    display: inline-block;
    direction: rtl;
}

.fc-mobile-login-widget .login-icon-wrap {
    display: inline-block;
}

.fc-mobile-login-widget .login-icon-btn {
    width: 33px;
    height: 33px;
    padding: 0;
    border: 1.5px solid #7a7a7a;
    border-radius: 50%;
    background: #fff;
    color: #7a7a7a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.fc-mobile-login-widget.is-logged-in .login-icon-btn,
.fc-mobile-login-widget .login-icon-btn[aria-expanded="true"] {
    background: #efefef;
}

.fc-mobile-login-widget .login-icon-btn:hover {
    background: #f4f4f4;
}

.fc-mobile-login-widget .login-icon-btn:focus-visible {
    outline: 3px solid rgba(122, 122, 122, 0.22);
    outline-offset: 2px;
}

.fc-mobile-login-user-icon {
    width: 20px;
    height: 20px;
    display: block;
    color: #7a7a7a;
    overflow: visible;
}

.fc-mobile-login-widget .login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
}

.fc-mobile-login-widget .login-overlay.open {
    display: block;
}

.fc-mobile-login-widget .login-popup {
    width: min(300px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 20px 16px 16px;
    border: 1px solid #7a7a7a;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(17, 24, 39, 0.18);
    direction: rtl;
    position: fixed;
    pointer-events: auto;
    z-index: 100000;
}

.fc-mobile-login-widget .popup-close {
    position: absolute;
    top: 7px;
    left: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #aaa;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.fc-mobile-login-widget .popup-close:hover {
    background: #f5f5f5;
    color: #666;
}

.fc-mobile-login-widget .popup-title {
    margin-bottom: 12px;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.fc-mobile-login-widget .fc-mobile-login-form input[type="text"],
.fc-mobile-login-widget .fc-mobile-login-form input[type="password"] {
    width: 100%;
    height: 38px;
    margin: 0 0 8px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f5f5f5;
    color: #222;
    font-size: 13px;
    text-align: right;
    display: block;
}

.fc-mobile-login-widget .fc-mobile-login-form input:focus {
    border-color: #7a7a7a;
    outline: 2px solid rgba(122, 122, 122, 0.14);
}

.fc-mobile-login-widget .popup-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
    color: #888;
    font-size: 12px;
}

.fc-mobile-login-widget .popup-bottom-row label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    white-space: nowrap;
}

.fc-mobile-login-widget .popup-bottom-row input[type="checkbox"] {
    margin: 0;
}

.fc-mobile-login-widget .popup-bottom-row a {
    color: #7a7a7a;
    text-decoration: none;
}

.fc-mobile-login-widget .popup-submit {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: #7a7a7a;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.fc-mobile-login-widget .popup-submit:hover {
    background: #666;
}

.fc-mobile-login-widget .profile-avatar {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    border: 2px solid #7a7a7a;
    border-radius: 50%;
    background: #efefef;
    color: #7a7a7a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.fc-mobile-login-widget .profile-name {
    margin-bottom: 2px;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.fc-mobile-login-widget .profile-email {
    margin-bottom: 13px;
    color: #999;
    font-size: 12px;
    text-align: center;
    overflow-wrap: anywhere;
}

.fc-mobile-login-widget .profile-divider {
    margin: 13px 0 12px;
    border: 0;
    border-top: 1px solid #eee;
}

.fc-mobile-login-widget .profile-btn {
    width: 100%;
    min-height: 38px;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    text-decoration: none;
    display: block;
}

.fc-mobile-login-widget .btn-card {
    border: 1px solid #7a7a7a;
    background: #7a7a7a;
    color: #fff;
}

.fc-mobile-login-widget .btn-card:hover {
    background: #666;
    color: #fff;
}

.fc-mobile-login-widget .btn-logout {
    border: 1px solid #fcc;
    background: #fff;
    color: #c03;
}

.fc-mobile-login-widget .btn-logout:hover {
    background: #fff5f7;
    color: #a00028;
}

.fc-mobile-tax-display-section {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #f9fafb;
}

.fc-tax-display-switch--mobile-popup {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.fc-tax-display-switch--mobile-popup .fc-tax-display-switch__label {
    width: 100%;
    color: #333;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    display: block;
}

.fc-tax-display-switch--mobile-popup .fc-tax-display-switch__options {
    width: 100%;
    display: flex;
    border-color: #cfd4da;
    border-radius: 8px;
}

.fc-tax-display-switch--mobile-popup .fc-tax-display-switch__option {
    flex: 1 1 50%;
    min-height: 36px;
    padding: 7px 6px;
    font-size: 11px;
}

.fc-tax-display-switch--mobile-popup .fc-tax-display-switch__status {
    width: 100%;
    min-height: 0;
    font-size: 10px;
    text-align: right;
}

@media (min-width: 768px) {
    .fc-mobile-login-widget {
        display: none;
    }
}

/* =========================================================
 * Desktop login title
 * מסתיר את כותרת ההתחברות כאשר משתמש WordPress מחובר.
 * באלמנטור יש להגדיר על הכותרת CSS class בשם Title_login.
 * ========================================================= */
@media (min-width: 1025px) {
    body.logged-in .Title_login {
        display: none !important;
    }
}


/* =========================================================
   Full-screen price display transition
   ========================================================= */
body.fc-tax-display-is-updating {
  overflow: hidden !important;
}

.fc-tax-display-updating-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  direction: rtl;
  background: rgba(255, 255, 255, 0.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.fc-tax-display-updating-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.fc-tax-display-updating-overlay__panel {
  min-width: min(310px, calc(100vw - 40px));
  min-height: 112px;
  padding: 22px 24px;
  border: 1px solid #dedede;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #333;
  text-align: center;
}

.fc-tax-display-updating-overlay__spinner {
  width: 31px;
  height: 31px;
  border: 3px solid #dedede;
  border-top-color: #7a7a7a;
  border-radius: 50%;
  animation: fc-tax-display-spin 0.72s linear infinite;
}

.fc-tax-display-updating-overlay__text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

@keyframes fc-tax-display-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .fc-tax-display-updating-overlay,
  .fc-tax-display-updating-overlay__spinner {
    transition: none;
    animation-duration: 1.4s;
  }
}
